/*
 * KYMJOJOBS Agent Dashboard - Professional Fintech UI
 * Version: 2.2 - Final & Complete
 */

/* ==========================================================================
   1. Design Language: Fonts, Colors & Base Styles
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* START: REPLACE THE TOP OF YOUR CSS FILE WITH THIS */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ==========================================================================
   1. COLOR & THEME DEFINITIONS
   ========================================================================== */

/* Define the variables that change between modes */
:root {
    --card-bg: #FFFFFF;         /* Light Mode: White cards */
    --text-primary: #1c1e21;     /* Light Mode: Dark text */
    --text-secondary: #65676b;   /* Light Mode: Grey text */
    --border-color: #e0e0e0;     /* Light Mode: Light border */
    --hover-bg: #f5f5f5;         /* Light Mode: Light grey hover */
}

/* Define the variables for when .dark-mode is active on the container */
.dark-mode {
    --card-bg: var(--primary-card-bg); /* Dark Mode: Your original dark card color */
    --text-primary: #FFFFFF;       /* Dark Mode: White text */
    --text-secondary: #a0b3d1;     /* Dark Mode: Light grey text */
    --border-color: rgba(255, 255, 255, 0.1); /* Dark Mode: Faint white border */
    --hover-bg: #2a4970;           /* Dark Mode: A slightly lighter dark hover */
}

/* Define variables that DO NOT change (the constants) */
:root {
    --primary-dark-bg: #0A2540;   /* This is your main background, it will NOT change */
    --primary-card-bg: #163356;  /* This is your base dark card color */
    --accent-green: #00D084;
    --accent-blue: #0A84FF;
    --accent-danger: #FF4C4C;
    --transition-fast: all 0.2s ease-in-out;
}


.kymjojobs-full-screen-page,
.kymjojobs-full-screen-page body,
.kymjojobs-agent-app-container {
    background-color: var(--primary-dark-bg); /* This ALWAYS stays dark */
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

.kymjojobs-full-screen-page .site-header,
.kymjojobs-full-screen-page .site-footer,
.kymjojobs-full-screen-page #sidebar {
    display: none !important;
}


/* ADD THIS AT THE BOTTOM OF your CSS file */

/* --- Professional Theme Toggle Switch --- */
.theme-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 26px;
}

.theme-switch .slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

.theme-switch input:checked + .slider {
  background-color: var(--accent-blue);
}

.theme-switch input:checked + .slider:before {
  transform: translateX(24px);
}

/* Hide the old Font Awesome icons */
.theme-switch .slider i {
  display: none;
}

/* ==========================================================================
   2. Main App Layout (Sidebar & Content)
   ========================================================================== */
.kymjojobs-agent-app-container {
    display: flex;
    min-height: 100vh;
}

.agent-sidebar {
    width: 260px;
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease-in-out;
}

.agent-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.agent-page-content {
    padding: 2rem;
}

/* ==========================================================================
   3. Sidebar & Header Components
   ========================================================================== */
.sidebar-header { margin-bottom: 2.5rem; display: flex; align-items: center; color: #fff; }
.sidebar-header i { font-size: 2rem; margin-right: 0.75rem; color: var(--accent-blue); }
.sidebar-header h1 { font-size: 1.5rem; font-weight: 600; }

.sidebar-nav { flex-grow: 1; }
.sidebar-nav .nav-item { display: flex; align-items: center; padding: 0.9rem 1rem; margin: 0.5rem 0; border-radius: 8px; text-decoration: none; color: var(--text-secondary); transition: var(--transition-fast); }
.sidebar-nav .nav-item:hover, .sidebar-nav .nav-item.active { background-color: var(--card-bg); color: var(--text-primary); }
.sidebar-nav .nav-item i { margin-right: 1rem; font-size: 1.2rem; width: 25px; }
.sidebar-nav .nav-item-logout { margin-top: auto; }

.agent-main-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; padding: 0 2rem; height: 80px; }
.agent-main-header h1 { font-size: 2rem; font-weight: 700; color: var(--text-primary); }
.hamburger-button { display: none; }
.header-controls { display: flex; align-items: center; gap: 1.5rem; margin-left: auto; }

