* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --border-color: #30363d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --text-muted: #484f58;
    --accent-green: #3fb950;
    --accent-blue: #58a6ff;
    --accent-purple: #a371f7;
    --accent-orange: #fb8500;
    --accent-red: #f85149;
    --linkedin-blue: #0a66c2;
    --linkedin-blue-light: #0077b5;
}

/* Light Theme Variables - Modern & Vibrant */
body[data-theme="light"] {
    --bg-primary: #f5f7fa;
    --bg-secondary: #e8ecf4;
    --bg-tertiary: #dde4ed;
    --border-color: #c1ccd7;
    --text-primary: #1a202c;
    --text-secondary: #2d3748;
    --text-muted: #4a5568;
    --accent-green: #48bb78;
    --accent-blue: #4299e1;
    --accent-purple: #9f7aea;
    --accent-orange: #ed8936;
    --accent-red: #f56565;
    --linkedin-blue: #0a66c2;
    --linkedin-blue-light: #0077b5;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ========== TERMINAL HEADER (Login Page) ========== */
.terminal-header {
    background: var(--bg-secondary);
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 15px;
}

.terminal-controls {
    display: flex;
    gap: 8px;
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: opacity 0.2s;
}

.terminal-dot:hover {
    opacity: 0.8;
}

.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }

.terminal-path {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--text-secondary);
}

.terminal-path span {
    color: var(--accent-blue);
}

/* ========== MAIN CONTENT ========== */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 12px;
}

/* Login page specific main-container */
.main-container.login-page {
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
}

/* ========== CODE DECORATION (Login Page) ========== */
.code-decoration {
    position: absolute;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.3;
    user-select: none;
}

.code-decoration.top-left {
    top: 40px;
    left: 40px;
}

.code-decoration.top-right {
    top: 40px;
    right: 40px;
    text-align: right;
}

.code-decoration.bottom-left {
    bottom: 40px;
    left: 40px;
}

.code-decoration.bottom-right {
    bottom: 40px;
    right: 40px;
    text-align: right;
}

/* ========== LOGIN CARD ========== */
.login-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 10;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-green), var(--accent-blue), var(--accent-purple));
    border-radius: 12px 12px 0 0;
}

.login-header {
    text-align: center;
    margin-bottom: 35px;
}

.app-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.app-title .syntax {
    color: var(--accent-purple);
}

.app-title .dot {
    color: var(--accent-orange);
}

.app-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.app-subtitle .comment {
    color: var(--text-muted);
}

/* ========== FORM STYLES ========== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    position: relative;
}

.form-label {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-label .keyword {
    color: var(--accent-blue);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    z-index: 2;
}

.form-input {
    width: 100%;
    padding: 12px 40px 12px 28px; /* Increased right padding for icon */
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    background: var(--bg-primary);
    box-shadow: 0 0 0 1px var(--accent-blue);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Password toggle icon */
.password-toggle-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.password-toggle-icon:hover {
    color: var(--text-primary);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--accent-green);
}

.checkbox-wrapper label {
    font-size: 13px;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
}

.forgot-link {
    font-size: 13px;
    color: var(--accent-blue);
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    transition: color 0.2s;
}

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

.submit-btn {
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    background: var(--bg-primary);
    border-color: var(--accent-green);
    color: var(--accent-green);
    box-shadow: 0 0 10px rgba(63, 185, 80, 0.2);
}

.submit-btn:active {
    transform: scale(0.98);
}

/* ========== STATUS LINE (Login Page) ========== */
.status-line {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    border-radius: 6px;
}

.status-line.show {
    display: flex;
}

.status-line.success {
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.status-line.error {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.cursor {
    display: inline-block;
    width: 8px;
    height: 16px;
    background: var(--accent-green);
    animation: blink 1s infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ========== HEADER ========== */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1001;
}

.logo .syntax {
    color: var(--accent-purple);
}

.logo .dot {
    color: var(--accent-orange);
}

.logo .linkedin {
    color: var(--linkedin-blue);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.nav-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-btn.active {
    background: var(--bg-tertiary);
    color: var(--accent-blue);
}

.logout-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logout-btn:hover {
    background: var(--bg-primary);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* User Dropdown Styles */
.user-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.user-dropdown-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-dropdown-toggle:hover {
    background: var(--bg-primary);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    margin-top: 8px;
}

/* Responsive positioning for small screens */
@media (max-width: 480px) {
    .user-dropdown-menu {
        right: -10px;
        left: auto;
        min-width: 180px;
    }
}

@media (max-width: 360px) {
    .user-dropdown-menu {
        right: -20px;
        min-width: 160px;
    }
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.user-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0;
}

.user-dropdown-item {
    width: 100%;
    background: none;
    border: none;
    color: var(--text-primary);
    padding: 12px 16px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

.user-dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--accent-red);
}

.user-dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ========== MOBILE MENU TOGGLE ========== */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    transition: color 0.2s;
}

.mobile-menu-toggle:hover {
    color: var(--accent-blue);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

/* ========== MODERN MODAL DIALOGS ========== */
.duplicate-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeIn 0.3s ease-out;
}

.duplicate-dialog {
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 90vw;
    max-height: 90vh;
    width: 800px;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease-out;
    border: 1px solid var(--border-color);
}

.duplicate-dialog-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
    border-radius: 12px 12px 0 0;
}

.duplicate-dialog-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
}

.duplicate-dialog-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.duplicate-dialog-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.duplicate-dialog-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(90vh - 120px);
}

.duplicate-summary {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border-left: 4px solid var(--accent-blue);
}

.duplicate-collection {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.duplicate-collection h4 {
    margin: 0 0 12px 0;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.duplicate-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    margin-top: 20px;
    border-left: 4px solid var(--accent-yellow);
}

.duplicate-note i {
    color: var(--accent-yellow);
    margin-top: 2px;
}

.duplicate-note div {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.loading-message {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.loading-message i {
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--accent-blue);
}

/* Modern Confirmation Dialog */
.confirm-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeIn 0.3s ease-out;
}

.confirm-dialog {
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    animation: slideIn 0.3s ease-out;
    border: 1px solid var(--border-color);
}

.confirm-dialog-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 12px 12px 0 0;
}

.confirm-dialog-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.confirm-dialog-content {
    padding: 24px;
}

.confirm-dialog-message {
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 15px;
}

.confirm-dialog-details {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
    border-left: 4px solid var(--accent-blue);
}

.confirm-dialog-details ul {
    margin: 8px 0;
    padding-left: 20px;
    color: var(--text-secondary);
}

.confirm-dialog-details li {
    margin: 4px 0;
    font-size: 14px;
}

.confirm-dialog-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 15px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: border-color 0.2s ease;
    margin: 12px 0;
    box-sizing: border-box;
}

.confirm-dialog-input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.confirm-dialog-input.error {
    border-color: var(--accent-red);
    background: rgba(220, 53, 69, 0.1);
}

.confirm-dialog-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.confirm-dialog-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.confirm-dialog-btn.primary {
    background: var(--accent-blue);
    color: white;
}

.confirm-dialog-btn.primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.confirm-dialog-btn.danger {
    background: var(--accent-red);
    color: white;
}

.confirm-dialog-btn.danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

.confirm-dialog-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.confirm-dialog-btn.secondary:hover {
    background: var(--bg-secondary);
    transform: translateY(-1px);
}

.confirm-dialog-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Modal Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========== HEADER NAVIGATION & HEALTH BADGES ========== */
.header-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 8px;
}

/* System Health Badges in Navbar */
.system-health-badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

.health-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    transition: all 0.2s;
    cursor: help;
}

.health-badge i {
    font-size: 12px;
}

.health-badge span {
    font-weight: 600;
}

.health-badge.online {
    color: var(--accent-green);
    border-color: var(--accent-green);
    background: rgba(63, 185, 80, 0.1);
}

.health-badge.offline {
    color: var(--accent-red);
    border-color: var(--accent-red);
    background: rgba(248, 81, 73, 0.1);
}

