/* Client Dashboard Theme - Blue/Red Color Scheme with Modern Visual Effects */
:root {
    /* Primary palette - Navy Blue theme */
    --primary-color: #1f2a47;
    --primary-dark: #18223b;
    --primary-light: #2d3a5d;
    --secondary-color: #bf5c5c; /* Red accent for CTAs */
    --secondary-dark: #a85050;
    --secondary-light: #d47272;
    --accent-color: #3b82f6; /* Blue accent */
    --accent-light: #60a5fa;
    
    /* Neutral colors */
    --background-color: #ffffff;
    --surface-color-1: #f8fafc;
    --surface-color-2: #f1f5f9;
    --surface-color-3: #e2e8f0;
    
    /* Text colors */
    --text-color: #1e293b;
    --text-color-2: #475569;
    --text-muted: #94a3b8;
    --text-light: #ffffff;
    
    /* Status colors */
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    
    /* Borders */
    --border-color: #e2e8f0;
    --border-light: rgba(255, 255, 255, 0.1);
    
    /* Gradients - Blue/Red theme */
    --gradient-hero: linear-gradient(135deg, #1f2a47 0%, #2d3a5d 50%, #1f2a47 100%);
    --gradient-mesh: 
        radial-gradient(at 40% 20%, rgba(59, 130, 246, 0.25) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(191, 92, 92, 0.2) 0px, transparent 50%),
        radial-gradient(at 0% 50%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 80% 50%, rgba(191, 92, 92, 0.15) 0px, transparent 50%);
    --gradient-cta: linear-gradient(135deg, #bf5c5c 0%, #a85050 100%);
    --gradient-text: linear-gradient(135deg, #3b82f6 0%, #bf5c5c 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 40px rgba(191, 92, 92, 0.3);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.06);
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    /* Spacing & Sizing */
    --border-radius-sm: 6px;
    --border-radius: 10px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    --border-radius-full: 9999px;
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base styles */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--surface-color-1);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 1rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-color);
}

h1 { font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); }
h4 { font-size: 1.125rem; }

p {
    margin: 0 0 1rem;
    color: var(--text-color-2);
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

a:hover {
    color: var(--accent-light);
}

.gradient-text {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.text-highlight {
    color: var(--secondary-color);
    font-weight: 600;
}

/* ================================
   HEADER
   ================================ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(31, 42, 71, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.75rem 0;
    transition: var(--transition-base);
}

.header.scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.15);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-wrapper {
    display: flex;
    align-items: center;
}

.logo {
    height: 50px;
    width: auto;
    transition: var(--transition-base);
}

.logo:hover {
    transform: scale(1.02);
}

.main-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-base);
    position: relative;
    padding: 0.5rem 0;
}

.nav-link::after {
    content: "";
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-cta);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--text-light);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active::after {
    width: 100%;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-cta);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: white;
}

/* ================================
   BUTTONS
   ================================ */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-base);
    border: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

.button-arrow {
    transition: transform 0.2s ease;
}

.button:hover .button-arrow {
    transform: translateX(3px);
}

.button-primary {
    background: var(--gradient-cta);
    color: white;
    box-shadow: var(--shadow-sm);
}

.button-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), 0 0 20px rgba(191, 92, 92, 0.2);
}

.button-primary:active {
    transform: translateY(0);
}

.button-secondary {
    background: var(--primary-color);
    color: white;
    box-shadow: var(--shadow-sm);
}

.button-secondary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.button-outline {
    background: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
}

.button-outline:hover {
    background: var(--secondary-color);
    color: white;
}

.button-text {
    background: transparent;
    color: var(--secondary-color);
    padding: 0.5rem 0.75rem;
    font-weight: 600;
}

.button-text:hover {
    color: var(--secondary-dark);
}

.button-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.button-icon {
    padding: 0.5rem;
    background-color: transparent;
    border: none;
    color: var(--text-muted);
    border-radius: var(--border-radius-sm);
    transition: var(--transition-fast);
}

.button-icon:hover {
    background-color: var(--surface-color-1);
    color: var(--text-color);
    transform: none;
    box-shadow: none;
}

.button-icon .icon-small {
    width: 18px;
    height: 18px;
}

/* ================================
   PAGE HEADER / HERO BANNER
   ================================ */
.page-header {
    background: var(--gradient-hero);
    position: relative;
    padding: 6rem 0 3rem;
    margin-bottom: 0;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-mesh);
    opacity: 1;
}

.page-header-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.page-header-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.page-header-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ================================
   STATS BAR
   ================================ */
.stats-bar {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
    position: relative;
}

.stats-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-cta);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.stat-item {
    text-align: center;
    padding: 0.75rem;
    position: relative;
}

.stat-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 50%;
    width: 1px;
    background: var(--border-color);
}

.stat-number {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 800;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.25rem;
    line-height: 1.1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-color-2);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ================================
   DASHBOARD SECTION
   ================================ */
.dashboard-section {
    padding: 2rem 0 4rem;
    background: linear-gradient(180deg, var(--surface-color-1) 0%, white 100%);
    min-height: calc(100vh - 200px);
}

.dashboard-welcome {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.dashboard-welcome::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-cta);
}

