/* 管理介面專用樣式 */

/* 全局樣式 */
.admin-container {
    background-color: #f8f9fa;
    min-height: 100vh;
}

/* 儀表板卡片樣式 */
.dashboard-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.dashboard-card .card-body {
    padding: 1.5rem;
}

/* 緊密卡片樣式 */
.compact-card {
    min-height: 110px;
    max-height: 120px;
}

.compact-card .card-body {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.card-row {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0;
    line-height: 1.1;
}

.card-row:first-child {
    flex: 0.6;
}

.card-row:nth-child(2) {
    flex: 1.2;
}

.card-row:last-child {
    flex: 0.7;
}

.dashboard-card h4 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.dashboard-card p {
    font-size: 1rem;
    opacity: 0.9;
}

.dashboard-card .fa-2x {
    opacity: 0.8;
    font-size: 1.8rem;
}

/* 統計卡片顏色主題 */
.card-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.card-success {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.card-warning {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.card-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.card-secondary {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.card-info {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

/* 圖表容器樣式 */
.chart-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chart-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.chart-container h5 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-align: center;
}

.chart-wrapper {
    position: relative;
    height: 300px;
    margin: 0 auto;
}

/* 載入動畫 */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* 錯誤訊息樣式 */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid #f5c6cb;
    text-align: center;
    margin: 1rem 0;
}

/* 快速操作區域 */
.quick-actions .card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.quick-actions .btn {
    border-radius: 10px;
    padding: 1rem 2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.quick-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 表格樣式優化 */
.admin-table {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.admin-table .table {
    margin-bottom: 0;
}

.admin-table .table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    padding: 1rem;
}

.admin-table .table tbody tr {
    transition: background-color 0.2s ease;
}

.admin-table .table tbody tr:hover {
    background-color: #f8f9fa;
}

.admin-table .table td {
    padding: 1rem;
    vertical-align: middle;
}

/* 題目預覽樣式 */
.question-preview {
    max-width: 400px;
}

.question-preview strong {
    color: #495057;
    line-height: 1.4;
}

.question-preview .small {
    line-height: 1.3;
}

/* 表格文字樣式 */
td {
    color: #000000 !important;
}

/* 狀態徽章樣式 */
.badge {
    font-size: 0.8rem;
    padding: 0.5rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
}

.badge-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: #ffffff !important;
}

/* 狀態欄專用樣式 - 使用Bootstrap CSS變數系統 */
.status-badge .badge.badge-success {
    --bs-badge-color: #2563eb !important; /* 啟用 - 藍色 */
    --bs-badge-bg: transparent !important;
    border: none !important;
}

.status-badge .badge.badge-secondary {
    --bs-badge-color: #dc2626 !important; /* 停用 - 紅色 */
    --bs-badge-bg: transparent !important;
    border: none !important;
}

/* 操作按鈕樣式 */
.btn-outline-primary {
    border-color: #667eea;
    color: #667eea;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: #667eea;
    border-color: #667eea;
    transform: translateY(-1px);
}

.btn-outline-success {
    border-color: #28a745;
    color: #28a745;
    transition: all 0.3s ease;
}

.btn-outline-success:hover {
    background-color: #28a745;
    border-color: #28a745;
    transform: translateY(-1px);
}

.btn-outline-warning {
    border-color: #ffc107;
    color: #ffc107;
    transition: all 0.3s ease;
}

.btn-outline-warning:hover {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
    transform: translateY(-1px);
}

.btn-outline-danger {
    border-color: #dc3545;
    color: #dc3545;
    transition: all 0.3s ease;
}

.btn-outline-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    transform: translateY(-1px);
}

/* 統計圖表卡片樣式 */
.chart-card {
    height: 400px;
    display: flex;
    flex-direction: column;
}

.chart-card .card-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.chart-card canvas {
    max-height: 280px !important;
    width: 100% !important;
}

/* 確保所有統計圖表區域的卡片高度一致 */
.row .col-md-4 .card {
    height: 400px;
    display: flex;
    flex-direction: column;
}

.row .col-md-4 .card .card-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .chart-card {
        height: 350px;
    }
    
    .row .col-md-4 .card {
        height: 350px;
        margin-bottom: 1rem;
    }

    .dashboard-card .card-body {
        padding: 1.5rem;
    }
    
    .dashboard-card h4 {
        font-size: 2rem;
    }
    
    .chart-container {
        padding: 1rem;
    }
    
    .chart-wrapper {
        height: 250px;
    }
}

@media (max-width: 576px) {
    .dashboard-card h4 {
        font-size: 1.75rem;
    }
    
    .chart-wrapper {
        height: 200px;
    }
}