.health-badge.warning {
    color: var(--accent-orange);
    border-color: var(--accent-orange);
    background: rgba(251, 133, 0, 0.1);
}

.health-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* System Status Toggle Button (Mobile Only) */
.system-status-toggle {
    display: none !important; /* Hidden on desktop */
}

/* System Health Badges List (Always visible on desktop) */
.system-health-badges-list {
    display: flex !important; /* Always visible on desktop */
    flex-direction: row;
    gap: 8px;
    max-height: none !important; /* Override mobile max-height */
    overflow: visible !important; /* Override mobile overflow */
}

/* ========== LINKEDIN BRANDING ========== */
.linkedin-header {
    background: linear-gradient(135deg, var(--linkedin-blue) 0%, var(--linkedin-blue-light) 100%);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    color: white;
    margin-bottom: 20px;
}

.linkedin-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.linkedin-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
}

.linkedin-subtitle {
    font-size: 14px;
    opacity: 0.9;
}

/* ========== STATUS BAR ========== */
.status-bar {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-dot.active {
    background: var(--accent-green);
    animation: pulse 2s infinite;
}

.status-dot.paused {
    background: var(--accent-orange);
}

.status-dot.stopped {
    background: var(--accent-red);
}

.status-dot.completed {
    background: var(--accent-green);
}

.status-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: var(--text-secondary);
}

.status-timer {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: var(--text-secondary);
}

/* ========== GRID LAYOUT ========== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.full-width {
    grid-column: span 2;
}

/* ========== PANEL STYLES ========== */
.panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevents panel from expanding due to wide content like tables */
}

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

.panel-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title i {
    color: var(--accent-blue);
}

/* ========== FILE UPLOAD SECTION ========== */
.file-upload-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.file-upload {
    border: 2px dashed var(--border-color);
    border-radius: 6px;
    padding: 30px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.file-upload:hover {
    border-color: var(--accent-blue);
    background: rgba(88, 166, 255, 0.05);
}

.file-upload.linkedin:hover {
    border-color: var(--linkedin-blue);
    background: rgba(10, 102, 194, 0.05);
}

.file-upload input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.file-upload-icon {
    font-size: 32px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.file-upload-icon.linkedin {
    color: var(--linkedin-blue);
}

.file-upload-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.file-upload-text .highlight {
    color: var(--accent-blue);
}

.file-upload-hint {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-muted);
}

.file-info {
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-icon {
    color: var(--accent-blue);
}

.file-icon.linkedin {
    color: var(--linkedin-blue);
}

.file-name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--text-primary);
}

.file-size {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
}

.remove-file {
    background: none;
    border: none;
    color: var(--accent-red);
    cursor: pointer;
    font-size: 14px;
    transition: opacity 0.2s;
}

.remove-file:hover {
    opacity: 0.8;
}

/* ========== CONFIGURATION OPTIONS ========== */
.config-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.config-option {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.config-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-label .info-icon {
    color: var(--text-muted);
    cursor: help;
    font-size: 12px;
}

.config-label .info-icon:hover {
    color: var(--accent-blue);
}

.config-input {
    width: 100%;
    padding: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    transition: all 0.2s;
}

.config-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

.config-input.linkedin:focus {
    border-color: var(--linkedin-blue);
    box-shadow: 0 0 0 3px rgba(10, 102, 194, 0.1);
}

.config-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.config-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--bg-primary);
    outline: none;
    -webkit-appearance: none;
    margin: 10px 0;
}

.config-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-blue);
    cursor: pointer;
    transition: all 0.2s;
}

.config-slider.linkedin::-webkit-slider-thumb {
    background: var(--linkedin-blue);
}

.config-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.config-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-blue);
    cursor: pointer;
    transition: all 0.2s;
}

.config-slider.linkedin::-moz-range-thumb {
    background: var(--linkedin-blue);
}

.config-slider::-moz-range-thumb:hover {
    transform: scale(1.1);
}

.slider-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
}

.slider-value-text {
    background: var(--bg-tertiary);
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--accent-blue);
    font-weight: 600;
}

.slider-value-text.linkedin {
    color: var(--linkedin-blue);
}

/* ========== CONTROL BUTTONS ========== */
.control-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.control-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.control-btn:hover {
    background: var(--bg-primary);
}

.control-btn.start {
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.control-btn.start:hover {
    background: rgba(63, 185, 80, 0.1);
}

.control-btn.pause {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
}

.control-btn.pause:hover {
    background: rgba(251, 133, 0, 0.1);
}

.control-btn.resume {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.control-btn.resume:hover {
    background: rgba(88, 166, 255, 0.1);
}

.control-btn.stop {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.control-btn.stop:hover {
    background: rgba(248, 81, 73, 0.1);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== STATS SECTION ========== */
.stats-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-card {
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
}

.stat-progress {
    height: 4px;
    background: var(--bg-primary);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 5px;
}

.stat-progress-bar {
    height: 100%;
    background: var(--accent-green);
    width: 0%;
    transition: width 0.3s;
}

.stat-progress-bar.linkedin {
    background: var(--linkedin-blue);
}

.stat-eta {
    margin-top: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-eta span {
    color: var(--accent-blue);
}

/* ========== SUCCESS RATE BADGE ========== */
.success-rate-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 20px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 6px;
    display: inline-block;
}

.success-rate-badge.high {
    background: rgba(63, 185, 80, 0.2);
    color: var(--accent-green);
}

.success-rate-badge.medium {
    background: rgba(251, 133, 0, 0.2);
    color: var(--accent-orange);
}

.success-rate-badge.low {
    background: rgba(248, 81, 73, 0.2);
    color: var(--accent-red);
}

/* ========== AUTO-REFRESH TOGGLE ========== */
.auto-refresh-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.auto-refresh-toggle input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-blue);
    cursor: pointer;
}

.auto-refresh-toggle:hover {
    color: var(--text-primary);
}

/* ========== NOTIFICATION VARIANTS ========== */
.notification.warning {
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-orange);
    color: var(--accent-orange);
}

.notification.info {
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
}

/* ========== SYSTEM STATUS BADGES ========== */
.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 15px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-muted);
    transition: all 0.2s;
    cursor: help;
}

.status-badge i {
    font-size: 10px;
}

.status-badge.online {
    border-color: var(--accent-green);
    color: var(--accent-green);
    background: rgba(63, 185, 80, 0.1);
}

.status-badge.offline {
    border-color: var(--accent-red);
    color: var(--accent-red);
    background: rgba(248, 81, 73, 0.1);
}

.status-badge.warning {
    border-color: var(--accent-orange);
    color: var(--accent-orange);
    background: rgba(251, 133, 0, 0.1);
}

.status-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ========== RESULTS TABLE ========== */
.results-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.table-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto; /* Added for horizontal scrolling */
    margin-top: 15px;
    max-height: 400px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th {
    text-align: left;
    padding: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
}

.results-table td {
    padding: 12px 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--bg-tertiary);
}

.results-table tr:hover td {
    background: var(--bg-tertiary);
}

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.completed {
    background: rgba(63, 185, 80, 0.2);
    color: var(--accent-green);
}

.status-badge.processing {
    background: rgba(88, 166, 255, 0.2);
    color: var(--accent-blue);
}

.status-badge.failed {
    background: rgba(248, 81, 73, 0.2);
    color: var(--accent-red);
}

.status-badge.success {
    background: rgba(63, 185, 80, 0.2);
    color: var(--accent-green);
}

.status-badge.cached {
    background: rgba(88, 166, 255, 0.2);
    color: var(--accent-blue);
}

.status-badge.error {
    background: rgba(248, 81, 73, 0.2);
    color: var(--accent-red);
}

.status-badge.running {
    background: rgba(10, 102, 194, 0.2);
    color: var(--linkedin-blue);
}

.status-badge.paused {
    background: rgba(251, 133, 0, 0.2);
    color: var(--accent-orange);
}

.status-badge.stopped {
    background: rgba(248, 81, 73, 0.2);
    color: var(--accent-red);
}

.status-badge.pending {
    background: rgba(139, 148, 158, 0.2);
    color: var(--text-secondary);
}

