/* ===== Google Fonts Import ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ===== CSS Variables for Corporate Blue Excellence Theme ===== */
:root {
    --sidebar-width: 240px;

    /* Minimal Pro Palette */
    --color-primary: #2563EB;             /* Accent blue */
    --color-primary-dark: #1E40AF;        /* Accent blue (dark) */
    --color-primary-light: #3B82F6;
    --color-neutral: #F7F7F7;             /* App background */
    --color-surface: #FFFFFF;             /* Cards/containers */
    --color-surface-2: #FBFBFC;           /* Subtle surface */
    --color-text: #111827;                /* Primary text */
    --color-text-light: #4B5563;          /* Secondary text (higher contrast) */
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-error: #EF4444;
    --color-white: #FFFFFF;
    --color-border: #E5E7EB;              /* Hairline border */
    --color-hover: #F3F4F6;               /* Hover surface */

    /* Radius & Shadows */
    --radius-xs: 6px;
    --radius-s: 8px;
    --radius-m: 12px;
    --radius-l: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 6px 20px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 30px rgba(0,0,0,0.08);

    /* Sidebar Variables */
    --sidebar-bg-color: var(--color-surface);
    --sidebar-link-color: var(--color-text);
    --sidebar-link-hover-bg: var(--color-hover);
    --sidebar-link-active-bg: var(--color-primary);
    --sidebar-link-active-color: var(--color-white);
}

/* Auto dark theme */
@media (prefers-color-scheme: dark) {
  :root {
    --color-neutral: #0B1220;
    --color-surface: #0F172A;
    --color-surface-2: #0B1220;
    --color-text: #E5E7EB;
    --color-text-light: #94A3B8;
    --color-border: #1F2937;
    --color-hover: #111827;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.6);
    --shadow-md: 0 6px 20px rgba(0,0,0,0.45);
    --shadow-lg: 0 12px 30px rgba(0,0,0,0.5);
  }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    background-color: var(--color-neutral);
    color: var(--color-text);
    position: relative;
    padding-top: 60px; /* Account for fixed top nav */
    font-weight: 400;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--color-text);
    font-weight: 600;
    margin-top: 0;
}

h1 {
    font-size: 1.875rem; /* 30px */
    font-weight: 700;
    text-align: center;
}

h2 {
    font-size: 1.5rem; /* 24px */
}

h3 {
    font-size: 1.25rem; /* 20px */
}

#config-selection, #chat-interface, .admin-section {
    background: var(--color-surface);
    padding: 24px;
    margin-bottom: 20px;
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

#chat-log {
    height: 400px;
    overflow-y: scroll;
    border: 1px solid var(--color-border);
    padding: 16px;
    margin-bottom: 16px;
    background-color: var(--color-neutral);
    border-radius: 8px;
}

#chat-log p {
    margin-bottom: 12px;
    line-height: 1.5;
}

#chat-log strong {
    color: var(--color-primary);
    font-weight: 600;
}

#input-area {
    display: flex;
    gap: 8px;
}

#user-input {
    flex-grow: 1;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#user-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#send-button, #start-button, #new-config-button, #add-phase-button, #save-config-button, #cancel-edit-button, #save-prompts-button, #evaluate-button {
    padding: 12px 20px;
    background-color: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

#send-button:hover, #start-button:hover, #new-config-button:hover, #add-phase-button:hover, #save-config-button:hover, #cancel-edit-button:hover, #save-prompts-button:hover, #evaluate-button:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

#send-button:disabled, #start-button:disabled, #save-config-button:disabled, #save-prompts-button:disabled, #evaluate-button:disabled {
    background-color: var(--color-text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#cancel-edit-button {
    background-color: var(--color-text-light);
    margin-left: 10px;
}

#cancel-edit-button:hover {
     background-color: #475569;
}

.error {
    color: var(--color-error);
    font-size: 0.875rem;
    margin-top: 8px;
    display: none;
    font-weight: 500;
}

.success {
    color: var(--color-success);
    font-size: 0.875rem;
    margin-top: 8px;
    display: none;
    font-weight: 500;
}

#config-selector, #language-selector {
    padding: 10px 12px;
    margin-right: 10px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    background-color: var(--color-white);
}

/* ===== Top Navigation Bar ===== */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1003;
    box-shadow: var(--shadow-sm);
}

.top-nav .nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.top-nav .nav-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex: 1;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-primary);
}

.nav-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.nav-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-primary);
}

.top-nav .nav-right {
    display: flex;
    align-items: center;
}

/* ===== Hamburger Menu for Mobile ===== */
.hamburger-menu {
    display: none;
    background: transparent;
    color: var(--color-text);
    border: none;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.5em;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.hamburger-menu:hover {
    background: var(--color-hover);
}

/* Hamburger icon (three lines) */
.hamburger-menu .hamburger-icon {
    position: relative;
    width: 24px;
    height: 18px;
    transition: all 0.3s ease;
}

.hamburger-menu .hamburger-icon span {
    display: block;
    position: absolute;
    height: 3px;
    width: 100%;
    background: var(--color-text);
    border-radius: 2px;
    opacity: 1;
    left: 0;
    transition: all 0.3s ease;
}

.hamburger-menu .hamburger-icon span:nth-child(1) {
    top: 0px;
}

.hamburger-menu .hamburger-icon span:nth-child(2) {
    top: 7px;
}

.hamburger-menu .hamburger-icon span:nth-child(3) {
    top: 14px;
}

/* Transform to X when menu is open */
.hamburger-menu.active .hamburger-icon span:nth-child(1) {
    top: 7px;
    transform: rotate(135deg);
}

.hamburger-menu.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
    left: -60px;
}

.hamburger-menu.active .hamburger-icon span:nth-child(3) {
    top: 7px;
    transform: rotate(-135deg);
}

