/* ========================================
   ROVR Brand Identity v3.0
   Light Theme (Default)
   ======================================== */
:root {
    /* ROVR Brand Colors */
    --primary: #04B186;
    /* ROVR Mint */
    --primary-hover: #039770;
    /* Darker mint */
    --bg: #F4F0E3;
    /* Vintage Cream */
    --surface: #FFFFFF;
    /* Pure White */
    --surface-hover: #F9F7F0;
    /* Lighter cream */
    --border: #E0D8C9;
    /* Cream border */
    --text: #014051;
    /* Deep Forest */
    --text-muted: #6B8E99;
    /* Muted forest */
    --success: #04B186;
    /* ROVR Mint (better contrast on light bg) */
    --warning: #EA80AE;
    /* Petal Pink */
    --danger: #D94452;
    /* Adjusted red */

    /* Accent Colors */
    --accent-sky: #C6D6F6;
    /* Soft Sky */
    --accent-pink: #EA80AE;
    /* Petal Pink */
    --accent-lime: #B7E74B;
    /* Citron Lime */
    --accent-forest: #014051;
    /* Deep Forest */

    /* Typography */
    --font-sans: 'Noto Sans', system-ui, -apple-system, sans-serif;

    /* UI Elements */
    --radius: 12px;
    --shadow: 0 1px 3px rgba(1, 64, 81, 0.1), 0 1px 2px rgba(1, 64, 81, 0.06);
    --glass: rgba(244, 240, 227, 0.7);

    /* Tints for Inline Styles */
    --primary-5: rgba(4, 177, 134, 0.05);
    --primary-10: rgba(4, 177, 134, 0.1);
    --primary-20: rgba(4, 177, 134, 0.2);
    --success-5: rgba(4, 177, 134, 0.05);
    /* Use ROVR Mint tints for success in light mode */
    --success-10: rgba(4, 177, 134, 0.1);
    --success-20: rgba(4, 177, 134, 0.2);
    --danger-5: rgba(217, 68, 82, 0.05);
    --danger-10: rgba(217, 68, 82, 0.1);
    --danger-20: rgba(217, 68, 82, 0.2);
    --warning-5: rgba(234, 128, 174, 0.05);
    --warning-10: rgba(234, 128, 174, 0.1);
    --warning-20: rgba(234, 128, 174, 0.2);
}

/* ========================================
   ROVR Brand Identity v3.0
   Dark Theme
   ======================================== */
body.theme-dark {
    --primary: #04B186;
    /* ROVR Mint */
    --primary-hover: #05D9A1;
    --bg: #080C10;
    /* Midnight Black */
    --surface: #0F1721;
    /* Deep Charcoal */
    --surface-hover: #161F2B;
    /* Slightly lighter surface */
    --border: #1E293B;
    /* Sharper charcoal border */
    --text: #F1F5F9;
    /* Crisp Slate */
    --text-muted: #94A3B8;
    /* Muted Slate */
    --success: #B7E74B;
    /* Citron Lime */
    --warning: #EA80AE;
    /* Petal Pink */
    --danger: #FF6B7A;
    /* Lighter red */

    /* Accent Colors */
    --accent-sky: #C6D6F6;
    --accent-pink: #EA80AE;
    --accent-lime: #B7E74B;
    --accent-forest: #F1F5F9;

    /* UI Elements */
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --glass: rgba(15, 23, 33, 0.8);

    /* Skeleton Overrides for deeper theme */
    --skeleton-bg: #161F2B;
    --skeleton-shimmer: rgba(4, 177, 134, 0.05);
    /* Tints Adjusted for Dark Mode */
    --primary-5: rgba(4, 177, 134, 0.1);
    --primary-10: rgba(4, 177, 134, 0.2);
    --primary-20: rgba(4, 177, 134, 0.3);
    --success-5: rgba(183, 231, 75, 0.1);
    --success-10: rgba(183, 231, 75, 0.2);
    --success-20: rgba(183, 231, 75, 0.3);
    --danger-5: rgba(255, 107, 122, 0.08);
    --danger-10: rgba(255, 107, 122, 0.15);
    --danger-20: rgba(255, 107, 122, 0.25);
    --warning-5: rgba(234, 128, 174, 0.08);
    --warning-10: rgba(234, 128, 174, 0.15);
    --warning-20: rgba(234, 128, 174, 0.25);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    /* We'll use custom scroll for main content */
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0 1.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.logo img {
    max-width: 100%;
    object-fit: contain;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--surface-hover);
    color: var(--text);
}