/* ========== DOWNLOAD OPTIONS ========== */
.download-options {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.download-btn {
    flex: 1;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.download-btn:hover {
    background: var(--bg-primary);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.download-btn.linkedin:hover {
    border-color: var(--linkedin-blue);
    color: var(--linkedin-blue);
}

/* ========== TAB NAVIGATION ========== */
.tab-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 10px 20px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

.tab-btn.active.linkedin {
    color: var(--linkedin-blue);
    border-bottom-color: var(--linkedin-blue);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ========== LIVE ACTIVITY LOG ========== */
.activity-log {
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 15px;
    height: 200px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
}

.log-entry {
    margin-bottom: 5px;
    display: flex;
    gap: 10px;
}

.log-timestamp {
    color: var(--text-muted);
    flex-shrink: 0;
}

.log-message {
    flex: 1;
}

.log-message.info {
    color: var(--accent-blue);
}

.log-message.success {
    color: var(--accent-green);
}

.log-message.warning {
    color: var(--accent-orange);
}

.log-message.error {
    color: var(--accent-red);
}

/* ========== SESSION MANAGEMENT ========== */
.sessions-container {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
}

.session-card {
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.session-card:hover {
    background: var(--bg-primary);
}

.session-info {
    flex: 1;
}

.session-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.session-details {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
}

.session-status {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.session-status.running {
    background: rgba(10, 102, 194, 0.2);
    color: var(--linkedin-blue);
}

.session-status.completed {
    background: rgba(63, 185, 80, 0.2);
    color: var(--accent-green);
}

.session-status.failed {
    background: rgba(248, 81, 73, 0.2);
    color: var(--accent-red);
}

.session-actions {
    display: flex;
    gap: 8px;
}

.session-action-btn {
    padding: 5px 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.session-action-btn:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

/* ========== TOOLTIP ========== */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* ========== PRESET BUTTONS ========== */
.preset-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.preset-btn {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.preset-btn:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.preset-btn.linkedin:hover {
    border-color: var(--linkedin-blue);
    color: var(--linkedin-blue);
}

.preset-btn.active {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.preset-btn.active.linkedin {
    background: var(--linkedin-blue);
    border-color: var(--linkedin-blue);
}

/* ========== RATE LIMIT INFO ========== */
.rate-limit-info {
    background: rgba(10, 102, 194, 0.1);
    border: 1px solid var(--linkedin-blue);
    border-radius: 6px;
    padding: 12px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rate-limit-info i {
    color: var(--linkedin-blue);
    font-size: 16px;
}

.rate-limit-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-secondary);
}

/* ========== HISTORY ACTION BUTTONS ========== */
.small {
    padding: 6px 8px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    margin-left: 6px;
    transition: all 0.2s;
}

.history-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.download-csv {
    background: #0b6efd;
    color: white;
}

.download-csv:hover {
    background: #0a5ed7;
}

.download-json {
    background: #17a2b8;
    color: white;
}

.download-json:hover {
    background: #138496;
}

.view-results {
    background: #6c757d;
    color: white;
}

.view-results:hover {
    background: #5a6268;
}

.delete-job {
    background: #dc3545;
    color: white;
}

.delete-job:hover {
    background: #c82333;
}

.resume-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.resume-btn:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.copy-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    padding: 4px 6px;
    margin-left: 8px;
}

.copy-btn:hover {
    border-color: var(--border-color);
    color: var(--text-primary);
}

.badge {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
}

.badge.running {
    background: #dff4ff;
    color: #0366d6;
}

.badge.paused {
    background: #fff7cc;
    color: #a67c00;
}

.badge.idle,
.badge.stopped {
    background: #f3f3f3;
    color: #333;
}

.badge.completed {
    background: #e6f4ea;
    color: #0b7a3a;
}

.badge.error,
.badge.failed {
    background: #ffe6e6;
    color: #b30000;
}

.badge.pending {
    background: #f3f3f3;
    color: #666;
}

/* ========== NOTIFICATION ========== */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
}

.notification.success {
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
}

.notification.error {
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
}

.notification.hide {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ========== RESPONSIVE ADJUSTMENTS ========== */
@media (min-width: 769px) {
    /* Ensure header actions are visible on desktop */
    .header-actions {
        position: static !important;
        right: auto !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        border: none !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 15px !important;
        padding: 0 !important;
        box-shadow: none !important;
        overflow: visible !important;
    }
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .full-width {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: block;
    }
    
    /* Show system status in mobile menu */
    .system-status {
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 8px;
        padding: 0 0 15px 0;
        border-bottom: 1px solid var(--border-color);
        margin: 0 0 15px 0;
        order: -1; /* Show at the top of mobile menu */
    }
    
    .system-status::before {
        content: "System Status";
        font-family: 'Inter', sans-serif;
        font-size: 11px;
        font-weight: 600;
        color: var(--text-muted);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 8px;
    }
    
    .system-status .status-badge {
        width: 100%;
        justify-content: space-between;
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .system-status .status-badge i {
        font-size: 12px;
    }
    
    /* Hide header actions by default on mobile */
    .header-actions {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: var(--bg-secondary);
        border-left: 1px solid var(--border-color);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 80px 20px 20px;
        transition: right 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
        box-shadow: -4px 0 12px rgba(0, 0, 0, 0.3);
    }
    
    /* Show menu when active */
    .header-actions.mobile-menu-open {
        right: 0;
    }
    
    /* Mobile menu overlay */
    .mobile-menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        backdrop-filter: blur(2px);
    }
    
    .mobile-menu-overlay.active {
        display: block;
    }
    
    /* Adjust nav buttons for mobile menu */
    .header-actions .header-nav {
        width: 100%;
        flex-direction: column;
        gap: 0;
        order: 1; /* Navigation first */
    }
    
    .header-actions .nav-btn {
        width: 100%;
        justify-content: flex-start;
        padding: 16px 20px;
        border-radius: 0;
        border-left: 3px solid transparent;
        font-size: 14px;
    }
    
    .header-actions .nav-btn:hover,
    .header-actions .nav-btn:active {
        background: var(--bg-tertiary);
    }
    
    .header-actions .nav-btn.active {
        background: var(--bg-tertiary);
        border-left-color: var(--accent-blue);
    }
    
    /* Hide dividers in mobile menu */
    .header-divider {
        display: none;
    }
    
    /* System health badges - show directly in mobile menu */
    .header-actions .system-health-badges {
        width: 100%;
        flex-direction: column;
        gap: 0;
        padding: 0;
        margin: 0;
        order: 10; /* Place after logout button */
        border-top: 1px solid var(--border-color);
    }
    
    /* Hide the toggle button on mobile - not needed */
    .header-actions .system-status-toggle {
        display: none !important;
    }
    
    /* Show badges directly in mobile menu */
    .header-actions .system-health-badges-list {
        display: flex !important;
        flex-direction: column;
        gap: 0;
        max-height: none !important;
        overflow: visible !important;
    }
    
    .header-actions .system-health-badges-list .health-badge {
        width: 100%;
        justify-content: space-between;
        padding: 14px 20px;
        border-radius: 0;
        border-bottom: 1px solid var(--border-color);
        background: var(--bg-secondary);
        font-size: 13px;
    }
    
    .header-actions .system-health-badges-list .health-badge:hover {
        background: var(--bg-tertiary);
        transform: none;
        box-shadow: none;
    }
    
    .header-actions .system-health-badges-list .health-badge i {
        font-size: 14px;
    }
    
    .header-actions .system-health-badges-list .health-badge span {
        font-weight: 600;
    }
    
    /* Hide dividers in mobile menu */
    .header-actions .header-divider {
        display: none !important;
    }
    
    /* User dropdown in mobile menu */
    .header-actions .user-dropdown {
        width: 100%;
        border-top: 1px solid var(--border-color);
        margin-top: 8px;
        order: 2; /* After navigation */
        flex-direction: column;
        align-items: stretch;
    }
    
    /* Hide the dropdown toggle in mobile - show email directly */
    .header-actions .user-dropdown-toggle {
        display: none;
    }
    
    /* Show user email directly in mobile menu */
    .header-actions .user-dropdown-menu {
        position: static;
        width: 100%;
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
        margin: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: none;
        display: block !important; /* Always show in mobile */
    }
    
    .header-actions .user-dropdown-header {
        padding: 16px 20px;
        border-bottom: 1px solid var(--border-color);
        background: transparent;
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .header-actions .user-dropdown-header::before {
        content: '\f007'; /* FontAwesome user icon */
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        color: var(--text-secondary);
        font-size: 14px;
    }
    
    .header-actions .user-dropdown-divider {
        display: none;
    }
    
    .header-actions .user-dropdown-item {
        padding: 16px 20px;
        font-size: 14px;
        border-radius: 0;
        width: 100%;
        justify-content: flex-start;
        gap: 12px;
        border-top: 1px solid var(--border-color);
    }
    
    /* Theme toggle in mobile menu */
    .header-actions .theme-toggle-btn {
        width: calc(100% - 40px);
        margin: 16px 20px 8px;
        justify-content: center;
        border-radius: 6px;
        height: 44px;
        order: 3; /* After user info */
    }
    
    /* Logout button in mobile menu */
    .header-actions .logout-btn {
        width: calc(100% - 40px);
        margin: 8px 20px 20px;
        justify-content: center;
        height: 44px;
        order: 4; /* After theme toggle */
    }
}

@media (max-width: 640px) {
    .code-decoration {
        display: none;
    }
    
    .login-card {
        padding: 30px 20px;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .config-options {
        grid-template-columns: 1fr;
    }
    
    .control-buttons {
        flex-direction: column;
    }
    
    .download-options {
        flex-direction: column;
    }
    
    .tab-nav {
        flex-wrap: wrap;
    }
    
    .preset-buttons {
        flex-wrap: wrap;
    }

    .modal-container {
        width: 95%;
        max-width: 400px;
    }
    
    /* Adjust mobile menu width for smaller screens */
    .header-actions {
        width: 100%;
        max-width: 320px;
    }
    
    /* User dropdown adjustments for very small screens */
    .header-actions .user-dropdown-toggle {
        padding: 14px 16px;
        font-size: 13px;
    }
    
    .header-actions .user-dropdown-header {
        padding: 10px 16px;
    }
    
    .header-actions .user-dropdown-item {
        padding: 14px 16px;
        font-size: 13px;
    }
}

/* ========== MODAL ALERT SYSTEM ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(6px);
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 450px;
    width: 90%;
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    background: var(--bg-tertiary);
}

.modal-title {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-body p {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: var(--bg-tertiary);
}

.modal-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
    min-width: 100px;
}

.modal-btn-cancel {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.modal-btn-cancel:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.modal-btn-confirm {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

.modal-btn-confirm:hover {
    background: var(--accent-blue);
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
}

.modal-btn-confirm:active {
    transform: translateY(0);
}

/* Modal icon colors based on type */
.modal-icon i.fa-exclamation-triangle {
    color: var(--accent-orange);
}

.modal-icon i.fa-times-circle {
    color: var(--accent-red);
}

.modal-icon i.fa-check-circle {
    color: var(--accent-green);
}

.modal-icon i.fa-question-circle {
    color: var(--accent-blue);
}

/* ========== ADDITIONAL MEDIA QUERIES FOR SMALL SCREENS ========== */

/* Extra small devices (phones, 480px and down) */
@media (max-width: 480px) {
    /* Login page adjustments */
    .main-container.login-page {
        padding: 10px;
    }
    
    .login-card {
        padding: 20px 15px;
        max-width: 100%;
    }
    
    .app-title {
        font-size: 20px;
    }
    
    .form-input {
        padding: 10px 10px 10px 25px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .submit-btn {
        padding: 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Terminal header adjustments */
    .terminal-header {
        padding: 8px 10px;
    }
    
    .terminal-path {
        font-size: 11px;
    }
    
    /* Header adjustments */
    .header {
        padding: 12px 15px;
    }
    
    .logo {
        font-size: 16px;
    }
    
    .nav-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .logout-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    /* Dashboard grid adjustments */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    /* Panel adjustments */
    .panel {
        padding: 15px;
    }
    
    .panel-title {
        font-size: 14px;
    }
    
    /* Configuration options */
    .config-options {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .config-label {
        font-size: 11px;
    }
    
    /* Control buttons */
    .control-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .control-btn {
        padding: 12px;
        font-size: 14px;
    }
    
    /* Stats adjustments */
    .stats-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stat-value {
        font-size: 20px;
    }
    
    /* Table adjustments */
    .table-container {
        max-height: 300px;
    }
    
    .results-table th,
    .results-table td {
        padding: 8px 6px;
        font-size: 12px;
    }
    
    /* Tab navigation */
    .tab-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-btn {
        padding: 8px 12px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    /* File upload */
    .file-upload {
        padding: 20px 15px;
    }
    
    .file-upload-text {
        font-size: 13px;
    }
    
    .file-upload-hint {
        font-size: 11px;
    }
    
    /* Modal adjustments */
    .modal-container {
        width: 95%;
        max-width: 320px;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 15px 20px;
        flex-direction: column-reverse;
    }
    
    .modal-btn {
        width: 100%;
        padding: 12px;
    }
    
    /* Status bar */
    .status-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    /* Download options */
    .download-options {
        flex-direction: column;
        gap: 8px;
    }
    
    /* Activity log */
    .activity-log {
        height: 150px;
        font-size: 11px;
    }
    
    /* Session cards */
    .session-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .session-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    /* LinkedIn branding */
    .linkedin-header {
        padding: 20px;
    }
    
    .linkedin-title {
        font-size: 20px;
    }
    
    /* Rate limit info */
    .rate-limit-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    /* Preset buttons */
    .preset-buttons {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .preset-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    /* History action buttons */
    .history-actions {
        flex-wrap: wrap;
    }
    
    .small {
        padding: 5px 6px;
        font-size: 11px;
    }
    
    /* Form options */
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    /* Notification */
    .notification {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }
    
    /* Status line */
    .status-line {
        left: 10px;
        right: 10px;
        bottom: 10px;
        transform: none;
    }
}

/* Landscape orientation adjustments for small devices */
@media (max-height: 500px) and (orientation: landscape) {
    .main-container.login-page {
        padding: 10px;
    }
    
    .login-card {
        padding: 15px;
    }
    
    .app-title {
        font-size: 18px;
        margin-bottom: 5px;
    }
    
    .app-subtitle {
        font-size: 12px;
    }
    
    .login-form {
        gap: 15px;
    }
    
    .code-decoration {
        display: none;
    }
    
    .activity-log {
        height: 100px;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .terminal-dot {
        width: 10px;
        height: 10px;
    }
    
    .status-dot {
        width: 8px;
        height: 8px;
    }
    
    .status-indicator {
        width: 6px;
        height: 6px;
    }
}

/* ========== DATABASE STATS STYLES ========== */

/* Global font size increase for database stats page */
.main-container {
    font-size: 14px; /* Reduced base font size for better readability */
}

.database-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
}

.db-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.overview-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s;
}

.overview-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-1px);
}

.overview-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.overview-info {
    flex: 1;
}

.overview-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.overview-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-family: 'JetBrains Mono', monospace;
}

.overview-trend {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Database Statistics Styles */
.db-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.db-stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
}

.db-stat-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-1px);
}

.db-stat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.db-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
}

.db-stat-icon.users { background: var(--accent-blue); }
.db-stat-icon.jobs { background: var(--accent-green); }
.db-stat-icon.results { background: var(--accent-orange); }
.db-stat-icon.sessions { background: #9c27b0; }
.db-stat-icon.firmo { background: #ff5722; }
.db-stat-icon.database { background: #607d8b; }

.db-stat-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
}

.db-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-family: 'JetBrains Mono', monospace;
}

.db-stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    font-family: 'Inter', sans-serif;
}

.db-stat-details {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.db-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
}

.db-detail-row span:first-child {
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
}

.db-detail-row span:last-child {
    color: var(--text-primary);
    font-weight: 500;
    font-family: 'JetBrains Mono', monospace;
}

.db-stats-footer {
    text-align: center;
    margin-top: 16px;
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.last-updated {
    font-size: 15px;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
}

.db-stat-card.loading .db-stat-value {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-primary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
    color: transparent;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Collection Table Styles */
.collection-table-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.collection-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

.collection-table th {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    font-size: 12px; /* Match main.css results table */
}

.collection-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.collection-table tbody tr:hover {
    background: var(--bg-secondary);
}

.loading-row {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

/* Theme toggle button styles */
.theme-toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.theme-toggle-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
}

/* Hide one icon at a time */
body[data-theme="dark"] .theme-toggle-btn .fa-moon { display: none; }
body[data-theme="light"] .theme-toggle-btn .fa-sun { display: none; }

/* Status Actions Styles */
.status-actions {
    display: flex;
    gap: 8px;
    margin-left: 15px;
}

.status-action-btn {
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    white-space: nowrap;
}

.status-action-btn:hover {
    background: var(--accent-blue-hover, #4a90e2);
    transform: translateY(-1px);
}

.status-action-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.status-action-btn i {
    font-size: 15px;
}

/* Health Monitoring Styles */
.health-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s ease;
}

.metric-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.1);
}

.metric-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.metric-header i {
    font-size: 16px;
    color: var(--primary-color);
}

.metric-value {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-family: 'JetBrains Mono', monospace;
}

.metric-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.metric-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
}

.metric-fill.warning {
    background: #ffa500;
}

.metric-fill.critical {
    background: #ff4757;
}

.metric-details {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.alerts-section {
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.alerts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.alerts-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.control-btn.small {
    padding: 6px 12px;
    font-size: 12px;
}

.alerts-list {
    max-height: 200px;
    overflow-y: auto;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 4px solid var(--primary-color);
}

.alert-item.warning {
    border-left-color: #ffa500;
}

.alert-item.critical {
    border-left-color: #ff4757;
}

.alert-icon {
    font-size: 16px;
    color: var(--primary-color);
}

.alert-icon.warning {
    color: #ffa500;
}

.alert-icon.critical {
    color: #ff4757;
}

.alert-content {
    flex: 1;
}

.alert-message {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.alert-time {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.no-alerts {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Mobile responsiveness for health metrics */
@media (max-width: 768px) {
    .health-metrics-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .metric-card {
        padding: 15px;
    }
    
    .metric-value {
        font-size: 24px;
    }
    
    .alerts-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}
.metric-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.1);
}

.metric-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.metric-header i {
    font-size: 16px;
    color: var(--primary-color);
}

.metric-value {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-family: 'JetBrains Mono', monospace;
}

.metric-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.metric-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
}

.metric-fill.warning {
    background: #ffa500;
}

.metric-fill.critical {
    background: #ff4757;
}

.metric-details {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.alerts-section {
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

.alerts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.alerts-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.control-btn.small {
    padding: 6px 12px;
    font-size: 12px;
}

.alerts-list {
    max-height: 200px;
    overflow-y: auto;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    margin-bottom: 8px;
    border-left: 4px solid var(--primary-color);
}

.alert-item.warning {
    border-left-color: #ffa500;
}

.alert-item.critical {
    border-left-color: #ff4757;
}

.alert-icon {
    font-size: 16px;
    color: var(--primary-color);
}

.alert-icon.warning {
    color: #ffa500;
}

.alert-icon.critical {
    color: #ff4757;
}

.alert-content {
    flex: 1;
}

.alert-message {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.alert-time {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.no-alerts {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-style: italic;
}

/* Enhanced Features Styles */

/* Performance Analytics */
.performance-analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.analytics-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px;
    transition: all 0.2s;
}

.analytics-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-1px);
}

.analytics-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 13px;
}

.analytics-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-family: 'JetBrains Mono', monospace;
}

.analytics-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.analytics-trend {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.analytics-trend.error {
    color: var(--accent-red);
}

/* Health Alerts */
.health-alerts {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.health-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid;
}

.health-alert.warning {
    background: rgba(251, 133, 0, 0.1);
    border-left-color: var(--accent-orange);
}

.health-alert.info {
    background: rgba(88, 166, 255, 0.1);
    border-left-color: var(--accent-blue);
}

.health-alert.success {
    background: rgba(63, 185, 80, 0.1);
    border-left-color: var(--accent-green);
}

.alert-icon {
    font-size: 18px;
    color: var(--accent-orange);
}

.health-alert.info .alert-icon {
    color: var(--accent-blue);
}

.health-alert.success .alert-icon {
    color: var(--accent-green);
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.alert-message {
    font-size: 12px;
    color: var(--text-secondary);
}

.alert-btn {
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
}

/* Business Intelligence */
.bi-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.bi-section h4 {
    margin: 0 0 12px 0;
    color: var(--text-primary);
    font-size: 14px;
}

.top-users-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: 6px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
}

.user-stats {
    font-size: 10px;
    color: var(--text-secondary);
}

.user-score {
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-green);
}

.domain-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.domain-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-size: 12px;
}

.domain-name {
    color: var(--text-primary);
}

.domain-count {
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

/* Enhanced Scraper Cards */
.db-stat-card.enhanced {
    position: relative;
}

.mini-chart {
    display: flex;
    align-items: end;
    gap: 2px;
    height: 20px;
    margin-left: auto;
}

.chart-bar {
    width: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 1px;
    min-height: 2px;
}

.success-rate.low {
    color: var(--accent-red);
}

.success-rate.high {
    color: var(--accent-green);
}

.error-count {
    color: var(--accent-orange);
}

.quality-score.high {
    color: var(--accent-green);
}

.time-filter {
    display: flex;
    align-items: center;
}

.filter-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
}

/* Data Quality */
.quality-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.quality-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.quality-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 13px;
}

.quality-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-family: 'JetBrains Mono', monospace;
}

.quality-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.quality-btn {
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
}

.quality-progress {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.quality-progress-bar {
    height: 100%;
    background: var(--accent-green);
    border-radius: 2px;
    width: 85%;
}

.freshness-indicator .fresh {
    background: var(--accent-green);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
}

/* Quick Actions */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.action-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
}

.action-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-1px);
}

.action-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.action-content {
    flex: 1;
}

.action-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.action-description {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.action-estimate {
    font-size: 11px;
    color: var(--text-muted);
}

.action-btn {
    background: var(--accent-green);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
}

.action-btn:hover {
    background: var(--accent-green-hover, #45a049);
}

/* Enhanced Collection Table */
.collection-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    width: 200px;
}

.sort-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
}

.collection-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.collection-table th.sortable:hover {
    background: var(--bg-tertiary);
}

.collection-table th.sortable i {
    margin-left: 4px;
    opacity: 0.5;
}

.collection-table th.sortable.sorted i {
    opacity: 1;
}

.collection-actions {
    display: flex;
    gap: 4px;
}

.collection-action-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
}

.collection-action-btn:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
}