/* ===== Top Right Logout Button ===== */
.top-right-logout { padding: 10px 16px; background: var(--color-primary); color: var(--color-white); border: 1px solid var(--color-primary); border-radius: var(--radius-s); cursor: pointer; font-size: 0.875rem; font-weight: 600; font-family: inherit; transition: all 0.2s ease; }
.top-right-logout:hover { background: var(--color-primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

/* Button primitives */
.btn { padding: 10px 16px; border-radius: var(--radius-s); font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; }
.btn--primary { background: var(--color-primary); color: var(--color-white); border: 1px solid var(--color-primary); }
.btn--primary:hover { background: var(--color-primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn--secondary { background: transparent; color: var(--color-text); border: 1px solid var(--color-border); }
.btn--secondary:hover { background: var(--color-hover); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

/* ===== Sidebar Navigation Layout ===== */
.body-with-sidebar {
    padding-left: var(--sidebar-width);
}

.sidebar {
    display: flex;
    flex-direction: column;
    position: fixed; 
    left: 0;
    top: 60px;
    height: calc(100vh - 60px);
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg-color);
    border-right: 1px solid var(--color-border);
    z-index: 100; 
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

.sidebar h2 {
    text-align: center;
    margin-bottom: 24px;
    margin-top: 20px;
    color: var(--color-text);
    font-size: 1.25rem;
    font-weight: 600;
    flex-shrink: 0;
}

/* Make the nav scrollable and take up available space */
.sidebar nav {
    flex-grow: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

.sidebar nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar nav li a {
    display: block;
    padding: 14px 24px;
    color: var(--sidebar-link-color);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0 25px 25px 0;
    margin-right: 8px;
    margin-bottom: 2px;
}

.sidebar nav li a:hover {
    background-color: var(--sidebar-link-hover-bg);
    color: var(--color-primary);
    transform: translateX(4px);
}

.sidebar nav li a.active {
    background-color: var(--sidebar-link-active-bg);
    color: var(--sidebar-link-active-color);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.main-content {
    padding: 32px;
    margin-left: 0;
    width: auto;
    min-height: calc(100vh - 60px);
}

/* Make profile/admin containers work within the new layout */
.profile-container, .admin-container {
    margin: 0;
    max-width: none;
    padding: 0;
}

/* ===== Import Code Section Styling (Minimal) ===== */
.import-code-section { margin: 20px 0; padding: 0; }

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 14px 16px;
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-s);
    margin: 15px 0 0 0;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
}
.collapsible-header:hover { background: var(--color-hover); box-shadow: var(--shadow-sm); }
.collapsible-header h3 { margin: 0; color: var(--color-text); font-size: 1rem; font-weight: 600; }
.collapse-arrow { font-size: 16px; color: var(--color-text-light); transition: transform 0.2s ease; }
.collapse-arrow.collapsed { transform: rotate(-90deg); }

.import-code-content { overflow: hidden; transition: max-height 0.3s ease; }
.import-code-content.collapsed { max-height: 0; }

.import-code-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-m);
    padding: 18px;
    margin: 12px 0;
    box-shadow: var(--shadow-sm);
}
.import-code-card h3 { color: var(--color-text); margin: 0 0 12px 0; font-size: 1rem; }
.import-code-card ol { margin: 12px 0; padding-left: 22px; color: var(--color-text-light); }
.import-code-card ol li { margin: 6px 0; line-height: 1.4; }

.import-code-display {
    display: flex; align-items: center; gap: 8px;
    background: var(--color-surface-2);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-s);
    padding: 10px 12px; margin: 12px 0;
    font-family: 'JetBrains Mono', monospace;
}
.import-code-display code {
    font-size: 16px; font-weight: 700; color: var(--color-primary);
    background: none; padding: 0; flex-grow: 1; letter-spacing: 2px;
}

.copy-btn {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xs);
    padding: 8px 10px; margin-left: 8px; cursor: pointer; font-size: 14px;
    transition: background 0.2s ease, transform 0.05s ease, box-shadow 0.2s ease;
}
.copy-btn:hover { background: var(--color-hover); box-shadow: var(--shadow-sm); }
.copy-btn:active { transform: scale(0.98); }
.copy-btn.copied { background: rgba(16,185,129,0.12); color: #047857; border-color: rgba(16,185,129,0.3); }

.import-code-info { margin: 8px 0 0 0; text-align: center; }
.import-code-info small { color: var(--color-text-light); font-style: italic; }


.import-code-actions { margin-top: 12px; text-align: center; }
.primary-btn, .secondary-btn {
    padding: 10px 16px; border-radius: var(--radius-s);
    font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s ease; margin: 0 4px;
}
.primary-btn { background: var(--color-primary); color: var(--color-white); border: 1px solid var(--color-primary); }
.primary-btn:hover { background: var(--color-primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.secondary-btn { background: transparent; color: var(--color-text); border: 1px solid var(--color-border); }
.secondary-btn:hover { background: var(--color-hover); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.primary-btn:disabled, .secondary-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }

/* ===== Media Queries for Responsive Design ===== */
@media (max-width: 768px) {
    body { padding-top: 56px; }
    /* Show hamburger menu and hide desktop sidebar */
    .hamburger-menu {
        display: flex !important;
    }
    
    /* Remove body padding and hide sidebar on mobile */
    .body-with-sidebar {
        padding-left: 0 !important;
    }
    
    .sidebar {
        position: fixed;
        left: -100%;
        top: 60px;
        height: calc(100vh - 60px);
        width: var(--sidebar-width);
        background-color: var(--sidebar-bg-color);
        border-right: 1px solid var(--color-border);
        z-index: 1001;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.35);
        transition: left 0.3s ease;
        transform: translateX(0);
    }
    
    .sidebar.mobile-open {
        left: 0;
    }
    
    /* Sidebar overlay for mobile */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        transition: opacity 0.3s ease;
        opacity: 0;
    }
    
    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
    
    /* Mobile-specific content adjustments */
    .main-content {
        padding: 20px 16px;
    }
    
    .profile-container, .admin-container {
        padding: 0;
    }
    
    .profile-card {
        padding: 20px;
        margin-bottom: 16px;
        border-radius: 8px;
    }

    /* Mobile cards layout */
    .interview-cards-container {
        gap: 12px;
    }
    
    .interview-card {
        padding: 16px;
    }
    
    .interview-card-body {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .interview-card-actions {
        justify-content: center;
        margin-top: 8px;
    }
    
    /* Mobile-specific navigation adjustments */
    .top-nav {
        padding: 0 16px;
    }
    
    .top-nav .nav-center {
        gap: 8px;
    }
    
    .nav-logo {
        height: 28px;
    }
    
    .nav-title {
        font-size: 1.1rem;
    }
    
    /* Chat interface mobile adjustments */
    #chat-log {
        height: 300px;
        padding: 12px;
    }
    
    #input-area {
        flex-direction: column;
        gap: 8px;
    }
    
    #user-input {
        margin-bottom: 0;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    #send-button {
        width: 100%;
        padding: 12px;
    }

    #interview-list .interview-list-item,
    #interview-list-hr .interview-list-item { line-height: 1.5; }
    
    /* Interview list mobile adjustments */
    #interview-list .interview-list-item,
    #interview-list-hr .interview-list-item {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    /* Chart container mobile adjustments */
    #details-section .chart-container {
        height: 250px;
        margin-top: 20px;
    }
}

