/* Import Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* CSS Variables for theming */
:root {
    --primary-color: #405189;
    --secondary-color: #0ab39c;
    --primary-text-color: white; /* New variable for text on primary background */
    --text-color: #495057;
    --text-muted: #7a7f9a;
    --bg-color: #f3f3f9;
    --card-bg: white;
    --border-color: #e9ebec;
    --sidebar-bg: var(--primary-color);
    --sidebar-text: #aeb1cf;
    --sidebar-active-text: var(--primary-text-color); /* Use dynamic text color */
    --sidebar-active-bg: rgba(0, 0, 0, 0.1);
    --shadow: 0 2px 4px rgba(0,0,0,0.05);
}

body.dark-theme {
    --primary-color: #556ee6;
    --secondary-color: #0ab39c;
    --primary-text-color: white;
    --text-color: #ced4da;
    --text-muted: #adb5bd;
    --bg-color: #2a3042;
    --card-bg: #2e3446;
    --border-color: #3e4457;
    --sidebar-bg: #2e3446;
    --sidebar-text: #aeb1cf;
    --sidebar-active-text: white;
    --sidebar-active-bg: #363c51;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    display: flex;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1002;
    transition: background-color 0.3s, left 0.3s ease-in-out;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--sidebar-active-text);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

    .sidebar-header h2 {
        font-size: 1.5rem;
    }

.close-sidebar {
    display: none; /* Hidden by default, shown on mobile */
    background: none;
    border: none;
    color: var(--sidebar-active-text);
    font-size: 1.5rem;
    cursor: pointer;
}

.sidebar-nav {
    list-style: none;
    padding-top: 20px;
}

    .sidebar-nav li a {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 25px;
        text-decoration: none;
        color: var(--sidebar-text);
        transition: all 0.2s ease;
    }

        .sidebar-nav li a span {
            flex-grow: 1;
            margin-left: 15px;
        }

        .sidebar-nav li a .arrow {
            transition: transform 0.2s ease-in-out;
        }

        .sidebar-nav li a:hover, .sidebar-nav li a.active {
            color: var(--sidebar-active-text);
            background-color: var(--sidebar-active-bg);
        }

    .sidebar-nav li.open > a .arrow {
        transform: rotate(180deg);
    }

