/* 現代化 UI 美化樣式 */

/* 全局樣式重置和基礎設定 */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft JhengHei', 'PingFang TC', 'Noto Sans TC', sans-serif;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: #333;
    line-height: 1.6;
}

/* 主容器美化 */
.main, .container, .login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin: 2rem auto;
    max-width: 1200px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 標題美化 */
h1, h2, h3, h4, h5, h6 {
    color: #2d3748;
    font-weight: 600;
    margin-bottom: 1rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

h2 {
    font-size: 2rem;
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1.5rem;
}

/* 登入頁面美化 */
.login-container {
    max-width: 400px;
    margin: 10vh auto;
    text-align: center;
    animation: fadeInUp 0.6s ease-out;
}

.login-container form {
    padding: 2rem;
}

.login-container label {
    display: block;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.login-container input[type="text"],
.login-container input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.login-container input[type="text"]:focus,
.login-container input[type="password"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.loginbtn {
    width: 100%;
    padding: 0.875rem 2rem;
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.loginbtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.loginbtn:active {
    transform: translateY(0);
}

/* Tab 導航美化 */
.nav-tabs {
    border: none;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.5rem;
    backdrop-filter: blur(10px);
}

.nav-tabs .nav-item {
    margin: 0;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    color: #64748b;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 0 0.25rem;
    background: transparent;
}

.nav-tabs .nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #334155;
    transform: translateY(-1px);
}

.nav-tabs .nav-link.active {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

/* 表格美化 */
.table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: none;
}

.table thead th {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: white;
    font-weight: 600;
    border: none;
    padding: 1rem;
    text-align: center;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: all 0.3s ease;
    border: none;
}

.table tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
    transform: scale(1.01);
}

.table tbody td {
    padding: 1rem;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

/* 搜索欄美化 */
.searchBar {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.searchBarCell {
    display: flex;
    flex-direction: column;
}

.searchBarCell label {
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.searchBarCell input,
.searchBarCell select {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: white;
}

.searchBarCell input:focus,
.searchBarCell select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 按鈕美化 */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #718096, #4a5568);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #4299e1, #3182ce);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
    color: white;
}

/* 卡片美化 */
.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: white;
    padding: 1.5rem;
    border-radius: 16px 16px 0 0;
    border: none;
}

.card-body {
    padding: 2rem;
}

/* 表單美化 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-control {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.form-control:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

/* 統計卡片 */
.stats-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border-left: 4px solid #3b82f6;
}

.stats-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.stats-card h4 {
    color: #3b82f6;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stats-card p {
    color: #64748b;
    font-weight: 500;
    margin: 0;
}

/* 動畫效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .main, .container, .login-container {
        margin: 1rem;
        padding: 1.5rem;
    }
    
    .searchBar {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .nav-tabs {
        flex-direction: column;
    }
    
    .nav-tabs .nav-link {
        margin: 0.25rem 0;
    }
}

/* 載入動畫美化 */
.loading-overlay {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

.loading-spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 提示訊息美化 */
.alert {
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border: none;
    backdrop-filter: blur(10px);
}

.alert-success {
    background: rgba(72, 187, 120, 0.1);
    color: #2f855a;
    border-left: 4px solid #48bb78;
}

.alert-danger {
    background: rgba(245, 101, 101, 0.1);
    color: #c53030;
    border-left: 4px solid #f56565;
}

.alert-warning {
    background: rgba(237, 137, 54, 0.1);
    color: #c05621;
    border-left: 4px solid #ed8936;
}

.alert-info {
    background: rgba(66, 153, 225, 0.1);
    color: #2c5282;
    border-left: 4px solid #4299e1;
}

/* 密碼可見性控制美化 */
.visibility-pwd-container {
    position: relative;
    display: flex;
    align-items: center;
}

.visibility-pwd-container span {
    position: absolute;
    right: 12px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.visibility-pwd-container span:hover {
    opacity: 1;
}

.visibility-pwd-container img {
    width: 20px;
    height: 20px;
}

/* 分頁美化 */
.pagination {
    justify-content: center;
    margin-top: 2rem;
}

.pagination .page-link {
    border: none;
    padding: 0.75rem 1rem;
    margin: 0 0.25rem;
    border-radius: 8px;
    color: #64748b;
    background: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.pagination .page-link:hover {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: white;
    transform: translateY(-1px);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

/* 徽章美化 */
.badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.badge-danger {
    background: linear-gradient(135deg, #f56565, #e53e3e);
    color: white;
}

.badge-warning {
    background: linear-gradient(135deg, #ed8936, #dd6b20);
    color: white;
}

.badge-info {
    background: linear-gradient(135deg, #4299e1, #3182ce);
    color: white;
}

.badge-secondary {
    background: linear-gradient(135deg, #718096, #4a5568);
    color: white;
}