/* Very small devices (480px and below) */
@media (max-width: 480px) {
    .main-content {
        padding: 16px 12px;
    }
    
    .profile-card {
        padding: 16px;
    }
    
    .top-nav .nav-center {
        gap: 8px;
    }
    
    .nav-logo {
        height: 24px;
    }
    
    .nav-title {
        font-size: 1rem;
    }
    
    .hamburger-menu {
        width: 40px;
        height: 40px;
    }
    
    .top-right-logout {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .admin-section, #config-selection, #chat-interface {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    h3 {
        font-size: 1.125rem;
    }

    /* Ultra-compact table for very small screens */
    .responsive-table-container {
        margin: 12px 0;
        border-radius: 4px;
    }

    .interview-table {
        font-size: 0.7rem;
    }

    .interview-table th,
    .interview-table td {
        padding: 8px 2px;
        font-size: 0.65rem;
    }

    .interview-table th:nth-child(1),
    .interview-table td:nth-child(1) {
        min-width: 30px;
        padding: 8px 1px;
    }

    .interview-table th:nth-child(2),
    .interview-table td:nth-child(2) {
        min-width: 50px;
        padding: 8px 2px;
    }

    .interview-table th:nth-child(3),
    .interview-table td:nth-child(3) {
        min-width: 60px;
        padding: 8px 2px;
        font-size: 0.6rem;
    }

    .interview-table th:nth-child(4),
    .interview-table td:nth-child(4) {
        min-width: 35px;
        padding: 8px 1px;
    }

    .interview-table th:nth-child(5),
    .interview-table td:nth-child(5) {
        min-width: 80px;
        padding: 8px 2px;
        font-size: 0.6rem;
    }

    .interview-table th:nth-child(6),
    .interview-table td:nth-child(6) {
        min-width: 45px;
        padding: 8px 1px;
        font-size: 0.6rem;
    }

    .interview-table th:nth-child(7),
    .interview-table td:nth-child(7) {
        min-width: 60px;
        padding: 8px 2px;
    }

    .action-buttons .delete-interview-button,
    .action-buttons .admin-evaluate-button {
        font-size: 0.6rem;
        padding: 3px 4px;
        min-width: 45px;
    }
}

/* Large desktop adjustments */
@media (min-width: 1200px) {
    .main-content {
        padding: 40px;
    }
    
    .profile-container, .admin-container {
        max-width: 1100px;
        margin: 0 auto;
    }
    
    .sidebar {
        width: 260px;
    }
    
    :root {
        --sidebar-width: 260px;
    }
}

/* Desktop behavior - no overlay needed */
@media (min-width: 769px) {
    .sidebar-overlay {
        display: none !important;
    }
}

/* ===== Admin Section Styles ===== */
.admin-section h2, .admin-section h3, .admin-section h4 {
    margin-top: 16px;
    margin-bottom: 12px;
    color: var(--color-text);
}

#config-list .config-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

#config-list .config-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#config-list .config-item:last-child {
    margin-bottom: 0;
}

#config-list button {
    padding: 8px 16px;
    margin-right: 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.edit-config-button {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.edit-config-button:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-1px);
}

.delete-config-button {
    background-color: var(--color-error);
    color: var(--color-white);
}

.delete-config-button:hover {
    background-color: #B91C1C;
    transform: translateY(-1px);
}

#config-form-container {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 20px;
    margin-top: 16px;
    box-shadow: var(--shadow-sm);
}

#config-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.875rem;
}

#config-form input[type="text"], #prompts-form textarea {
    width: 95%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#config-form input[type="text"]:focus, #prompts-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.phase-input {
    margin-bottom: 12px;
    padding: 12px;
    background: var(--color-neutral);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    position: relative;
}

.remove-phase-button {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--color-error);
    color: var(--color-white);
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.remove-phase-button:hover {
    background-color: #B91C1C;
}

hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 24px 0;
}

#evaluation-result {
    margin-top: 20px;
    line-height: 1.6;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

#user-details-modal .modal-content {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}
#user-details-modal .modal-content p { margin-bottom: 12px; color: var(--color-text); }
#user-details-modal h2, #user-details-modal h3, #user-details-modal h4, #user-details-modal h5 { color: var(--color-text); }
#user-details-modal hr { border: none; border-top: 1px solid var(--color-border); }
#modal-no-eval { color: var(--color-text); }

/* Empty state text inside detailed skill evaluations */
#detail-skill-evaluations > p,
.skill-evaluations > p {
    margin: 8px 10px 12px 10px;
    padding: 10px 12px;
    color: var(--color-text);
    background: var(--color-surface-2);
    border: 1px dashed var(--color-border);
    border-radius: 8px;
}