/* Growth Trends Styles */
.growth-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.growth-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s;
}

.growth-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.growth-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

.growth-header i {
    font-size: 16px;
    color: var(--accent-blue);
}

.growth-value {
    font-size: 30px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-family: 'JetBrains Mono', monospace;
}

.growth-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.growth-trend {
    font-size: 11px;
    color: var(--accent-green);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.growth-trend.negative {
    color: var(--accent-red);
}

.growth-trend.neutral {
    color: var(--text-muted);
}

/* Mobile optimizations for database stats status section */
@media (max-width: 768px) {
    /* Increase base font size for mobile */
    .main-container {
        font-size: 18px; /* Larger base font for mobile */
    }
    
    /* Mobile font size increases for all elements */
    .overview-label {
        font-size: 18px !important;
    }
    
    .overview-value {
        font-size: 32px !important;
    }
    
    .overview-trend {
        font-size: 16px !important;
    }
    
    .db-stat-title {
        font-size: 20px !important;
    }
    
    .db-stat-value {
        font-size: 36px !important;
    }
    
    .db-stat-label {
        font-size: 16px !important;
    }
    
    .collection-table {
        font-size: 13px !important; /* Match main.css results table */
    }
    
    .collection-table th {
        font-size: 12px !important; /* Match main.css results table */
    }
    
    .collection-table td {
        font-size: 13px !important; /* Match main.css results table */
    }
    
    .last-updated {
        font-size: 16px !important;
    }
    
    .db-detail-row {
        font-size: 16px !important;
    }
    
    .analytics-label,
    .quality-label,
    .growth-label {
        font-size: 16px !important;
    }
    
    .analytics-trend,
    .growth-trend {
        font-size: 16px !important;
    }
    
    .analytics-value {
        font-size: 28px !important;
    }
    
    .quality-value {
        font-size: 24px !important;
    }
    
    .alert-message {
        font-size: 16px !important;
    }
    
    .user-name {
        font-size: 16px !important;
    }
    
    .user-stats {
        font-size: 14px !important;
    }
    
    .user-score {
        font-size: 16px !important;
    }
    
    .action-description {
        font-size: 16px !important;
    }
    
    .action-estimate {
        font-size: 14px !important;
    }
    
    .panel-title {
        font-size: 18px !important;
    }
    
    .chart-title {
        font-size: 16px !important;
    }

    /* Compact status bar for mobile */
    .status-bar {
        padding: 12px;
        flex-direction: column;
        gap: 8px;
        border-radius: 8px;
    }
    
    .status-indicator {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 6px;
        background: var(--bg-tertiary);
        border-radius: 6px;
    }
    
    .status-dot {
        width: 8px;
        height: 8px;
    }
    
    .status-text {
        font-size: 13px !important;
        font-weight: 500;
        text-align: center;
    }

    #statusTimer {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        font-size: 12px !important;
        padding: 6px;
        background: var(--bg-tertiary);
        border-radius: 6px;
        text-align: center;
    }
    
    .status-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-left: 0;
    }
    
    .status-action-btn {
        padding: 10px 12px;
        font-size: 14px;
        font-weight: 500;
        border-radius: 6px;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        transition: all 0.2s ease;
    }
    
    .status-action-btn:hover {
        transform: translateY(-1px);
    }
    
    .status-action-btn span.btn-text {
        display: inline;
        font-size: 12px;
    }
    
    .status-action-btn i {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    /* Even larger fonts for small mobile screens */
    .main-container {
        font-size: 20px; /* Even larger base font */
    }
    
    .overview-label {
        font-size: 20px;
    }
    
    .overview-value {
        font-size: 28px; /* Slightly smaller to fit */
    }
    
    .overview-trend {
        font-size: 18px;
    }
    
    .db-stat-title {
        font-size: 22px;
    }
    
    .db-stat-value {
        font-size: 32px; /* Slightly smaller to fit */
    }
    
    .db-stat-label {
        font-size: 18px;
    }
    
    .collection-table {
        font-size: 18px;
    }
    
    .collection-table th {
        font-size: 12px !important; /* Match main.css results table */
    }
    
    .collection-table td {
        font-size: 13px !important; /* Match main.css results table */
    }
    
    .analytics-value {
        font-size: 26px; /* Large numbers for mobile */
    }
    
    .quality-value {
        font-size: 22px; /* Large numbers for mobile */
    }

    /* Minimal status bar for small screens */
    .status-bar {
        padding: 10px;
        gap: 8px;
        border-radius: 6px;
    }

    .status-indicator {
        padding: 4px 8px;
        border-radius: 4px;
        background: var(--bg-tertiary);
    }

    .status-dot {
        width: 6px;
        height: 6px;
    }

    .status-text {
        font-size: 12px !important;
        font-weight: 500;
    }

    #statusTimer {
        padding: 4px 8px;
        background: var(--bg-tertiary);
        border-radius: 4px;
        font-size: 11px !important;
        font-weight: 500;
        gap: 4px;
        min-height: auto;
    }
    
    .status-actions {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    
    .status-action-btn {
        padding: 8px 10px;
        font-size: 12px;
        font-weight: 500;
        min-height: 32px;
        border-radius: 4px;
    }

    .status-action-btn:hover {
        transform: translateY(-1px);
    }
    
    .status-action-btn span.btn-text {
        display: inline;
        font-size: 11px;
    }
    
    .status-action-btn i {
        font-size: 12px;
    }
}

