/* Analytics Dashboard Styles */
.analytics-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.analytics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-content {
    text-align: left;
}

.header-content h1 {
    font-size: 2.5rem;
    color: #2c3ca9;
    margin-bottom: 0.5rem;
    margin: 0;
}

.analytics-subtitle {
    color: #666;
    font-size: 1.1rem;
    margin: 0.5rem 0 0 0;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-logout {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-logout:hover {
    background: linear-gradient(135deg, #c82333, #b21e2f);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.analytics-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 1rem;
}

.tab-button {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.tab-button.active {
    background: linear-gradient(135deg, #2c3ca9, #e63573);
    color: white;
}

.tab-button:hover:not(.active) {
    background: #f8f9fa;
    color: #2c3ca9;
}

.loading-spinner {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c3ca9;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

.chart-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.category-distribution {
    margin-top: 1rem;
}

.category-bar {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
}

.category-name {
    min-width: 150px;
    font-weight: 500;
    color: #333;
}

.category-progress {
    flex: 1;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #2c3ca9, #e63573);
    transition: width 0.3s ease;
}

.category-count {
    font-weight: bold;
    color: #2c3ca9;
    min-width: 30px;
}

.results-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
    margin-bottom: 2rem;
}

.table-header, .table-row {
    display: grid;
    grid-template-columns: 2fr 2fr 1.5fr 1fr 1.5fr;
    gap: 1rem;
    padding: 1rem;
    align-items: center;
}

.table-header {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
    border-bottom: 1px solid #e9ecef;
}

.table-row {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.table-row:hover {
    background-color: #f8f9fa;
}

.table-row:last-child {
    border-bottom: none;
}

.category-badge {
    background: linear-gradient(135deg, #2c3ca9, #e63573);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.quiz-type-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.quiz-type-badge.liftoff {
    background: #17a2b8;
    color: white;
}

.quiz-type-badge.orbit {
    background: #28a745;
    color: white;
}

.improvement-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.improvement-badge.positive {
    background: #d4edda;
    color: #155724;
}

.improvement-badge.negative {
    background: #f8d7da;
    color: #721c24;
}

.improvement-badge.neutral {
    background: #e9ecef;
    color: #495057;
}

/* Book Orders Analytics Styles */
.orders-tab {
    animation: fadeInUp 0.6s ease-out;
}

.orders-stats {
    margin-bottom: 2rem;
}

.order-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

/* Status-specific styling for order stats */
.stat-card.pending {
    border-left: 4px solid #ffa726;
}

.stat-card.confirmed {
    border-left: 4px solid var(--primary-blue);
}

.stat-card.shipped {
    border-left: 4px solid #66bb6a;
}

.stat-card.delivered {
    border-left: 4px solid #4caf50;
}

/* Orders table styling - Updated for no amount column */
.orders-table .table-header {
    grid-template-columns: 80px 150px 200px 80px 100px 120px 120px;
}

.orders-table .table-row {
    grid-template-columns: 80px 150px 200px 80px 100px 120px 120px;
}

/* Status badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.status-badge.pending {
    background: rgba(255, 167, 38, 0.1);
    color: #f57c00;
    border: 1px solid rgba(255, 167, 38, 0.3);
}

.status-badge.confirmed {
    background: rgba(44, 60, 169, 0.1);
    color: var(--primary-blue);
    border: 1px solid rgba(44, 60, 169, 0.3);
}

.status-badge.shipped {
    background: rgba(102, 187, 106, 0.1);
    color: #388e3c;
    border: 1px solid rgba(102, 187, 106, 0.3);
}

.status-badge.delivered {
    background: rgba(76, 175, 80, 0.1);
    color: #2e7d32;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.status-badge.cancelled {
    background: rgba(244, 67, 54, 0.1);
    color: #d32f2f;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.btn-action {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-action.confirm {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.btn-action.confirm:hover {
    background: rgba(76, 175, 80, 0.2);
}

.btn-action.cancel {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.btn-action.cancel:hover {
    background: rgba(244, 67, 54, 0.2);
}

.btn-action.ship {
    background: rgba(102, 187, 106, 0.1);
    color: #66bb6a;
    border: 1px solid rgba(102, 187, 106, 0.3);
}

.btn-action.ship:hover {
    background: rgba(102, 187, 106, 0.2);
}

.btn-action.deliver {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.btn-action.deliver:hover {
    background: rgba(76, 175, 80, 0.2);
}

/* Pending orders alert */
.alert-section {
    margin-top: 2rem;
}

.pending-orders-alert {
    background: linear-gradient(135deg, rgba(255, 167, 38, 0.1) 0%, rgba(255, 193, 7, 0.1) 100%);
    border: 1px solid rgba(255, 167, 38, 0.3);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.alert-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.alert-text {
    flex: 1;
    color: var(--text-dark);
}

.btn-secondary.small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Responsive adjustments for orders table */
@media (max-width: 1200px) {
    .order-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .orders-table .table-header,
    .orders-table .table-row {
        grid-template-columns: 60px 120px 150px 60px 80px 100px 100px;
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .order-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .orders-table .table-header,
    .orders-table .table-row {
        grid-template-columns: 50px 100px 120px 50px 70px 80px 80px;
        font-size: 0.85rem;
    }
    
    .action-buttons {
        gap: 0.125rem;
    }
    
    .btn-action {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
    
    .pending-orders-alert {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .analytics-header {
        flex-direction: column;
        text-align: center;
    }
    
    .header-content {
        text-align: center;
    }
    
    .header-content h1 {
        font-size: 2rem;
    }
}