.nav-link.active {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

/* Main Content */
.main-layout {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

header {
    height: 72px;
    background-color: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 3rem;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.search-bar {
    background-color: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.625rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 440px;
    transition: all 0.2s ease;
}

.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-10);
    background: var(--surface);
}

.search-bar input {
    background: none;
    border: none;
    color: var(--text);
    width: 100%;
    outline: none;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

.content-area {
    padding: 2.5rem 3rem;
    overflow-y: auto;
    flex-grow: 1;
}

/* Dashboard Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: var(--surface);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Table */
.data-table-container {
    background-color: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.table-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

thead {
    background-color: var(--surface) !important;
    /* Ensure consistent header background */
    border-bottom: 1px solid var(--border);
}

th {
    text-align: left;
    padding: 1rem 1.5rem;
    background-color: var(--surface) !important;
    /* White background for better contrast */
    color: var(--text) !important;
    /* Use primary text color instead of muted */
    font-size: 0.75rem;
    font-weight: 700;
    /* Make headers bolder */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

tr:hover td {
    background-color: var(--surface-hover);
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

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

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Score Circle */
.score-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}

.score-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.view {
    animation: fadeIn 0.3s ease-out;
}

/* Hidden by default */
.hidden {
    display: none !important;
}

/* Spinner - Refined for premium feel */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(4, 177, 134, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    display: inline-block;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 1.5px;
}

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

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

.badge-secondary {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-hover);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border);
}

.btn {
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

.btn-secondary {
    background-color: var(--surface-hover);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
}

.btn-icon-only {
    width: 38px;
    height: 38px;
    padding: 0;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: all 0.2s;
}

.btn-icon-only:hover {
    background: var(--surface-hover);
    color: var(--text);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.btn-icon-only:active {
    transform: translateY(0);
}

/* Loading State for Buttons */
.btn-loading {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}

.btn-loading .spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0 !important;
}

.btn-loading i,
.btn-loading svg {
    visibility: hidden;
}

[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 4px 8px;
    background: var(--bg);
    color: var(--text);
    font-size: 11px;
    white-space: nowrap;
    border-radius: 4px;
    border: 1px solid var(--border);
    pointer-events: none;
    z-index: 1000;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(1, 64, 81, 0.75);
    /* Deep Forest with transparency */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

/* Dark theme modal overlay adjustment */
body.theme-dark .modal-overlay {
    background: rgba(0, 0, 0, 0.8);
    /* Darker overlay for dark mode */
}

.modal-content {
    background: var(--surface);
    width: 600px;
    max-width: 90vw;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 2rem;
    animation: fadeIn 0.3s ease-out;
}

.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
    transition: border-color 0.2s;
}

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

/* Dropdown Menu */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 1rem;
    background: none;
    border: none;
    color: var(--text);
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease;
}

.dropdown-item:hover {
    background: var(--surface-hover);
}

.dropdown-item:hover span {
    color: var(--text);
}

.dropdown-item-danger {
    color: var(--danger);
}

.dropdown-item-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.dropdown-item-danger:hover span {
    color: var(--danger);
}

.dropdown-menu {
    z-index: 1000;
}

/* Status Pending */
.badge-pending {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-muted);
}

/* ========================================
   Toast Notification System
   ======================================== */
.toast-container {
    position: fixed;
    top: 5rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    animation: slideInRight 0.3s ease-out;
}

.toast.toast-info {
    border-left: 4px solid var(--primary);
}

.toast.toast-success {
    border-left: 4px solid var(--success);
}

.toast.toast-warning {
    border-left: 4px solid var(--warning);
}

.toast.toast-error {
    border-left: 4px solid var(--danger);
}

.toast-removing {
    animation: slideOutRight 0.3s ease-out forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

.toast-icon {
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.5;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.toast-close:hover {
    color: var(--text);
}

/* ========================================
   Job Card Hover Enhancement
   ======================================== */
.job-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.job-card:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ========================================
   Enhanced Table Layout (v1.1.28)
   ======================================== */
table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    margin: 0;
}

.data-table-container {
    background-color: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    width: 100%;
}

.candidates-table {
    min-width: 900px;
}

.candidates-table th,
.candidates-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.candidates-table thead {
    background-color: var(--bg);
}

.candidates-table thead th {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text);
    background-color: var(--bg);
    position: sticky;
    top: 0;
    z-index: 5;
}

.candidates-table tbody tr:hover {
    background-color: var(--surface-hover);
}

tbody tr:hover {
    background-color: var(--surface-hover);
}

tbody tr td:first-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

tbody tr td:last-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* --- Sync Status Indicator --- */

.sync-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.sync-status:hover {
    opacity: 0.8;
}

.sync-status.sync-ok {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.sync-status.sync-pending {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.sync-status.sync-conflict {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.sync-status.sync-in-progress {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.sync-status.sync-disconnected {
    background: rgba(156, 163, 175, 0.1);
    color: #6b7280;
    cursor: default;
}

.sync-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(59, 130, 246, 0.2);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: sync-spin 0.8s linear infinite;
}

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

/* Sync Panel Modal */
.sync-panel-modal .sync-stat-card {
    background: var(--bg-secondary, #f8f8f8);
    border-radius: 8px;
    padding: 12px;
}

.sync-panel-modal .sync-conflict-item {
    border-left: 3px solid var(--warning, #f59e0b);
}

/* ========================================
   Skeleton Loaders
   ======================================== */
@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg,
            var(--border) 25%,
            var(--surface-hover) 50%,
            var(--border) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 2s infinite linear;
    border-radius: var(--radius);
    opacity: 0.7;
}

body.theme-dark .skeleton {
    background: linear-gradient(90deg,
            var(--skeleton-bg) 25%,
            var(--skeleton-shimmer) 50%,
            var(--skeleton-bg) 75%);
    background-size: 200% 100%;
}

/* App Loader (Splash Screen) */
.app-loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.app-loader-icon {
    width: 80px;
    height: 80px;
    background: var(--primary-10);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 2rem;
    animation: app-pulse 2s infinite ease-in-out;
}

@keyframes app-pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
        box-shadow: 0 0 0 0 rgba(4, 177, 134, 0.4);
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
        box-shadow: 0 0 0 20px rgba(4, 177, 134, 0);
    }

    100% {
        transform: scale(0.95);
        opacity: 0.8;
        box-shadow: 0 0 0 0 rgba(4, 177, 134, 0);
    }
}

/* Top Progress Bar */
.top-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--primary);
    z-index: 10000;
    transition: width 0.3s ease-out, opacity 0.3s ease-in-out;
    box-shadow: 0 0 10px var(--primary);
}

.top-progress-bar.hidden {
    opacity: 0;
    width: 0% !important;
}

/* Page Transition */
.view {
    animation: view-fade-in 0.4s ease-out;
}

@keyframes view-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
    width: 100%;
}

.skeleton-title {
    height: 1.5rem;
    margin-bottom: 1rem;
    width: 60%;
}

.skeleton-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.skeleton-button {
    height: 38px;
    width: 100px;
    border-radius: var(--radius);
}

.skeleton-card {
    height: 120px;
    border-radius: var(--radius);
}