#modal-specific-interview-details {
    padding: 16px;
    background: var(--color-neutral);
    border-radius: 8px;
    margin-bottom: 16px;
}

#modal-specific-chat {
    max-height: 300px;
    overflow-y: auto;
    padding: 16px;
    background: var(--color-neutral);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 16px;
}

#modal-specific-chat p {
    margin-bottom: 8px;
    line-height: 1.5;
}

#modal-specific-chat p strong {
    color: var(--color-primary);
}

#modal-specific-evaluation {
    padding: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    white-space: pre-wrap;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ===== Profile Page Styles ===== */
.profile-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0;
}

.profile-container h1 {
    color: var(--color-text);
    margin-bottom: 24px;
    font-size: 1.875rem;
    font-weight: 700;
}

.profile-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.profile-card h2, 
#details-section.profile-card h2 {
    color: var(--color-text);
    margin-bottom: 16px;
    font-size: 1.5rem;
    font-weight: 600;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 8px;
}

.profile-card p {
    margin-bottom: 12px;
    color: var(--color-text);
    line-height: 1.6;
}

#interview-list .interview-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 12px;
    background: var(--color-surface);
    cursor: pointer;
    transition: all 0.2s ease;
}

#interview-list .interview-list-item:last-child {
    margin-bottom: 0;
}

#interview-list .interview-list-item:hover {
    background: var(--color-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#interview-list .interview-list-item.selected {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

#interview-list-hr .interview-list-item.selected {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

#details-section .chat-history {
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
    background: var(--color-neutral);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

#details-section .chat-history p {
    margin-bottom: 8px;
    color: var(--color-text);
}

#details-section .chat-history strong {
    color: var(--color-primary);
}

#details-section .evaluation-summary {
    padding: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    white-space: pre-wrap;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

#details-section .chart-container {
    width: 100%;
    height: 300px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

#loading-indicator, 
#user-details-modal {
    font-family: inherit;
}

.profile-nav {
    margin-bottom: 20px;
    text-align: center;
}

/* ===== Admin Container ===== */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.admin-container h1 {
    color: var(--color-text);
    margin-bottom: 24px;
    font-size: 1.875rem;
    font-weight: 700;
    text-align: center;
}

/* ===== Interview Cards Layout - REDESIGNED ===== */
.interview-cards-container {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
    margin: 16px 0;
}

.interview-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 80px;
}

.interview-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    border-color: var(--color-primary);
}

.interview-card.selected {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
    box-shadow: 0 3px 12px rgba(37, 99, 235, 0.25);
}

.interview-card.selected * {
    color: var(--color-white) !important;
}

/* Avatar section */
.interview-card-avatar {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    font-size: 1.5rem;
    font-weight: 600;
}

.interview-card.selected .interview-card-avatar {
    background: rgba(255, 255, 255, 0.2);
    color: var(--color-white);
}

/* Left section - User info and status */
.interview-card-left {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 150px;
}

.interview-card-username {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

.interview-card.selected .interview-card-username {
    color: var(--color-white);
}

.interview-card-status-section {
    display: flex;
    gap: 8px;
    align-items: center;
}

.interview-card-status {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    cursor: default;
}

.interview-card-status.status-evaluated {
    background: #dcfce7;
    color: #166534;
}

.interview-card-status.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.interview-card.selected .interview-card-status {
    background: rgba(255, 255, 255, 0.2);
    color: var(--color-white);
}

/* Evaluate button (replaces status when not evaluated) */
.interview-card-evaluate-btn {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    cursor: pointer;
    background: var(--color-primary);
    color: var(--color-white);
    transition: all 0.2s ease;
}

.interview-card-evaluate-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.interview-card-evaluate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Center section - Details */
.interview-card-details {
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px 20px;
    margin-left: 20px;
}

.interview-card-detail-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.interview-card-detail-label {
    font-size: 0.7rem;
    color: var(--color-text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.interview-card.selected .interview-card-detail-label {
    color: rgba(255, 255, 255, 0.8);
}

.interview-card-detail-value {
    font-size: 0.85rem;
    color: var(--color-text);
    font-weight: 500;
}

.interview-card.selected .interview-card-detail-value {
    color: var(--color-white);
}

.interview-card-id {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary);
    background: var(--color-neutral);
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    font-family: 'Courier New', monospace;
}

.interview-card.selected .interview-card-id {
    background: rgba(255, 255, 255, 0.2);
    color: var(--color-white);
}

/* Right section - Actions */
.interview-card-actions {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    align-items: center;
}

.interview-card-delete-btn {
    padding: 6px 12px;
    font-size: 0.75rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #ef4444;
    color: var(--color-white);
}

.interview-card-delete-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.interview-card-delete-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===== Animation and Interactive Effects ===== */
.collapsible-skill-header {
    transition: background 0.2s, box-shadow 0.2s;
}
.collapsible-skill-header:active, .collapsible-skill-header:focus {
    background: #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.collapsible-skill-content {
    transition: background 0.2s;
}
.collapsible-skill-content {
    background: #f8fafd;
}

/* Typing indicator animation */
.dots::after {
  content: '';
  animation: dots 1s steps(3, end) infinite;
}
@keyframes dots {
  0%, 20% { color: transparent; }
  40% { color: var(--color-text-light); }
  100% { color: transparent; }
}
#typing-indicator {
  opacity: 0.6;
  font-style: italic;
}

/* Prevent mobile zoom: ensure touch form controls have at least 16px font size */
input, textarea, select, button {
    font-size: 16px;
}

/* Prevent mobile text auto-resizing */
html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* Pending and failed message styling */
.pending-message {
    opacity: 0.7;
    font-style: italic;
}

.pending-indicator {
    color: #666;
    font-size: 0.9em;
}

.failed-message {
    opacity: 0.5;
    background-color: #ffe6e6;
    border-left: 3px solid #ff4444;
    padding-left: 10px;
}

/* Retry banner styling */
.retry-banner {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.retry-banner button {
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
}

.retry-banner button:first-of-type {
    background-color: #007bff;
    color: white;
}

.retry-banner button:first-of-type:hover {
    background-color: #0056b3;
}

.retry-banner button:last-of-type {
    background-color: #6c757d;
    color: white;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Action Buttons ===== */
.user-management-actions .action-button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-right: 8px;
    background-color: var(--color-primary);
    color: var(--color-white);
}

.user-management-actions .change-role-button {
    background-color: var(--color-warning);
    color: var(--color-white);
}

.user-management-actions .change-role-button:hover {
    background-color: #B45309;
    transform: translateY(-1px);
}

.user-management-actions .toggle-active-button {
    background-color: var(--color-success);
    color: var(--color-white);
}

.user-management-actions .toggle-active-button:hover {
    background-color: #047857;
    transform: translateY(-1px);
}

/* Style the evaluate button on HR Review page */
#evaluate-stored-button {
    padding: 12px 20px;
    font-size: 0.875rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--color-primary);
    color: var(--color-white);
    margin-top: 20px;
    font-family: inherit;
    font-weight: 500;
}