/* ==========================================================================
   4. Dashboard & Recruitment Page Common Styles
   ========================================================================== */
.kymjojobs-agent-dashboard h1, .kymjojobs-recruitment-page h1 { font-size: 28px; color: #fff; margin-bottom: 20px; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
.recruitment-section h2 { font-size: 2rem; font-weight: 600; text-align: center; color: #fff; margin-bottom: 2.5rem; }
.button, .cta-button, .button-primary { display: inline-block; background: var(--accent-blue); color: #fff; padding: 12px 24px; border-radius: 8px; text-decoration: none; font-weight: 600; border: none; cursor: pointer; }
.button-secondary { display: inline-flex; align-items: center; gap: 0.5rem; background-color: var(--primary-card-bg); color: var(--text-primary); padding: 8px 15px; border-radius: 6px; text-decoration: none; font-weight: 500; font-size: 14px; border: 1px solid var(--border-color); transition: var(--transition-fast); }
.button-secondary:hover { background-color: #334155; }

/* Stat Cards */
.agent-stats-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
/* REPLACE WITH THIS RULE */
/* FIND THIS RULE */
/* REPLACE WITH THIS NEW RULE */
/* REPLACE THE OLD .stat-card RULE WITH THIS */

.stat-card {
    background-color: var(--card-bg) !important; /* Forces the background color to change */
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}
.stat-card:hover { transform: translateY(-5px); border-color: rgba(255, 255, 255, 0.3); }
.stat-card h3 { margin-top: 0; font-size: 14px; color: var(--text-secondary); text-transform: uppercase; font-weight: 500; }
.stat-card p { font-size: 2rem; font-weight: 700; color: var(--text-primary); margin: 0.5rem 0 0; }


/* ADD THIS CODE AT THE BOTTOM OF YOUR CSS FILE */

/* --- Fix for Recruitment Page Text Colors --- */

/* This fixes general paragraphs like "Complete the form..." and "Have a question..." */
.recruitment-section p {
    color: var(--text-secondary);
}

/* This fixes form labels like "How you plan to promote our services:" */
.agent-application-form .form-row label {
    color: var(--text-primary);
}

/* Action Area */
.agent-actions-area { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.payout-section, .referral-link-section { background: var(--card-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid var(--border-color); border-radius: 12px; padding: 1.5rem; box-shadow: var(--card-shadow); }
.payout-section h3, .referral-link-section h3 { font-size: 1.2rem; margin-top: 0; margin-bottom: 1rem; color: #fff; }
.form-row { margin-bottom: 1rem; }
.form-row label { display: block; margin-bottom: 0.5rem; font-weight: 500; }
.radio-group { display: flex; gap: 1rem; }
.payout-section input[type="number"], .payout-section input[type="password"], .payout-section input[type="text"] { width: 100%; background: rgba(0,0,0,0.2); border: 1px solid var(--border-color); color: #fff; padding: 10px; border-radius: 6px; }
.referral-link-section input[type="text"] { width: 100%; padding: 10px; border: 1px solid var(--border-color); border-radius: 4px; background-color: rgba(0,0,0,0.2); color: #fff; }

/* Tables & Performance Hub */
.agent-main-tables { background: var(--card-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border: 1px solid var(--border-color); border-radius: 12px; padding: 1.5rem; box-shadow: var(--card-shadow); }
.hub-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.hub-header h3 { font-size: 1.3rem; margin: 0; color: #fff; }
.agent-filters-form { display: flex; gap: 10px; margin-bottom: 20px; align-items: center; flex-wrap: wrap; }
.agent-filters-form input, .agent-filters-form select { background: rgba(0,0,0,0.2); border: 1px solid var(--border-color); color: #fff; padding: 8px 12px; border-radius: 4px; }
.tab-navigation { display: flex; border-bottom: 1px solid var(--border-color); margin-bottom: 1.5rem; }
.tab-link { background: none; border: none; padding: 0.75rem 1.5rem; cursor: pointer; font-weight: 500; color: var(--text-secondary); border-bottom: 3px solid transparent; }
.tab-link.active { color: var(--accent-blue); border-bottom-color: var(--accent-blue); }
.tab-content { display: none; } .tab-content.active { display: block; }
.agent-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.agent-table th, .agent-table td { text-align: left; padding: 12px; border-bottom: 1px solid var(--border-color); }
.agent-table th { color: var(--text-secondary); font-weight: 600; }
.agent-table tbody tr:hover { background-color: rgba(255,255,255,0.05); }
.status-active { color: var(--accent-green); } .status-inactive { color: var(--accent-danger); }
.commission-amount { color: var(--accent-green); }

/* Recruitment Page */
.hero-section { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; padding: 2rem; }
.hero-content .subtitle { font-size: 1.1rem; color: var(--text-secondary); margin: 1rem 0; }
.value-prop-section, .calculator-section, .application-section { margin-top: 4rem; }
.value-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.value-card { background: var(--card-bg); backdrop-filter: var(--glass-blur); border: 1px solid var(--border-color); padding: 2rem; border-radius: 12px; box-shadow: var(--card-shadow); text-align: center; }
.value-card i { font-size: 2.5rem; color: var(--accent-blue); margin-bottom: 1rem; }
.calculator-widget { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; align-items: center; margin-top: 1.5rem; background: var(--card-bg); padding: 2rem; border-radius: 12px; border: 1px solid var(--border-color); }
.calculator-results { text-align: center; }
.calculator-results p { margin-top: 0; font-weight: 500; }
.calculator-results h3 { font-size: 2.5rem; color: var(--accent-green); margin: 0.5rem 0; }
.agent-application-form textarea, .agent-application-form input[type="tel"] { width: 100%; background: var(--card-bg); border: 1px solid var(--border-color); color: #fff; padding: 10px; border-radius: 6px; }
.checkbox-row { display: flex; align-items: center; gap: 10px; }
.checkbox-row a { color: var(--accent-blue); }

/* Notifications Panel */
.notifications-wrapper { position: relative; }
.notification-bell-button { background: none; border: none; font-size: 1.25rem; color: var(--text-secondary); cursor: pointer; position: relative; padding: 5px; }
.notification-dot { position: absolute; top: 0; right: 0; background: var(--accent-danger); color: white; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.notifications-panel { display: none; position: absolute; top: 150%; right: 0; width: 350px; background: #fff; border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,0.15); z-index: 1001; overflow: hidden; }
.notifications-panel.is-visible { display: block; }
.notifications-panel .panel-header { padding: 1rem; font-weight: 600; border-bottom: 1px solid #eee; }
.notification-item { display: block; padding: 1rem; text-decoration: none; border-bottom: 1px solid #eee; transition: var(--transition-fast); }
.notification-item:hover { background-color: #f5f7fa; }
.notification-item.is-unread { font-weight: 600; }
.notification-message { color: var(--text-dark); font-size: 0.9rem; }
.notification-time { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.notification-empty { padding: 2rem; text-align: center; color: var(--text-muted); }

/* ==========================================================================
   6. Dark Mode
   ========================================================================== */
.dark-mode-placeholder { /* This is now handled by the main app styles */ }

/* ==========================================================================
   7. Mobile Responsiveness
   ========================================================================== */
@media (max-width: 992px) {
    .kymjojobs-agent-app-container { padding-bottom: 70px; }
    .agent-sidebar { display: none; }
    .hamburger-button { display: block; }
    .mobile-bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 70px; background: rgba(22, 51, 86, 0.8); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); border-top: 1px solid var(--border-color); justify-content: space-around; align-items: center; z-index: 1000; }
    .mobile-nav-item { display: flex; flex-direction: column; align-items: center; color: var(--text-secondary); text-decoration: none; font-size: 0.75rem; }
    .mobile-nav-item.active { color: var(--accent-blue); }
    .mobile-nav-item i { font-size: 1.5rem; margin-bottom: 4px; }
    .agent-page-content, .agent-main-header { padding: 1.5rem; }
    .hero-section, .calculator-widget, .agent-actions-area { grid-template-columns: 1fr; }
}



/* ==========================================================================
   FINAL INTERACTIVITY STYLES
   ========================================================================== */

/* This hides all main views by default */
.view-container {
    display: none;
}

/* This shows only the view that has the 'active' class */
.view-container.active {
    display: block;
    /* Adds a nice fade-in animation */
    animation: fadeInUp 0.5s ease-in-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* This is the style that makes the sidebar slide in on mobile */
@media (max-width: 992px) {
    
    .agent-sidebar {
        /* This positions the sidebar off-screen to the left */
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 1001; /* Make sure it appears above other content */
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        
        /* This makes sure it is visible when it slides in */
        display: flex;
        flex-direction: column;
    }

    .agent-sidebar.is-open {
        transform: translateX(0);
    }
}


/* Styling for new contact buttons */
.contact-buttons-wrapper {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* Styling for new social share buttons */
.social-share-buttons {
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.social-share-buttons .button-secondary {
    background-color: #2a4970; /* A slightly different shade */
}

/* Styling for new manual referral form */
.manual-referral-section {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.manual-referral-section h3 {
    margin-top: 0;
    color: var(--text-primary);
}

.manual-referral-form input[type="text"] {
    width: 100%;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 10px;
    border-radius: 6px;
}



/* ADD THIS AT THE BOTTOM OF agent-dashboard.css */

/* --- Pricing Page Styles --- */
.pricing-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}
.pricing-header h1 {
    font-size: 2rem;
    color: var(--text-primary);
    margin: 0;
}
.price-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.price-section h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.price-section p {
    margin-top: 0;
    margin-bottom: 1.5rem;
}
.pricing-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-secondary);
}
.pricing-table th, .pricing-table td {
    text-align: left;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.pricing-table thead th {
    color: var(--text-primary);
    font-weight: 600;
}
.pricing-table tbody tr:hover {
    background-color: rgba(0,0,0,0.02);
}
.dark-mode .pricing-table tbody tr:hover {
    background-color: rgba(255,255,255,0.05);
}

/* ADD THIS AT THE BOTTOM OF your CSS file */

/* --- Styles for Response Messages (Success/Error) --- */

.agent-notice {
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    font-weight: bold; /* Makes the text bold as you requested */
    border-left: 5px solid;
}

/* --- Light Mode Styles --- */
.agent-notice-success {
    background-color: #D4EDDA; /* Light green background */
    border-color: #28a745;      /* Dark green border/accent */
    color: #155724;            /* Dark green text */
}

.agent-notice-error {
    background-color: #F8D7DA; /* Light red background */
    border-color: #dc3545;      /* Dark red border/accent */
    color: #721c24;            /* Dark red text */
}


/* --- Dark Mode Overrides --- */
.dark-mode .agent-notice-success {
    background-color: #1c3b2f;         /* A dark, muted green background */
    border-color: var(--accent-green); /* The bright green from your theme */
    color: #a7eec2;                    /* A light, readable green text */
}

.dark-mode .agent-notice-error {
    background-color: #4d1d24;        /* A dark, muted red background */
    border-color: var(--accent-danger); /* The bright red from your theme */
    color: #f7baba;                   /* A light, readable red text */
}








/* ADD THIS AT THE BOTTOM of agent-dashboard.css */

/* ==========================================================================
   8. EXTRA RESPONSIVENESS FOR SMALLER PHONES (e.g., below 576px)
   ========================================================================== */

@media (max-width: 576px) {
    /* Adjust main page padding for smaller screens */
    .agent-page-content, .agent-main-header {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Make header title smaller to prevent wrapping */
    .agent-main-header h1 {
        font-size: 1.5rem;
    }

    /* Stack stat cards into a single column with less gap */
    .agent-stats-bar {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Reduce padding inside cards to save space */
    .stat-card, .payout-section, .referral-link-section, .manual-referral-section, .agent-main-tables, .price-section {
        padding: 1rem;
    }

    /* Make fonts inside cards a bit smaller */
    .stat-card p {
        font-size: 1.75rem;
    }

    /* Ensure form buttons are full width for easy tapping */
    .payout-section .button-primary, .manual-referral-form .button-primary {
        width: 100%;
        text-align: center;
    }

    /* Stack radio buttons vertically for easier selection */
    .radio-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    /* Improve spacing on mobile nav bar */
    .mobile-bottom-nav {
        justify-content: space-evenly;
    }
}