.dashboard-welcome-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.dashboard-welcome-subtitle {
    color: var(--text-color-2);
    margin: 0;
    font-size: 0.95rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.dashboard-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: var(--transition-base);
}

.dashboard-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.dashboard-card.span-2 {
    grid-column: span 2;
}

.dashboard-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.dashboard-card-title {
    font-size: 1rem;
    margin: 0;
    color: var(--text-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dashboard-card-title .button {
    padding: 0.4rem 1rem;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: none;
    border-radius: var(--border-radius-sm);
}

.dashboard-card-title .button:hover {
    transform: none;
    box-shadow: none;
}

.card-icon {
    width: 20px;
    height: 20px;
    color: var(--secondary-color);
}

.dashboard-card-content {
    flex: 1;
}

.dashboard-card-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-card-stat {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Dashboard Table */
.dashboard-table {
    width: 100%;
    border-collapse: collapse;
}

.dashboard-table th {
    background-color: var(--surface-color-1);
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-color-2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--border-radius-sm);
}

.dashboard-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.dashboard-table tr:last-child td {
    border-bottom: none;
}

.dashboard-table tr:hover td {
    background-color: var(--surface-color-1);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.75rem;
    border-radius: var(--border-radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-completed, .status-ok, .status-active {
    background-color: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.status-failed, .status-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.status-processing, .status-warning, .status-throttled, .status-pending {
    background-color: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    background-color: var(--surface-color-2);
    border-radius: var(--border-radius-full);
    height: 6px;
    margin-top: 0.75rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-cta);
    border-radius: var(--border-radius-full);
    transition: width 0.5s ease;
}

/* Time Saved Card */
.time-saved-content {
    text-align: center;
    padding: 1rem 0;
}

.time-saved-value {
    margin: 1rem 0;
}

.large-stat {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.time-saved-equivalent {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.time-saved-summary {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}

/* API Usage Summary */
.api-usage-summary {
    background: var(--surface-color-1);
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-color-2);
    line-height: 1.6;
}

.api-usage-summary strong {
    color: var(--text-color);
}

/* ================================
   NOTIFICATIONS
   ================================ */
.notifications-container {
    max-height: 320px;
    overflow-y: auto;
    padding-right: 8px;
}

.notifications-container::-webkit-scrollbar {
    width: 5px;
}

.notifications-container::-webkit-scrollbar-track {
    background: transparent;
}

.notifications-container::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: var(--border-radius-full);
}

.notifications-container::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}

.notifications-container {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.notifications-items-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.5rem;
}

.notification-item:hover {
    background-color: var(--surface-color-1);
}

.notification-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.notification-item.viewed {
    opacity: 0.6;
}

.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.notification-header .timestamp {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.notification-header .task-type {
    font-weight: 600;
    color: var(--text-color);
}

.notification-message {
    font-size: 0.875rem;
    color: var(--text-color-2);
    line-height: 1.5;
}

.notification-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.notification-controls label {
    color: var(--text-color-2);
}

#show-viewed-toggle {
    accent-color: var(--secondary-color);
}

.notification-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

/* Month Selector */
.month-selector select {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-family: var(--font-sans);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background-color: white;
    color: var(--text-color);
    cursor: pointer;
    transition: var(--transition-fast);
}

.month-selector select:hover {
    border-color: var(--secondary-color);
}

.month-selector select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(191, 92, 92, 0.1);
}

/* Action cells */
.action-cell {
    text-align: center;
}

/* Scrollbar for talent card */
#recent-talent-card .dashboard-card-content {
    max-height: 260px;
    overflow-y: auto;
    padding-right: 8px;
}

#recent-talent-card .dashboard-card-content::-webkit-scrollbar {
    width: 5px;
}

#recent-talent-card .dashboard-card-content::-webkit-scrollbar-track {
    background: transparent;
}

#recent-talent-card .dashboard-card-content::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: var(--border-radius-full);
}

#recent-talent-card .dashboard-card-content {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

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

.spin {
    animation: spin 1s linear infinite;
}

/* ================================
   FOOTER
   ================================ */
.footer {
    background-color: var(--primary-dark);
    padding: 3rem 0 1.5rem;
    color: white;
}

.footer-main {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
}

.footer-tagline {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.footer-description {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    margin: 0;
}

.footer-links-group h4 {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: var(--transition-fast);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

/* ================================
   UTILITIES
   ================================ */
.loading-text, .no-notifications, .error-text {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

.error { color: var(--error-color); }
.success { color: var(--success-color); }

/* ================================
   RESPONSIVE DESIGN
   ================================ */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-item:nth-child(2)::after {
        display: none;
    }
    
    .footer-main {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-nav {
        width: 100%;
        justify-content: center;
        gap: 1.5rem;
        flex-wrap: wrap;
    }
    
    .header-actions {
        width: 100%;
        justify-content: center;
    }
    
    .page-header {
        padding: 5rem 0 2rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-item::after {
        display: none;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-card.span-2 {
        grid-column: span 1;
    }
    
    .footer-main {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    .footer-brand {
        align-items: center;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .large-stat {
        font-size: 2rem;
    }
    
    .page-header-title {
        font-size: 1.5rem;
    }
    
    .dashboard-welcome {
        padding: 1rem 1.25rem;
    }
    
    .dashboard-card {
        padding: 1.25rem;
    }
}