@media (max-width: 360px) {
    /* Maximum font sizes for very small screens */
    .main-container {
        font-size: 22px; /* Maximum base font */
    }
    
    .overview-label {
        font-size: 22px;
    }
    
    .overview-value {
        font-size: 26px;
    }
    
    .overview-trend {
        font-size: 20px;
    }
    
    .db-stat-title {
        font-size: 24px;
    }
    
    .db-stat-value {
        font-size: 30px;
    }
    
    .db-stat-label {
        font-size: 20px;
    }
    
    .analytics-value {
        font-size: 24px; /* Maximum numbers for very small screens */
    }
    
    .quality-value {
        font-size: 20px; /* Maximum numbers for very small screens */
    }
    
    .collection-table th {
        font-size: 12px !important; /* Match main.css results table */
    }
    
    .collection-table td {
        font-size: 13px !important; /* Match main.css results table */
    }

    /* Ultra-compact status bar for very small screens */
    .status-bar {
        padding: 8px;
        gap: 6px;
        border-radius: 4px;
        margin: 8px 4px;
    }
    
    .status-indicator {
        padding: 3px 6px;
        border-radius: 3px;
        background: var(--bg-tertiary);
    }
    
    .status-dot {
        width: 5px;
        height: 5px;
    }
    
    .status-text {
        font-size: 10px !important;
        font-weight: 500;
    }

    #statusTimer {
        padding: 3px 6px;
        border-radius: 3px;
        font-size: 9px !important;
        font-weight: 500;
        gap: 3px;
        min-height: auto;
        background: var(--bg-tertiary);
    }
    
    .status-actions {
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }
    
    .status-action-btn {
        padding: 6px 8px;
        font-size: 10px;
        font-weight: 500;
        min-height: 28px;
        border-radius: 3px;
    }

    .status-action-btn:hover {
        transform: translateY(-1px);
    }
    
    .status-action-btn span.btn-text {
        display: inline;
        font-size: 9px;
    }
    
    .status-action-btn i {
        font-size: 10px;
    }
}