#evaluate-stored-button:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

#evaluate-stored-button:disabled {
    background-color: var(--color-text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Style the Evaluate Now button on profile page list */
.evaluate-now-button {
    padding: 8px 16px;
    font-size: 0.75rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--color-success);
    color: var(--color-white);
    font-family: inherit;
    font-weight: 500;
}

.evaluate-now-button:hover {
    background-color: #047857;
    transform: translateY(-1px);
}

.evaluate-now-button:disabled {
    background-color: var(--color-text-light);
    cursor: not-allowed;
    transform: none;
}

/* ===== Change Password Form Styling ===== */
#change-password-form div {
    margin-bottom: 20px;
}

#change-password-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.875rem;
}

#change-password-form input[type="password"] {
    width: 95%;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#change-password-form input[type="password"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Style the update button */
#update-password-button {
    padding: 12px 24px; 
    font-size: 0.875rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--color-primary);
    color: var(--color-white);
    margin-top: 16px;
    font-family: inherit;
    font-weight: 500;
}

#update-password-button:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

#update-password-button:disabled {
    background-color: var(--color-text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ===== Skill Evaluations - OPTIMIZED ===== */
.skill-evaluations {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    padding: 10px 12px;
}

.skill-evaluation {
    border-bottom: 1px solid var(--color-border);
    padding: 0;
    margin: 0;
}

.skill-evaluation:last-child {
    border-bottom: none;
    border-radius: 0 0 6px 6px; /* Reduced from 8px */
    overflow: hidden;
}

.skill-evaluation h4 {
    margin: 0 0 6px 0; /* Reduced from 8px */
    color: var(--color-text);
    font-size: 0.9rem; /* More compact */
}

.skill-evaluation p {
    margin: 0;
    color: var(--color-text);
    line-height: 1.4; /* Reduced from 1.5 for compactness */
    font-size: 0.85rem; /* Smaller text */
}

.collapsible-skill-header {
    background: var(--color-surface-2);
    border: none;
    width: 100%;
    padding: 12px 16px;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--color-text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    transition: background 0.2s;
    font-weight: 600;
}

.collapsible-skill-header:hover {
    background: var(--color-hover);
}

.collapsible-skill-header .arrow {
    transition: transform 0.2s;
    font-size: 1em; /* Reduced from 1.2em */
    color: var(--color-primary);
    margin-left: 8px;
}

.collapsible-skill-content {
    display: none;
    padding: 14px 16px;
    background: var(--color-surface);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
}

.collapsible-skill-content p {
    margin: 0;
    text-align: justify;
}

/* ===== Mobile-specific optimizations ===== */
@media (max-width: 600px) {
    .profile-container, .profile-card, #details-section.profile-card {
        margin: 0;
        padding: 12px; /* Reduced from 16px */
        border-radius: 6px; /* Reduced from 8px */
    }
    
    .skill-evaluations {
        margin-bottom: 10px; /* Reduced from 14px */
    }
    
    .collapsible-skill-header {
        padding: 10px 12px; /* Reduced from 14px 16px */
        font-size: 0.85rem; /* Reduced from 0.95em */
    }
    
    .collapsible-skill-header .arrow {
        margin-left: 6px; /* Reduced from 14px */
        font-size: 0.9em;
    }
    
    .collapsible-skill-content {
        padding: 10px 12px; /* Reduced from 16px 10px 16px 24px */
        font-size: 0.8rem; /* Reduced from 1.05em */
        margin-bottom: 0; /* Removed extra margin */
        line-height: 1.4; /* More compact line height */
    }
    
    .skill-evaluation h4, .collapsible-skill-header strong {
        font-size: 0.85rem; /* Reduced from 1.13em */
    }
    
    .evaluation-summary {
        font-size: 0.9rem; /* Reduced from 1.05em */
        margin-bottom: 12px; /* Reduced from 18px */
        line-height: 1.4;
    }
    
    .chart-container {
        width: 100vw;
        max-width: 100vw;
        min-width: 0;
        overflow-x: auto;
        height: 160px !important; /* Reduced from 180px */
        margin-left: -2vw; /* Reduced margins */
        margin-right: -2vw;
        margin-bottom: 12px; /* Added bottom margin */
    }
    
    #details-section h2, #details-section h3 {
        font-size: 1.1em; /* Reduced from 1.18em */
        margin-top: 14px; /* Reduced from 18px */
        margin-bottom: 8px; /* Reduced from 10px */
    }
    
    #details-section p {
        font-size: 0.9rem; /* Reduced from 1em */
        line-height: 1.4;
    }
    
    /* Compact interview cards on mobile */
    .interview-cards-container {
        gap: 8px; /* Even more compact on mobile */
        margin: 12px 0;
    }
    
    .interview-card {
        padding: 10px; /* More compact padding */
        border-radius: 4px;
    }
    
    .interview-card-header {
        margin-bottom: 8px;
        gap: 6px;
    }
    
    .interview-card-id {
        font-size: 0.9rem;
        padding: 3px 6px;
        min-width: 35px;
    }
    
    .interview-card-status {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
    
    .interview-card-body {
        gap: 6px 8px;
        margin-bottom: 8px;
    }
    
    .interview-card-label {
        font-size: 0.65rem;
    }
    
    .interview-card-value {
        font-size: 0.8rem;
    }
    
    .interview-card-actions {
        gap: 4px;
        margin-top: 6px;
    }
    
    .interview-card-actions .admin-evaluate-button,
    .interview-card-actions .delete-interview-button {
        padding: 5px 8px;
        font-size: 0.7rem;
    }
}

