/* style_main.css - Final Production Version (Responsive Fixed) */

:root {
    /* --- PREMIUM COLOR PALETTE --- */
    --primary-dark: #0a0f1d;   /* Deep Executive Navy */
    --primary-main: #1e293b;   /* Slate 800 */
    --brand-color: #0ea5e9;    /* Premium Cyan/Teal */
    --brand-hover: #0284c7;    /* Deep Cyan */
    
    --bg-body: #f8fafc;        /* Ultra-light Slate */
    --bg-card: #ffffff;        /* Pure White */
    --bg-input: #f1f5f9;       /* Slate 100 */
    
    --border-subtle: rgba(226, 232, 240, 0.8); 
    --border-focus: #0ea5e9;   
    
    --success-bg: #dcfce7;
    --success-text: #14532d;
    --error-bg: #fee2e2;
    --error-text: #7f1d1d;
    
    --font-main: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    
    --shadow-sm: 0 2px 4px rgba(10, 15, 29, 0.02);
    --shadow-md: 0 10px 30px -5px rgba(10, 15, 29, 0.05);
    --shadow-lg: 0 20px 40px -10px rgba(10, 15, 29, 0.08);
}

/* --- 1. GLOBAL RESET --- */
body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--primary-dark);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--brand-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--brand-hover);
    text-decoration: underline;
}

/* --- 2. HEADER & NAVIGATION --- */
header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0; 
    position: sticky;
    top: 0;
    left: 0;  /* FIX: Lock to left edge */
    right: 0; /* FIX: Lock to right edge */
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    width: 100%; 
    box-sizing: border-box; /* FIX: Prevents padding from breaking width */
}

/* FIX: Force navigation into a perfect, vertically-centered row */
.nav-links {
    display: flex;
    align-items: center;
    gap: 12px; /* Uses uniform gap instead of staggered margins */
}

.nav-links a {
    color: var(--primary-main);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none; 
    /* margin-left removed; let flex gap handle it perfectly */
}

.nav-links a:hover {
    background-color: #f1f5f9;
    color: var(--brand-color);
    text-decoration: none;
}

/* FIX: Prevent the Sign Up button from disappearing into the white background on hover */
.nav-links a.cta-button:hover {
    background-color: var(--brand-hover) !important;
    color: #ffffff !important;
}

/* Active Link Highlight */
.active-link {
    color: var(--brand-color) !important;
    background-color: #eff6ff !important; 
    font-weight: 700 !important;
}

.user-badge {
    background-color: #eff6ff;
    color: var(--brand-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid #dbeafe;
    /* margin-right removed; let flex gap handle it perfectly */
}

/* MOBILE MENU BUTTON (Default Hidden on Desktop) */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-main);
    cursor: pointer;
    padding: 10px;
}

/* --- 3. TYPOGRAPHY & BUTTONS --- */
h1, h2, h3, h4 {
    color: var(--primary-dark);
    margin-top: 0;
    font-weight: 700;
    letter-spacing: -0.025em; 
}

.cta-button {
    background-color: var(--brand-color);
    color: white !important;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    display: inline-block;
    text-decoration: none;
    font-size: 1rem;
}

.cta-button:hover {
    background-color: var(--brand-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.cta-button:active {
    transform: translateY(0);
}

/* --- 4. FORMS --- */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 85vh;
    padding: 20px;
}

.auth-container {
    background: var(--bg-card);
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-subtle);
}

.auth-title {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    text-align: center;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-main);
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    background-color: var(--bg-input);
    font-size: 1rem;
    color: var(--primary-dark);
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: var(--font-main);
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2); 
    background-color: #fff;
}

.form-group {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}
.alert-error {
    background-color: var(--error-bg);
    color: var(--error-text);
    border: 1px solid #fecaca;
}
.alert-success {
    background-color: var(--success-bg);
    color: var(--success-text);
    border: 1px solid #bbf7d0;
}

/* --- 5. BUILDER LAYOUT --- */
.builder-wrapper {
    display: flex;
    height: calc(100vh - 71px); 
    overflow: hidden;
    background: var(--bg-body);
}

.editor-panel {
    width: 40%; 
    padding: 30px;
    overflow-y: auto;
    background: var(--bg-card);
    border-right: 1px solid var(--border-subtle);
    box-shadow: 2px 0 10px rgba(0,0,0,0.05); 
    z-index: 10;
}

.preview-panel {
    width: 60%;
    padding: 40px;
    background-color: #334155; 
    overflow-y: auto;
    display: flex;
    justify-content: center;
}

/* --- 6. RESUME PAPER STYLES --- */
#resume-preview {
    width: 210mm;
    min-height: 297mm;
    background: white;
    border: 1px solid #000; 
    padding: 15mm; 
    margin: 0 auto;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    box-sizing: border-box;
    font-family: 'Times New Roman', serif; 
    color: #000;
    font-size: 11pt;
    line-height: 1.5;
}

.resume-header {
    text-align: center;
    margin-bottom: 20px;
}

.resume-name {
    font-size: 18pt;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.resume-contact {
    font-size: 10pt;
    margin-bottom: 20px;
}

.section-title {
    font-size: 12pt;
    font-weight: bold;
    text-transform: uppercase;
    border-bottom: 1px solid #000;
    margin-top: 15px;
    margin-bottom: 10px;
    padding-bottom: 2px;
}

.skill-row {
    display: flex;
    margin-bottom: 5px;
}
.skill-label {
    font-weight: bold;
    width: 180px; 
    flex-shrink: 0;
}

.personal-details-table {
    width: 100%;
    border-collapse: collapse;
}
.personal-details-table td {
    padding: 3px 0;
    vertical-align: top;
}
.pd-label {
    font-weight: bold;
    width: 150px;
}

.resume-ul {
    margin: 5px 0;
    padding-left: 20px;
}
.resume-ul li {
    margin-bottom: 3px;
}

/* --- 7. LANDING PAGE & CARDS --- */
.hero-section {
    background: white;
    padding: 100px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-subtle);
}