#refreshIcon.paused {
    animation-play-state: paused;
}

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

/* ========== RESPONSIVE STYLES FOR DATABASE STATS ========== */

/* Tablet and smaller desktop screens */
@media (max-width: 1200px) {
    .database-dashboard {
        grid-template-columns: 1fr;
    }
    
    .db-overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .db-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 15px;
    }
}

/* Mobile landscape and tablet portrait */
@media (max-width: 768px) {
    .database-dashboard {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }
    
    .db-overview-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .overview-card {
        padding: 15px;
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .overview-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .overview-value {
        font-size: 20px;
    }
    
    .db-stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .db-stat-card {
        padding: 15px;
    }
    
    .db-stat-value {
        font-size: 24px;
    }
    
    .db-stat-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .growth-metrics {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .growth-card {
        padding: 15px;
    }
    
    .quality-metrics {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .quality-card {
        padding: 15px;
    }
    
    .collection-controls {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .search-input,
    .sort-select {
        width: 100%;
    }
    
    .collection-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .collection-table {
        min-width: 600px;
    }
    
    .collection-table th,
    .collection-table td {
        padding: 8px 6px;
        font-size: 12px !important; /* Match main.css results table mobile */
    }
}

/* Mobile portrait */
@media (max-width: 640px) {
    .database-dashboard {
        padding: 10px;
        gap: 10px;
    }
    
    .db-overview-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .overview-card {
        padding: 12px;
        flex-direction: row;
        text-align: left;
        gap: 12px;
    }
    
    .overview-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .overview-value {
        font-size: 18px;
    }
    
    .overview-label {
        font-size: 11px;
    }
    
    .overview-trend {
        font-size: 10px;
    }
    
    .db-stat-card {
        padding: 12px;
    }
    
    .db-stat-header {
        margin-bottom: 12px;
    }
    
    .db-stat-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .db-stat-title {
        font-size: 13px;
    }
    
    .db-stat-value {
        font-size: 20px;
    }
    
    .db-stat-label {
        font-size: 10px;
        margin-bottom: 10px;
    }
    
    .db-detail-row {
        font-size: 11px;
        margin-bottom: 4px;
    }
    
    .growth-card,
    .quality-card {
        padding: 12px;
    }
    
    .growth-value,
    .quality-value {
        font-size: 24px !important; /* Override with larger size */
    }
    
    .growth-label,
    .quality-label {
        font-size: 10px;
    }
    
    .growth-trend {
        font-size: 10px;
    }
    
    .collection-table {
        min-width: 500px;
    }
    
    .collection-table th,
    .collection-table td {
        padding: 6px 4px;
        font-size: 12px !important; /* Match main.css results table mobile */
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .database-dashboard {
        padding: 8px;
        gap: 8px;
    }
    
    .overview-card {
        padding: 10px;
    }
    
    .overview-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .overview-value {
        font-size: 16px;
    }
    
    .overview-label {
        font-size: 10px;
    }
    
    .db-stat-card {
        padding: 10px;
    }
    
    .db-stat-icon {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
    
    .db-stat-title {
        font-size: 12px;
    }
    
    .db-stat-value {
        font-size: 18px;
    }
    
    .db-stat-label {
        font-size: 9px;
    }
    
    .db-detail-row {
        font-size: 10px;
    }
    
    .growth-card,
    .quality-card {
        padding: 10px;
    }
    
    .growth-value,
    .quality-value {
        font-size: 22px !important; /* Override with larger size */
    }
    
    .growth-header,
    .quality-header {
        font-size: 11px;
    }
    
    .collection-table {
        min-width: 400px;
    }
    
    .collection-table th,
    .collection-table td {
        padding: 4px 3px;
        font-size: 12px !important; /* Match main.css results table mobile */
    }
}

/* Mobile responsiveness for health metrics */
@media (max-width: 768px) {
    .health-metrics-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .metric-card {
        padding: 15px;
    }
}
/* ========== ADVANCED VISUALIZATIONS STYLES ========== */

.visualizations-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* 2x2 Grid Layout for Advanced Visualizations */
.visualizations-grid-2x2 {
    grid-template-columns: repeat(2, 1fr) !important;
}

.chart-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s;
}

.chart-container:hover {
    border-color: var(--accent-blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.chart-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--accent-blue);
    border-radius: 2px;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 6px;
    overflow: hidden;
}

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

/* Chart loading state */
.chart-wrapper.loading {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-primary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.chart-wrapper.loading::after {
    content: 'Loading chart...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
}

/* ========== MOBILE RESPONSIVE STYLES FOR ADVANCED VISUALIZATIONS ========== */

/* Tablet and smaller desktop screens - Keep 2x2 grid */
@media (max-width: 1200px) {
    .visualizations-dashboard {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .visualizations-grid-2x2 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .chart-container {
        padding: 15px;
    }
    
    .chart-title {
        font-size: 15px;
    }
    
    .chart-wrapper {
        min-height: 180px;
    }
}

/* Mobile landscape and tablet portrait - Switch to single column */
@media (max-width: 768px) {
    .visualizations-dashboard,
    .visualizations-grid-2x2 {
        grid-template-columns: 1fr !important;
        gap: 15px;
        margin-top: 15px;
    }
    
    .chart-container {
        padding: 15px;
        border-radius: 6px;
    }
    
    .chart-title {
        font-size: 16px;
        margin-bottom: 15px;
        font-weight: 600;
    }
    
    .chart-title::before {
        width: 4px;
        height: 16px;
    }
    
    .chart-wrapper {
        min-height: 250px;
        border-radius: 6px;
    }
    
    .chart-wrapper.loading::after {
        font-size: 14px;
    }
    
    /* Larger chart heights for better mobile visibility */
    #scraperActivityChart,
    #databaseGrowthChart {
        max-height: 280px !important;
        min-height: 250px !important;
    }
    
    #collectionSizeChart,
    #dataDistributionChart {
        max-height: 260px !important;
        min-height: 230px !important;
    }
}

/* Mobile portrait */
@media (max-width: 640px) {
    .visualizations-dashboard {
        gap: 15px;
        margin-top: 15px;
    }
    
    .chart-container {
        padding: 15px;
        border-radius: 6px;
    }
    
    .chart-title {
        font-size: 15px;
        margin-bottom: 12px;
        flex-wrap: wrap;
        font-weight: 600;
    }
    
    .chart-title::before {
        width: 4px;
        height: 15px;
    }
    
    .chart-wrapper {
        min-height: 220px;
        border-radius: 6px;
    }
    
    .chart-wrapper.loading::after {
        font-size: 13px;
    }
    
    /* Good sized charts for mobile portrait */
    #scraperActivityChart,
    #databaseGrowthChart {
        max-height: 250px !important;
        min-height: 220px !important;
    }
    
    #collectionSizeChart,
    #dataDistributionChart {
        max-height: 230px !important;
        min-height: 200px !important;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .visualizations-dashboard {
        gap: 12px;
        margin-top: 12px;
    }
    
    .chart-container {
        padding: 12px;
        border-radius: 6px;
    }
    
    .chart-title {
        font-size: 14px;
        margin-bottom: 10px;
        line-height: 1.3;
        font-weight: 600;
    }
    
    .chart-title::before {
        width: 3px;
        height: 14px;
    }
    
    .chart-wrapper {
        min-height: 200px;
        border-radius: 6px;
    }
    
    .chart-wrapper.loading::after {
        font-size: 12px;
    }
    
    /* Reasonable chart heights for small screens */
    #scraperActivityChart,
    #databaseGrowthChart {
        max-height: 220px !important;
        min-height: 200px !important;
    }
    
    #collectionSizeChart,
    #dataDistributionChart {
        max-height: 200px !important;
        min-height: 180px !important;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .visualizations-dashboard {
        gap: 10px;
        margin-top: 10px;
    }
    
    .chart-container {
        padding: 10px;
        border-radius: 6px;
    }
    
    .chart-title {
        font-size: 13px;
        margin-bottom: 8px;
        line-height: 1.2;
        font-weight: 600;
    }
    
    .chart-title::before {
        width: 3px;
        height: 13px;
    }
    
    .chart-wrapper {
        min-height: 180px;
        border-radius: 6px;
    }
    
    .chart-wrapper.loading::after {
        font-size: 11px;
    }
    
    /* Still usable chart heights for very small screens */
    #scraperActivityChart,
    #databaseGrowthChart {
        max-height: 200px !important;
        min-height: 180px !important;
    }
    
    #collectionSizeChart,
    #dataDistributionChart {
        max-height: 180px !important;
        min-height: 160px !important;
    }
}

/* Landscape orientation adjustments for small devices */
@media (max-height: 500px) and (orientation: landscape) {
    .visualizations-dashboard {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .chart-container {
        padding: 10px;
    }
    
    .chart-title {
        font-size: 12px;
        margin-bottom: 6px;
    }
    
    .chart-wrapper {
        min-height: 140px;
    }
    
    /* Compact but usable chart heights for landscape */
    #scraperActivityChart,
    #databaseGrowthChart {
        max-height: 160px !important;
        min-height: 140px !important;
    }
    
    #collectionSizeChart,
    #dataDistributionChart {
        max-height: 140px !important;
        min-height: 120px !important;
    }
}