/* ===== Desktop-specific optimizations for skill evaluations ===== */
@media (min-width: 769px) {
    .skill-evaluations {
        border-radius: 8px;
        margin-bottom: 16px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .skill-evaluation:last-child {
        border-radius: 0 0 8px 8px;
    }
    
    .collapsible-skill-header {
        padding: 16px 20px;
        font-size: 1rem;
        font-weight: 600;
    }
    
    .collapsible-skill-header .arrow {
        font-size: 1.1em;
        margin-left: 12px;
    }
    
    .collapsible-skill-content {
        padding: 16px 20px;
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    .skill-evaluation h4 {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .evaluation-summary {
        font-size: 1rem;
        margin-bottom: 16px;
        line-height: 1.6;
    }
    
    #details-section h2, #details-section h3 {
        font-size: 1.25rem;
        margin-top: 20px;
        margin-bottom: 12px;
    }
    
    #details-section p {
        font-size: 1rem;
        line-height: 1.6;
    }
}

/* ===== User Cards Layout (Admin User Management) ===== */
.user-cards-container {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
    margin: 20px 0;
}

.user-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.user-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border-color: var(--color-primary);
}

.user-card.selected {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.user-card.selected * {
    color: var(--color-white) !important;
}

.user-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.user-card-avatar {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    font-size: 1.5rem;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.user-card.selected .user-card-avatar.no-image {
    background: rgba(255, 255, 255, 0.2);
    color: var(--color-white);
}

.user-card-info {
    flex-grow: 1;
    margin-left: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.user-card-id {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    background: var(--color-neutral);
    padding: 8px 12px;
    border-radius: 6px;
    min-width: 60px;
    text-align: center;
}

.user-card.selected .user-card-id {
    background: rgba(255, 255, 255, 0.2);
    color: var(--color-white);
}

.user-card-username {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    cursor: pointer;
    transition: color 0.2s ease;
    text-decoration: none;
    margin: 0;
}

.user-card-username:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.user-card.selected .user-card-username {
    color: var(--color-white);
}

.user-card.selected .user-card-username:hover {
    color: rgba(255, 255, 255, 0.9);
}

.user-card-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.user-card-role,
.user-card-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-card-role.role-admin {
    background: rgba(37, 99, 235, 0.1);
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.user-card-role.role-candidate {
    background: rgba(100, 116, 139, 0.1);
    color: var(--color-text-light);
    border: 1px solid var(--color-text-light);
}

.user-card-status.status-active {
    background: rgba(5, 150, 105, 0.1);
    color: var(--color-success);
    border: 1px solid var(--color-success);
}

.user-card-status.status-inactive {
    background: rgba(220, 38, 38, 0.1);
    color: var(--color-error);
    border: 1px solid var(--color-error);
}

.user-card.selected .user-card-role,
.user-card.selected .user-card-status {
    background: rgba(255, 255, 255, 0.2);
    color: var(--color-white);
    border-color: var(--color-white);
}

.user-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 24px;
    margin-bottom: 20px;
}

.user-card-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-card-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-card.selected .user-card-label {
    color: rgba(255, 255, 255, 0.8);
}

.user-card-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
    word-wrap: break-word;
}

.user-card.selected .user-card-value {
    color: var(--color-white);
}

.user-card-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.user-card-actions .change-role-button,
.user-card-actions .toggle-active-button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
    min-width: 100px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-card-actions .change-role-button {
    background: var(--color-warning);
    color: var(--color-white);
}

.user-card-actions .change-role-button:hover {
    background: #B45309;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(180, 83, 9, 0.3);
}

.user-card-actions .toggle-active-button {
    background: var(--color-success);
    color: var(--color-white);
}

.user-card-actions .toggle-active-button.deactivate {
    background: var(--color-error);
}

.user-card-actions .toggle-active-button:hover {
    background: #047857;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(4, 120, 87, 0.3);
}

.user-card-actions .toggle-active-button.deactivate:hover {
    background: #B91C1C;
    box-shadow: 0 4px 12px rgba(185, 28, 28, 0.3);
}

.user-card-actions .change-role-button:disabled,
.user-card-actions .toggle-active-button:disabled {
    background: var(--color-text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

/* ===== Desktop Grid Layout for User Cards ===== */
@media (min-width: 769px) {
    .user-cards-container {
        grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
        gap: 20px;
    }
    
    .user-card {
        padding: 24px;
    }
    
    .user-card-body {
        grid-template-columns: 1fr 1fr;
        gap: 20px 32px;
    }
}

/* ===== Mobile adjustments for user cards ===== */
@media (max-width: 768px) {
    .user-cards-container {
        gap: 12px;
    }
    
    .user-card {
        padding: 16px;
    }
    
    .user-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .user-card-username {
        margin-left: 0;
        font-size: 1.25rem;
    }
    
    .user-card-body {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .user-card-actions {
        justify-content: center;
        margin-top: 8px;
    }
    
    .user-card-actions .change-role-button,
    .user-card-actions .toggle-active-button {
        min-width: 90px;
        font-size: 0.7rem;
        padding: 6px 12px;
    }
}

/* ===== Responsive Layout for Interview Cards ===== */
/* Desktop optimization */
@media (min-width: 769px) {
    .interview-cards-container {
        gap: 16px;
    }
    
    .interview-card {
        padding: 24px;
        border-radius: 8px;
        min-height: 90px;
    }
    
    .interview-card-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }
    
    .interview-card-left {
        min-width: 180px;
    }
    
    .interview-card-username {
        font-size: 1.2rem;
    }
    
    .interview-card-details {
        margin-left: 30px;
        gap: 16px 24px;
    }
    
    .interview-card-detail-label {
        font-size: 0.75rem;
    }
    
    .interview-card-detail-value {
        font-size: 0.9rem;
    }
    
    .interview-card-id {
        font-size: 1.1rem;
        padding: 3px 10px;
    }
    
    .interview-card-status,
    .interview-card-evaluate-btn {
        font-size: 0.8rem;
        padding: 6px 14px;
    }
    
    .interview-card-delete-btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
}

/* Mobile optimization */
@media (max-width: 768px) {
    .interview-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 16px;
        min-height: auto;
    }
    
    .interview-card-avatar {
        align-self: center;
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    .interview-card-left {
        width: 100%;
        min-width: 0;
        text-align: center;
    }
    
    .interview-card-username {
        font-size: 1.1rem;
    }
    
    .interview-card-details {
        width: 100%;
        margin-left: 0;
        grid-template-columns: 1fr 1fr;
        gap: 12px 16px;
    }
    
    .interview-card-actions {
        width: 100%;
        justify-content: center;
    }
    
    .interview-card-status-section {
        justify-content: center;
    }
}

/* Very small mobile */
@media (max-width: 480px) {
    .interview-card {
        padding: 12px;
        gap: 12px;
    }
    
    .interview-card-details {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .interview-card-detail-item {
        text-align: center;
    }
    
    .interview-card-detail-label {
        font-size: 0.65rem;
    }
    
    .interview-card-detail-value {
        font-size: 0.8rem;
    }
    
    .interview-card-status,
    .interview-card-evaluate-btn,
    .interview-card-delete-btn {
        font-size: 0.7rem;
        padding: 4px 10px;
    }
}

/* ===== Profile Picture Upload Styles ===== */
.profile-picture-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
    text-align: center;
}

.profile-avatar-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-text);
    color: var(--color-white);
    font-size: 2.5rem;
    font-weight: 600;
    border: 4px solid var(--color-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    position: relative;
    transition: all 0.2s ease;
}

.profile-avatar:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-actions {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.profile-avatar-container:hover .avatar-actions {
    opacity: 1;
    pointer-events: all;
}

.avatar-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--color-white);
    background: var(--color-primary);
    color: var(--color-white);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.avatar-action-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.upload-btn {
    background: var(--color-primary);
}

.upload-btn:hover {
    background: var(--color-primary-dark);
}

.remove-btn {
    background: var(--color-error);
}

.remove-btn:hover {
    background: #dc2626;
}

#profile-picture-form {
    display: inline-block;
}

#profile-picture-form input[type="file"] {
    display: none;
}

.upload-feedback {
    max-width: 300px;
    width: 100%;
}

.upload-status {
    font-size: 0.875rem;
    color: var(--color-text-light);
    text-align: center;
    min-height: 20px;
    margin-bottom: 8px;
}

.upload-status.uploading {
    color: var(--color-primary);
    font-weight: 500;
}

.upload-status.success {
    color: var(--color-success);
    font-weight: 500;
}

.upload-status.error {
    color: var(--color-error);
    font-weight: 500;
}

.upload-help {
    font-size: 0.8rem;
    color: var(--color-text-light);
    margin: 8px 0;
    font-style: italic;
    text-align: center;
}

/* Mobile adjustments for profile picture section */
@media (max-width: 768px) {
    .profile-avatar {
        width: 100px;
        height: 100px;
        font-size: 2rem;
    }
    
    .avatar-action-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .upload-feedback {
        max-width: 100%;
        padding: 0 16px;
    }
}

/* Small avatar styles for cards */
.user-card-avatar, .interview-card-avatar {
    position: relative;
    overflow: hidden;
}

.user-card-avatar img, .interview-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Fallback avatar styles when no image is available */
.user-card-avatar.no-image, .interview-card-avatar.no-image {
    background: var(--color-text);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.user-card.selected .user-card-avatar.no-image,
.interview-card.selected .interview-card-avatar.no-image {
    background: rgba(255, 255, 255, 0.2);
    color: var(--color-white);
}

/* Desktop user card avatars */
@media (min-width: 769px) {
    .user-card-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }
}

/* Mobile user card avatars */
@media (max-width: 768px) {
    .user-card-avatar {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
}

/* ===== Pagination Styles ===== */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin: 0 8px;
}

.pagination-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 10px 14px;
    background-color: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 44px;
    text-align: center;
}