.hero-title {
    font-size: 3.5rem; 
    /* FIX: Added standard properties so it doesn't break into a solid background block on non-webkit browsers */
    background: linear-gradient(45deg, var(--primary-dark), var(--brand-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    margin-bottom: 1.5rem;
}

.steps-container {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 80px 20px;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.step-card {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-subtle);
    width: 300px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.step-card h3 {
    color: var(--brand-color);
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

/* --- 8. RESPONSIVENESS & MOBILE MENU (FIXED) --- */
@media (max-width: 768px) {
    /* Show Hamburger Button */
    .mobile-menu-btn {
        display: block;
    }

    /* Hide nav links by default, style for dropdown */
    .nav-links {
        display: none; /* Hidden */
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: var(--bg-card);
        flex-direction: column;
        padding: 20px;
        
        /* FIX: Prevents horizontal scrolling */
        box-sizing: border-box; 
        
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        border-bottom: 1px solid var(--border-subtle);
        text-align: center;
        z-index: 999;
    }

    /* Show links when 'active' class is added via JS */
    .nav-links.active {
        display: flex;
    }

.nav-links a {
        display: block;
        width: 100%;
        
        /* FIX: Prevents links from pushing width */
        box-sizing: border-box;
        
        margin: 10px 0;
        padding: 12px;
        border-radius: 8px;
        background: #f8fafc;
    }

    /* FIX: Force the Sign Up button to stay blue on mobile dropdowns! */
    .nav-links a.cta-button {
        background-color: var(--brand-color);
        color: white !important;
    }
    
    .nav-links a.cta-button:hover {
        background-color: var(--brand-hover);
    }

    .user-badge {
        display: inline-block;
        margin: 0 0 15px 0;
    }

/* Builder Layout Stack */
    .builder-wrapper {
        flex-direction: column;
        height: auto;
    }
    
    /* NEW: Sticky Bottom Navigation for Mobile */
    #form-nav-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        margin: 0 !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-top: 1px solid var(--border-subtle);
        box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
        z-index: 9999;
        display: flex;
        flex-direction: row;
        padding: 12px 15px !important;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    /* Hide the title text on mobile to save space for the action buttons */
    #form-nav-bar h2, #step-indicator {
        display: none !important;
    }

    /* Add padding to the bottom of the form so the sticky bar doesn't cover the last input */
    .wizard-step {
        padding-bottom: 85px !important; 
    }
    .editor-panel, .preview-panel {
        width: 100%;
        height: auto;
    }
    #resume-preview {
        width: 100%;
        zoom: 0.55; /* Shrink paper for mobile */
    }
    .hero-title {
        font-size: 2.5rem;
    }
}

@media print {
    body * { visibility: hidden; }
    #resume-preview, #resume-preview * { visibility: visible; }
    #resume-preview {
        position: absolute;
        left: 0;
        top: 0;
        margin: 0;
        padding: 0;
        box-shadow: none;
        border: none;
    }
    h3, h4, li, p { page-break-inside: avoid; }
}

/* =========================================
   ADMIN USER MANAGEMENT STYLES
   ========================================= */

/* --- 1. User Table Styling --- */
.user-table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.user-table {
    width: 100%;
    border-collapse: collapse;
}

.user-table th {
    background-color: #f8fafc;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 16px;
    text-align: left;
    border-bottom: 2px solid var(--border-subtle);
}

.user-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--primary-main);
    vertical-align: middle;
}

.user-table tr:hover {
    background-color: #f8fafc;
}

/* --- 2. Role Badges --- */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-admin {
    background-color: #f3e8ff; /* Light Purple */
    color: #7e22ce;            /* Dark Purple */
    border: 1px solid #d8b4fe;
}

.badge-user {
    background-color: #dcfce7; /* Light Green */
    color: #15803d;            /* Dark Green */
    border: 1px solid #bbf7d0;
}

/* --- 3. Action Buttons --- */
.btn-action {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-reset {
    background-color: #eff6ff;
    color: #2563eb;
}
.btn-reset:hover { background-color: #dbeafe; }

.btn-delete {
    background-color: #fef2f2;
    color: #dc2626;
}
.btn-delete:hover { background-color: #fee2e2; }

/* --- 4. Password Reset Modal (Critical) --- */
.modal-overlay {
    position: fixed;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6); /* Dark dimming */
    backdrop-filter: blur(4px); /* Modern blur effect */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    
    /* Animation */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* When the 'hidden' class is REMOVED, we override it to show */
.modal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal-box {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay:not(.hidden) .modal-box {
    transform: scale(1);
}

/* Helper to hide elements */
.hidden {
    display: none !important;
}

/* --- GUEST UPGRADE POPOVER --- */
#guest-upgrade-msg {
    position: absolute;
    top: 100%; /* Puts it exactly below the button */
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 320px;
    margin-top: 15px;
    z-index: 50; /* Keeps it above the other boxes */
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: popIn 0.2s ease-out forwards;
}



/* =========================================
   PREMIUM CUSTOM SCROLLBARS (PC)
   ========================================= */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Hide scrollbar completely in the preview panel for a cleaner edge-to-edge look */
.preview-panel::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}





@keyframes popIn {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}