.submenu {
    list-style: none;
    padding-left: 30px; /* Indent submenu items */
    background-color: rgba(0,0,0,0.1);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

.sidebar-nav li.open > .submenu {
    max-height: 500px; /* Or a large enough value */
}

.submenu li a {
    padding: 10px 15px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

    .submenu li a i {
        font-size: 1rem; /* Slightly smaller icon for submenu */
    }


/* Main Content */
.main-content {
    flex-grow: 1;
    margin-left: 250px;
    padding: 24px;
    transition: margin-left 0.3s ease-in-out;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-toggle {
    display: none; /* Hidden by default */
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
}

.header-title h1 {
    font-size: 1.5rem;
    color: var(--text-color);
}

.header-title p {
    color: var(--text-muted);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

    .header-actions i {
        font-size: 1.4rem;
        cursor: pointer;
    }

.avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

/* Dashboard Grid & Cards */
/*.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}
.dashboard-grid a {
    text-decoration:none;
    cursor:context-menu;   
}
    .card {
    background-color: var(--card-bg);
    padding: 24px;
    border: 1px solid var(--border-color);
    border-radius: 80px;
    box-shadow: var(--shadow);
    transition: background-color 0.3s, border-color 0.3s;
}

    .card h3 {
        font-size: 0.8rem;
        color: var(--text-muted);
        text-transform: uppercase;
        margin-bottom: 8px;
    }

    .card h2 {
        font-size: 2rem;
        color: var(--text-color);
    }

    .card p {
        margin-top: 16px;
    }*/

.positive-change {
    color: var(--secondary-color);
}

.negative-change {
    color: #f06548;
}

/* Data Table Styles */
.table-container {
    overflow-x: auto; /* For responsiveness on small screens */
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

    .data-table th, .data-table td {
        padding: 12px 15px;
        text-align: left;
        border-bottom: 1px solid var(--border-color);
        white-space: nowrap;
    }

    .data-table th {
        background-color:#f3f3f9;
        /*font-weight: 600;*/
        font-size: 0.85rem;
        color: var(--text-color);
        text-transform: uppercase;

    }
   
        .data-table tbody tr:last-child td {
        border-bottom: none;
    }

    .data-table td {
        font-size: 0.9rem;
        color: var(--text-color);
    }


/* Theme Customizer */
.theme-toggler {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--primary-text-color); /* Use dynamic text color */
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: background-color 0.3s, color 0.3s;
}

    .theme-toggler i {
        font-size: 1.8rem;
        animation: spin 3s linear infinite;
    }

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.theme-customizer {
    position: fixed;
    top: 0;
    right: -320px; /* Initially hidden */
    width: 320px;
    height: 100vh;
    background-color: var(--card-bg);
    border-left: 1px solid var(--border-color);
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    z-index: 1001;
    transition: right 0.4s ease-in-out, background-color 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
}

    .theme-customizer.open {
        right: 0;
    }

.theme-customizer-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .theme-customizer-header h3 {
        margin: 0;
        font-size: 1.1rem;
        color: var(--text-color);
    }

.close-customizer {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.theme-customizer-body {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.customizer-section {
    margin-bottom: 24px;
}

    .customizer-section h4 {
        font-size: 0.9rem;
        margin-bottom: 12px;
        color: var(--text-color);
        font-weight: 500;
    }

.layout-options, .color-scheme-options {
    display: flex;
    gap: 10px;
}

    .layout-options button, .color-scheme-options button {
        flex: 1;
        padding: 8px 15px;
        border: 1px solid var(--border-color);
        border-radius: 5px;
        background-color: transparent;
        color: var(--text-muted);
        cursor: pointer;
        transition: all 0.2s ease;
    }

        .layout-options button:hover, .color-scheme-options button:hover {
            border-color: var(--primary-color);
            color: var(--primary-color);
        }

        .layout-options button.active, .color-scheme-options button.active {
            background-color: var(--primary-color);
            color: var(--primary-text-color);
            border-color: var(--primary-color);
        }

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.color-picker-wrapper input[type="color"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 0;
    background-color: transparent;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 4px;
}


.theme-customizer-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.reset-theme {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    background-color: transparent;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

    .reset-theme:hover {
        background-color: var(--primary-color);
        color: var(--primary-text-color); /* Use dynamic text color */
    }


/* --- Modern Auth Page Layout --- */

/* --- FIX: Ensure html and body take full height --- */
html, body.auth-page {
    height: 100%;
}

.auth-page {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.auth-wrapper {
    display: flex;
    flex-grow: 1;
}

.auth-content-left {
    width: 45%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    text-align: center;
    transition: background-color 0.3s;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

    .auth-brand i {
        font-size: 3rem;
    }

    .auth-brand h1 {
        font-size: 2.5rem;
        font-weight: 700;
    }

.auth-content-left p {
    font-size: 1.1rem;
    max-width: 450px;
    opacity: 0.8;
}

.auth-content-right {
    width: 55%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background-color: var(--card-bg);
}

.auth-form-container {
    width: 100%;
    max-width: 450px;
}

.auth-header {
    text-align: left;
    margin-bottom: 2rem;
}

    .auth-header h2 {
        font-size: 2rem;
        font-weight: 600;
        color: var(--text-color);
    }

    .auth-header p {
        color: var(--text-muted);
        margin-top: 0.5rem;
    }

/* Ensure body doesn't use flex for auth pages */
body.auth-page {
    display: block;
}

/* Responsive styles for the auth page */
@media (max-width: 992px) {
    .auth-content-left {
        display: none;
    }

    .auth-content-right {
        width: 100%;
    }
}

/* Responsive Styles */
@media (max-width: 992px) {
    .sidebar {
        left: -250px;
    }

        .sidebar.open {
            left: 0;
        }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .close-sidebar {
        display: block;
    }

    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.4);
        z-index: 1001;
        display: none;
    }

        .overlay.show {
            display: block;
        }
}


.auth-page-simple {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 2rem;
}

.login-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    padding: 2.5rem;
    border: 1px solid var(--border-color);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

    .login-header h2 {
        font-size: 1.5rem;
        font-weight: 600;
        color: var(--primary-color);
    }

    .login-header p {
        color: var(--text-muted);
        font-size: 0.9rem;
    }



/* --- Modern Dashboard Card Styles --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 2fr));
    gap: 24px;
}

    .dashboard-grid .card {
        border: none;
        border-radius: 10px;
        color: white;
        position: relative;
        overflow: hidden;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        padding: 25px;
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
    }

        .dashboard-grid .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 30px rgba(0,0,0,0.2);
        }

        .dashboard-grid .card h3 {
            font-size: 0.9rem;
            font-weight: 500;
            text-transform: uppercase;
            opacity: 0.8;
            color: white;
        }

        .dashboard-grid .card h2 {
            font-size: 2.2rem;
            font-weight: 700;
            margin: 5px 0;
            color: white;
        }

        .dashboard-grid .card p {
            font-size: 0.9rem;
            opacity: 0.9;
            margin: 0;
        }

.card-icon {
    position: absolute;
    top: -20px;
    left: -20px; /* Changed from right to left */
    font-size: 100px;
    opacity: 0.15;
    transform: rotate(20deg); /* Adjusted rotation for left side */
}

/* Professional Color Palette */
.card-blue {
    background: linear-gradient(45deg, #405189, #556ee6);
}

.card-green {
    background: linear-gradient(45deg, #0ab39c, #34c38f);
}

.card-orange {
    background: linear-gradient(45deg, #f7b84b, #f9c26a);
}

.card-red {
    background: linear-gradient(45deg, #f06548, #f2836e);
}


/*New Color Palette*/

.card-purple {
    background: linear-gradient(45deg, #6f42c1, #a074e9);
}

.card-teal {
    background: linear-gradient(45deg, #20c997, #5be6c1);
}

.card-gray {
    background: linear-gradient(45deg, #6c757d, #adb5bd);
}

.card-pink {
    background: linear-gradient(45deg, #e83e8c, #f28db7);
}
.card-cyan {
    background: linear-gradient(45deg, #17a2b8, #63cdda);
}

.card-indigo {
    background: linear-gradient(45deg, #6610f2, #8e54e9);
}

.card-yellow {
    background: linear-gradient(45deg, #ffc107, #ffe082);
}

.card-navy {
    background: linear-gradient(45deg, #001f3f, #3c4b64);
}

.card-brown {
    background: linear-gradient(45deg, #795548, #a1887f);
}

.card-lime {
    background: linear-gradient(45deg, #cddc39, #d4e157);
}

.card-silver {
    background: linear-gradient(45deg, #bdc3c7, #ececec);
}


.card-black {
    background: linear-gradient(45deg, #2c2c2c, #4f4f4f);
}
/*End New Color Palette*/

/* --- Toast Notification Styles --- */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast-notification {
    background-color: #dc3545; /* Red for warnings */
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

    .toast-notification.show {
        opacity: 1;
        transform: translateX(0);
    }

    .toast-notification i {
        font-size: 1.5rem;
    }


/* --- Timeline Styles for Candidate History --- */
.timeline {
    list-style: none;
    padding: 5px 0 5px;
    position: relative;
}

    .timeline:before {
        top: 0;
        bottom: 0;
        position: absolute;
        content: " ";
        width: 3px;
        background-color: #eeeeee;
        left: 25px;
        margin-right: -1.5px;
    }

    .timeline > li {
        margin-bottom: 10px;
        position: relative;
    }

        .timeline > li:before,
        .timeline > li:after {
            content: " ";
            display: table;
        }

        .timeline > li:after {
            clear: both;
        }

        .timeline > li > .timeline-panel {
            width: calc(100% - 75px);
            float: right;
            border: 1px solid #d4d4d4;
            border-radius: 6px;
            padding: 10px;
            position: relative;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
        }

        .timeline > li > .timeline-badge {
            color: #fff;
            width: 50px;
            height: 50px;
            line-height: 50px;
            font-size: 1.4em;
            text-align: center;
            position: absolute;
            top: 16px;
            left: 0px;
            margin-right: -25px;
            background-color: #999999;
            z-index: 100;
            border-radius: 50%;
        }
/* Timeline Badge Colors */
.timeline-badge.submitted, .timeline-badge.searching {
    background-color: #556ee6 !important;
}

.timeline-badge.shortlisted, .timeline-badge.waitlisted {
    background-color: #f7b84b !important;
}

.timeline-badge.interview {
    background-color: #34c38f !important;
}

.timeline-badge.rejected, .timeline-badge.absconding {
    background-color: #f06548 !important;
}

.timeline-badge.offered, .timeline-badge.joined {
    background-color: #0ab39c !important;
}

.timeline-title {
    margin-top: 0;
    color: inherit;
}

.timeline-body > p,
.timeline-body > ul {
    margin-bottom: 0;
}

    .timeline-body > p + p {
        margin-top: 5px;
    }


/*Dashboard Notifications*/

.notif-wrapper {
    position: relative;
    display: inline-block;
}

    .notif-wrapper:hover .notif-panel,
    .notif-wrapper:focus-within .notif-panel {
        display: block;
    }

.notif-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding: 0 6px;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -2px;
    background: #f06548;
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    line-height: 16px;
    padding: 0 6px;
    min-width: 18px;
    text-align: center;
}
.notif-panel {
    position: absolute;
    right: 0;
    top: 100%; /* instead of a hard pixel like 36px */
    margin-top: 6px; /* small spacing but no dead zone */
    width: 360px;
    max-height: 420px;
    background: #fff;
    border: 1px solid var(--border-color,#e9ebec);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,.08);
    display: none;
    overflow: hidden;
    z-index: 1000;
}
    .notif-panel:hover {
        display: block;
    }

.notif-header {
    padding: 10px 12px;
    font-weight: 600;
    border-bottom: 1px solid #eee;
}

.notif-body {
    max-height: 350px;
    overflow: auto;
}

.notif-item {
    display: block;
    padding: 10px 12px;
    border-bottom: 1px solid #f3f3f3;
}

    .notif-item:hover {
        background: #f8f9fc;
    }

.notif-title {
    font-weight: 600;
}

.notif-sub {
    font-size: 12px;
    color: #6c757d;
}

.notif-footer {
    padding: 8px 12px;
    text-align: right;
    border-top: 1px solid #f3f3f3;
    background: #fafbff;
}

.notif-wrapper:hover .notif-panel {
    display: block;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -2px;
    background: #f06548;
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    line-height: 16px;
    padding: 0 6px;
    min-width: 18px;
    text-align: center;
}
/* pure CSS hover open */


/* ===== Fullscreen Loader ===== */
.app-loader {
    position: fixed;
    inset: 0;
    z-index: 9999; /* above modals/toasts */
    pointer-events: none; /* toggled when visible */
    opacity: 0;
    transition: opacity .15s ease-in-out;
}

    .app-loader.is-active {
        opacity: 1;
        pointer-events: auto;
    }

.app-loader__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.35); /* dim background */
    backdrop-filter: blur(1px);
}

.app-loader__content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: grid;
    justify-items: center;
    gap: .75rem;
    background: #fff;
    padding: 1.25rem 1.5rem;
    border-radius: .75rem;
    box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

/* Spinner (no external assets) */
.app-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid rgba(64,81,137,.15);
    border-top-color: #405189; /* your primary */
    border-radius: 50%;
    animation: appspin .9s linear infinite;
}

@keyframes appspin {
    to {
        transform: rotate(360deg);
    }
}

.app-loader__text {
    font-size: .95rem;
    color: #495057;
}