.pagination-btn:hover:not(:disabled) {
    background-color: var(--color-hover);
    border-color: var(--color-primary);
    transform: translateY(-1px);
}

.pagination-btn.active {
    background-color: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.pagination-btn:disabled {
    background-color: var(--color-neutral);
    color: var(--color-text-light);
    cursor: not-allowed;
    transform: none;
}

.page-size-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--color-text);
}

.page-size-selector select {
    padding: 6px 8px;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.875rem;
    background-color: var(--color-surface);
}

/* Mobile pagination adjustments */
@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        gap: 16px;
        width: 100%;
    }
    
    .pagination-controls {
        justify-content: center;
        width: 100%;
        row-gap: 10px;
    }
    
    .pagination-btn {
        padding: 12px 16px;
        min-width: 46px;
        flex: 0 1 auto;
    }
}

/* Chart containers - improved responsiveness */
.chart-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 300px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    box-sizing: border-box;
}

.chart-container canvas {
    max-width: 100%;
    max-height: 100%;
    width: 100% !important;
    height: auto !important;
}

/* Modal chart containers */
#modal-chart-container, 
#modal-specific-chart-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 250px;
    margin: 16px 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 12px;
    box-sizing: border-box;
    overflow: hidden;
}

/* Mobile chart adjustments */
@media (max-width: 768px) {
    .chart-container {
        height: 200px;
        padding: 12px;
        margin: 12px 0;
    }
    
    #modal-chart-container,
    #modal-specific-chart-container {
        height: 180px;
        padding: 8px;
    }
    
    #details-section .chart-container {
        height: 200px;
        padding: 12px;
        /* Remove the problematic full-width mobile styles */
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
}