/* High DPI displays - ensure charts remain crisp */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .chart-wrapper canvas {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark theme specific adjustments for charts */
body[data-theme="dark"] .chart-wrapper {
    background: var(--bg-primary);
}

body[data-theme="dark"] .chart-container {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] .chart-container:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Light theme specific adjustments for charts */
body[data-theme="light"] .chart-wrapper {
    background: #e8ecf4;
}

body[data-theme="light"] .chart-container {
    box-shadow: 0 2px 8px rgba(66, 153, 225, 0.1);
    border: 1px solid rgba(193, 204, 215, 0.8);
}

body[data-theme="light"] .chart-container:hover {
    box-shadow: 0 4px 16px rgba(66, 153, 225, 0.15);
    border-color: rgba(66, 153, 225, 0.3);
}

/* Chart responsiveness helper classes */
.chart-responsive {
    position: relative;
    height: 0;
    overflow: hidden;
}

.chart-responsive canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

/* Chart error state */
.chart-wrapper.error {
    background: rgba(248, 81, 73, 0.1);
    border: 1px dashed var(--accent-red);
}

.chart-wrapper.error::after {
    content: 'Failed to load chart';
    color: var(--accent-red);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

/* Chart empty state */
.chart-wrapper.empty {
    background: rgba(139, 148, 158, 0.1);
    border: 1px dashed var(--text-muted);
}

.chart-wrapper.empty::after {
    content: 'No data available';
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}
/* ========== MODERN VIBRANT LIGHT THEME ENHANCEMENTS ========== */

/* Enhanced panel styling for sky blue theme */
body[data-theme="light"] .panel {
    background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
    border: 1px solid rgba(194, 217, 240, 0.8);
    box-shadow: 0 2px 8px rgba(49, 130, 206, 0.06);
}

body[data-theme="light"] .panel:hover {
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.1);
}

/* Sky blue accented cards */
body[data-theme="light"] .overview-card,
body[data-theme="light"] .db-stat-card,
body[data-theme="light"] .growth-card,
body[data-theme="light"] .quality-card,
body[data-theme="light"] .analytics-card {
    background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
    border: 1px solid rgba(194, 217, 240, 0.7);
    box-shadow: 0 2px 6px rgba(49, 130, 206, 0.05);
}

body[data-theme="light"] .overview-card:hover,
body[data-theme="light"] .db-stat-card:hover,
body[data-theme="light"] .growth-card:hover,
body[data-theme="light"] .quality-card:hover,
body[data-theme="light"] .analytics-card:hover {
    border-color: rgba(49, 130, 206, 0.3);
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.1);
    transform: translateY(-2px);
}

