/* style.css - Final Production Version (Responsive Fixed) */

:root {
    /* --- COLOR PALETTE (Slate & Royal Blue Theme) --- */
    --primary-dark: #0f172a;   /* Slate 900 */
    --primary-main: #1e293b;   /* Slate 800 */
    --brand-color: #2563eb;    /* Royal Blue 600 */
    --brand-hover: #1d4ed8;    /* Royal Blue 700 */
    
    --bg-body: #f1f5f9;        /* Slate 100 */
    --bg-card: #ffffff;        /* Pure White */
    --bg-input: #f8fafc;       /* Slate 50 */
    
    --border-subtle: #e2e8f0;  /* Slate 200 */
    --border-focus: #2563eb;   /* Brand Color */
    
    --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 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* --- 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;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav-links a {
    color: var(--primary-main);
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    margin-left: 5px;
    text-decoration: none; 
}

.nav-links a:hover {
    background-color: #f1f5f9;
    color: var(--brand-color);
    text-decoration: none;
}

.active-link {
    color: var(--brand-color) !important;
    background-color: #eff6ff; 
    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: 15px;
}

.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; 
    background: -webkit-linear-gradient(45deg, var(--primary-dark), var(--brand-color));
    -webkit-background-clip: text;
    -webkit-text-fill-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 --- */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .nav-links {
        display: none; 
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: var(--bg-card);
        flex-direction: column;
        padding: 20px;
        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;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        display: block;
        width: 100%;
        box-sizing: border-box;
        margin: 10px 0;
        padding: 12px;
        border-radius: 8px;
        background: #f8fafc;
    }

    .user-badge {
        display: inline-block;
        margin: 0 0 15px 0;
    }

    .builder-wrapper {
        flex-direction: column;
        height: auto;
    }
    .editor-panel, .preview-panel {
        width: 100%;
        height: auto;
    }
    #resume-preview {
        width: 100%;
        zoom: 0.55; 
    }
    .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
   ========================================= */

.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;
}

.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; 
    color: #7e22ce;            
    border: 1px solid #d8b4fe;
}

.badge-user {
    background-color: #dcfce7; 
    color: #15803d;            
    border: 1px solid #bbf7d0;
}

.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; }

.modal-overlay {
    position: fixed;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6); 
    backdrop-filter: blur(4px); 
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.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);
}

.hidden {
    display: none !important;
}