/* Very small mobile adjustments */
@media (max-width: 480px) {
    .chart-container {
        height: 180px;
        padding: 8px;
    }
    
    #modal-chart-container,
    #modal-specific-chart-container {
        height: 160px;
        padding: 6px;
    }
}

#download-report-button {
    padding: 14px 24px;
    background-color: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#download-report-button:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

#download-report-button:disabled {
    background-color: var(--color-text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Add icon before text if desired */
#download-report-button::before {
    content: "📊";
    font-size: 16px;
}

/* ===== Authentication Pages Styling ===== */
.auth-page {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.auth-card {
    background: var(--color-surface);
    border-radius: 12px;
    padding: 40px 32px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    border: 1px solid var(--color-border);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header .auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

.auth-header .auth-logo .nav-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.auth-header .auth-logo .nav-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-primary);
}

.auth-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 8px 0;
}

.auth-header p {
    font-size: 0.975rem;
    color: var(--color-text-light);
    margin: 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text);
}

.form-group input {
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 16px; /* Prevent mobile zoom */
    font-family: inherit;
    transition: all 0.2s ease;
    background: var(--color-white);
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.auth-button {
    padding: 14px 16px;
    background-color: var(--color-primary);
    color: var(--color-white);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.auth-button:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

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

.error-message {
    color: var(--color-error);
    font-size: 0.875rem;
    text-align: center;
    margin: 8px 0 0 0;
    min-height: 20px;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}

.auth-footer p {
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin: 0;
}

.auth-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.auth-link:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* Mobile auth adjustments */
@media (max-width: 480px) {
    .auth-card {
        padding: 32px 24px;
        margin: 16px;
    }
    
    .auth-header h1 {
        font-size: 1.625rem;
    }
}

/* ===== Role Matching Styles ===== */
.role-matching-section {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

/* Circular progress bar */
.circular-progress-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

.circular-progress {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(var(--color-primary) 0deg, var(--color-border) 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.5s ease;
}

.circular-progress::before {
    content: '';
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--color-white);
}

.progress-value {
    position: relative;
    z-index: 1;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}

.role-selector-container {
    margin-bottom: 20px;
}

.role-selector-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--color-text);
    font-size: 0.875rem;
}

.role-dropdown {
    width: 100%;
    max-width: 300px;
    padding: 12px 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    background-color: var(--color-white);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.role-dropdown:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.role-match-card {
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.role-match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

.role-match-header h4 {
    color: var(--color-text);
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.match-score-container {
    text-align: center;
}

.match-score {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.match-score-label {
    font-size: 0.75rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.role-match-details {
    margin-top: 16px;
}

.skill-comparison-grid {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: hidden;
}

.skill-comparison-header {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    padding: 12px 16px;
    background: var(--color-primary);
    color: var(--color-white);
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.skill-comparison-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
    align-items: center;
}

.skill-comparison-row:last-child {
    border-bottom: none;
}

.skill-comparison-row:nth-child(even) {
    background: var(--color-neutral);
}

.skill-name {
    font-weight: 600;
    color: var(--color-text);
}

.score-value {
    text-align: center;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--color-text);
}

.candidate-score {
    background: rgba(37, 99, 235, 0.1);
    color: var(--color-primary);
}

.ideal-score {
    background: rgba(100, 116, 139, 0.1);
    color: var(--color-text-light);
}

.score-difference {
    text-align: center;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
}

.score-difference.positive {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.score-difference.negative {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
}

.score-difference.neutral {
    background: rgba(100, 116, 139, 0.1);
    color: var(--color-text-light);
}

/* Match score color coding */
.match-score.excellent {
    color: var(--color-success);
}

.match-score.good {
    color: var(--color-primary);
}

.match-score.fair {
    color: var(--color-warning);
}

.match-score.poor {
    color: var(--color-error);
}

/* Mobile adjustments for role matching */
@media (max-width: 768px) {
    .role-matching-section {
        padding: 16px;
    }
    
    .role-match-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .role-match-header h4 {
        font-size: 1.1rem;
    }
    
    .match-score {
        font-size: 1.75rem;
    }
    
    .skill-comparison-header,
    .skill-comparison-row {
        grid-template-columns: 2fr 1fr;
        gap: 8px;
        padding: 10px 12px;
        font-size: 0.8rem;
    }
    
    .skill-comparison-header {
        font-size: 0.75rem;
    }
    
    .skill-name {
        font-size: 0.8rem;
    }
    
    .score-value,
    .score-difference {
        padding: 2px 4px;
        font-size: 0.75rem;
    }
}

/* Very small mobile adjustments */
@media (max-width: 480px) {
    .skill-comparison-header,
    .skill-comparison-row {
        grid-template-columns: 1.5fr 1fr;
        gap: 6px;
        padding: 8px 10px;
        font-size: 0.75rem;
    }
    
    .skill-comparison-header {
        font-size: 0.7rem;
    }
    
    .skill-name {
        font-size: 0.75rem;
        line-height: 1.2;
    }
    
    .score-value,
    .score-difference {
        padding: 1px 3px;
        font-size: 0.7rem;
    }
    
    .match-score {
        font-size: 1.5rem;
    }
}