/* Header styling for sky blue theme */
body[data-theme="light"] .header {
    background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
    border-bottom: 1px solid rgba(194, 217, 240, 0.8);
    box-shadow: 0 2px 8px rgba(49, 130, 206, 0.06);
}

/* Status bar with sky blue accents */
body[data-theme="light"] .status-bar {
    background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
    border: 1px solid rgba(194, 217, 240, 0.8);
    box-shadow: 0 2px 6px rgba(49, 130, 206, 0.05);
}

/* Form inputs with sky blue focus */
body[data-theme="light"] .form-input:focus,
body[data-theme="light"] .config-input:focus,
body[data-theme="light"] .search-input:focus {
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
    background: #f8fbff;
}

/* Buttons with sky blue theme */
body[data-theme="light"] .control-btn:hover,
body[data-theme="light"] .nav-btn:hover {
    background: rgba(49, 130, 206, 0.08);
    color: #3182ce;
}

/* Table styling for sky blue theme */
body[data-theme="light"] .results-table th,
body[data-theme="light"] .collection-table th {
    background: linear-gradient(135deg, #eef6ff 0%, #e1f0ff 100%);
    border-bottom: 1px solid rgba(194, 217, 240, 0.8);
}

body[data-theme="light"] .results-table tr:hover td,
body[data-theme="light"] .collection-table tbody tr:hover {
    background: rgba(49, 130, 206, 0.04);
}

/* Modal styling for sky blue theme */
body[data-theme="light"] .modal-container {
    background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
    border: 1px solid rgba(194, 217, 240, 0.8);
    box-shadow: 0 20px 40px rgba(49, 130, 206, 0.15);
}

/* Health badges with sky blue theme */
body[data-theme="light"] .health-badge,
body[data-theme="light"] .status-badge {
    background: rgba(238, 246, 255, 0.8);
    border-color: rgba(194, 217, 240, 0.6);
}

body[data-theme="light"] .health-badge:hover,
body[data-theme="light"] .status-badge:hover {
    background: rgba(225, 240, 255, 0.9);
    box-shadow: 0 2px 8px rgba(49, 130, 206, 0.1);
}

/* Login card with sky blue gradient */
body[data-theme="light"] .login-card {
    background: linear-gradient(135deg, #f8fbff 0%, #eef6ff 100%);
    border: 1px solid rgba(194, 217, 240, 0.8);
    box-shadow: 0 8px 32px rgba(49, 130, 206, 0.1);
}

/* Notification styling */
body[data-theme="light"] .notification.success {
    background: linear-gradient(135deg, #f0fff4 0%, #e6fffa 100%);
    border-color: #38a169;
}

body[data-theme="light"] .notification.error {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border-color: #e53e3e;
}

/* Activity log with sky blue theme */
body[data-theme="light"] .activity-log {
    background: linear-gradient(135deg, #eef6ff 0%, #e1f0ff 100%);
    border: 1px solid rgba(194, 217, 240, 0.6);
}

/* File upload areas */
body[data-theme="light"] .file-upload {
    border: 2px dashed rgba(49, 130, 206, 0.3);
    background: rgba(248, 251, 255, 0.5);
}

body[data-theme="light"] .file-upload:hover {
    border-color: #3182ce;
    background: rgba(238, 246, 255, 0.8);
}

/* Subtle animation for sky blue theme */
@keyframes skyBlueGlow {
    0%, 100% { box-shadow: 0 0 5px rgba(49, 130, 206, 0.1); }
    50% { box-shadow: 0 0 20px rgba(49, 130, 206, 0.2); }
}

body[data-theme="light"] .status-dot.active {
    animation: skyBlueGlow 2s infinite, pulse 2s infinite;
}

/* Scrollbar styling for sky blue theme */
body[data-theme="light"] ::-webkit-scrollbar-track {
    background: #eef6ff;
}

body[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(49, 130, 206, 0.3);
    border-radius: 6px;
}

body[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(49, 130, 206, 0.5);
}

/* ========== MODAL RESPONSIVE STYLES ========== */
@media (max-width: 768px) {
    .duplicate-dialog {
        width: 95vw;
        max-height: 85vh;
        margin: 10px;
    }

    .duplicate-dialog-header {
        padding: 16px 20px;
    }

    .duplicate-dialog-header h3 {
        font-size: 16px;
    }

    .duplicate-dialog-content {
        padding: 20px;
        max-height: calc(85vh - 100px);
    }
}

@media (max-width: 480px) {
    .duplicate-dialog-overlay {
        padding: 0;
    }
    
    .duplicate-dialog {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .duplicate-dialog-header {
        border-radius: 0;
        padding: 16px;
    }

    .duplicate-dialog-header h3 {
        font-size: 15px;
    }

    .duplicate-dialog-content {
        max-height: calc(100vh - 80px);
        padding: 16px;
    }
    
    .duplicate-summary {
        padding: 12px;
        margin-bottom: 16px;
    }
    
    .duplicate-collection {
        padding: 12px;
        margin-bottom: 16px;
    }
    
    .duplicate-note {
        padding: 12px;
        margin-top: 16px;
    }
}

/* Confirmation Dialog Mobile Styles */
@media (max-width: 768px) {
    .confirm-dialog {
        width: 95%;
        max-width: none;
    }

    .confirm-dialog-header {
        padding: 16px 20px 12px;
    }

    .confirm-dialog-header h3 {
        font-size: 16px;
    }

    .confirm-dialog-content {
        padding: 20px;
    }

    .confirm-dialog-actions {
        flex-direction: column-reverse;
        gap: 8px;
    }

    .confirm-dialog-btn {
        width: 100%;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .confirm-dialog {
        width: 100%;
        margin: 10px;
        border-radius: 8px;
    }

    .confirm-dialog-header {
        border-radius: 8px 8px 0 0;
        padding: 16px;
    }

    .confirm-dialog-content {
        padding: 16px;
    }

    .confirm-dialog-message {
        font-size: 14px;
    }
}