/* ============================================
   ResumeForge - Main Stylesheet
   ============================================ */

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #818cf8;
    --accent: #06b6d4;
    --accent-dark: #0891b2;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #0f172a;
    --dark-2: #1e293b;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 12px 24px rgba(0,0,0,.06);
    --shadow-lg: 0 10px 25px rgba(0,0,0,.1), 0 20px 48px rgba(0,0,0,.08);
    --transition: all .2s ease;
}

/* ---- Base ---- */
* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--dark);
    background: var(--gray-50);
    line-height: 1.6;
    padding-top: 72px;
}

h1, h2, h3, h4, h5 {
    font-weight: 700;
    line-height: 1.3;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; }

/* ---- Navbar ---- */
.bg-navbar {
    background: rgba(15, 23, 42, .95) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.navbar-brand {
    font-size: 1.25rem;
    letter-spacing: -.02em;
}

.navbar .nav-link {
    font-size: .9rem;
    font-weight: 500;
    padding: .5rem .85rem !important;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    background: rgba(255,255,255,.1);
}

.btn-accent {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-accent:hover {
    background: var(--accent-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6,182,212,.35);
}

/* ---- Buttons ---- */
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79,70,229,.35);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
    border-radius: var(--radius-sm);
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.btn-outline-secondary {
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.btn-danger {
    border-radius: var(--radius-sm);
    font-weight: 600;
}

/* ---- Cards ---- */
.card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-glass {
    background: rgba(255,255,255,.8);
    backdrop-filter: blur(8px);
}

/* ---- Hero Section ---- */
.hero-section {
    background: linear-gradient(135deg, var(--dark) 0%, #1a1a4e 50%, var(--primary-dark) 100%);
    color: #fff;
    padding: 6rem 0 5rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(6,182,212,.15) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(129,140,248,.1) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-section .container { position: relative; z-index: 1; }

.hero-title {
    font-size: 3.2rem;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.15;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: rgba(255,255,255,.7);
    max-width: 540px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 50px;
    padding: .4rem 1rem;
    font-size: .85rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 1.5rem;
}

/* ---- Feature Cards ---- */
.feature-card {
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: var(--radius);
    background: #fff;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.feature-icon.purple { background: rgba(79,70,229,.1); color: var(--primary); }
.feature-icon.cyan { background: rgba(6,182,212,.1); color: var(--accent); }
.feature-icon.green { background: rgba(16,185,129,.1); color: var(--success); }
.feature-icon.orange { background: rgba(245,158,11,.1); color: var(--warning); }

/* ---- Dashboard ---- */
.resume-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: #fff;
    padding: 1.5rem;
    transition: var(--transition);
    position: relative;
}

.resume-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.resume-card .badge-type {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: .3rem .6rem;
    border-radius: 6px;
}

.resume-card .badge-professional {
    background: rgba(79,70,229,.1);
    color: var(--primary);
}

.resume-card .badge-fresh {
    background: rgba(16,185,129,.1);
    color: var(--success);
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state i {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: 1rem;
}

/* ---- Builder Wizard ---- */
.wizard-progress {
    display: flex;
    justify-content: center;
    gap: .25rem;
    padding: 1.5rem 0;
    flex-wrap: wrap;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem 1rem;
    border-radius: 50px;
    font-size: .82rem;
    font-weight: 500;
    color: var(--gray-400);
    background: var(--gray-100);
    border: 2px solid transparent;
    transition: var(--transition);
    cursor: pointer;
    white-space: nowrap;
}

.wizard-step.active {
    color: var(--primary);
    background: rgba(79,70,229,.08);
    border-color: var(--primary);
}

.wizard-step.completed {
    color: var(--success);
    background: rgba(16,185,129,.08);
    border-color: var(--success);
}

.wizard-step .step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    background: var(--gray-200);
    color: var(--gray-500);
}

.wizard-step.active .step-num {
    background: var(--primary);
    color: #fff;
}

.wizard-step.completed .step-num {
    background: var(--success);
    color: #fff;
}

.wizard-panel {
    display: none;
    animation: fadeIn .3s ease;
}

.wizard-panel.active {
    display: block;
}

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

/* ---- Form Styles ---- */
.form-control, .form-select {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: .6rem .85rem;
    font-size: .9rem;
    transition: var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

.form-label {
    font-weight: 600;
    font-size: .85rem;
    color: var(--gray-700);
    margin-bottom: .35rem;
}

.form-text {
    font-size: .8rem;
    color: var(--gray-400);
}

/* ---- Repeater Section ---- */
.repeater-item {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    margin-bottom: 1rem;
    position: relative;
}

.repeater-item .btn-remove {
    position: absolute;
    top: .75rem;
    right: .75rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(239,68,68,.1);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    cursor: pointer;
    transition: var(--transition);
}

.repeater-item .btn-remove:hover {
    background: var(--danger);
    color: #fff;
}

.btn-add-item {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--gray-500);
    font-weight: 500;
    padding: .75rem;
    width: 100%;
    transition: var(--transition);
    cursor: pointer;
}

.btn-add-item:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(79,70,229,.04);
}

/* ---- Tips Panel ---- */
.tips-panel {
    background: linear-gradient(135deg, rgba(79,70,229,.04), rgba(6,182,212,.04));
    border: 1px solid rgba(79,70,229,.12);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.tips-panel h6 {
    color: var(--primary);
    font-size: .85rem;
    font-weight: 700;
    margin-bottom: .75rem;
}

.tips-panel ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tips-panel li {
    font-size: .82rem;
    color: var(--gray-600);
    padding: .25rem 0;
    padding-left: 1.25rem;
    position: relative;
}

.tips-panel li::before {
    content: '\F26A';
    font-family: 'bootstrap-icons';
    position: absolute;
    left: 0;
    color: var(--success);
    font-size: .7rem;
}

/* ---- Resume Type Selector ---- */
.type-card {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.type-card:hover {
    border-color: var(--primary-light);
    background: rgba(79,70,229,.02);
}

.type-card.selected {
    border-color: var(--primary);
    background: rgba(79,70,229,.05);
    box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}

.type-card .type-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: .75rem;
}

/* ---- Template Selector ---- */
.template-option {
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.template-option:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.template-option.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}

.template-option .template-preview {
    height: 180px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.template-option .template-name {
    padding: .75rem;
    text-align: center;
    font-weight: 600;
    font-size: .85rem;
    background: #fff;
}

/* ---- Preview Page ---- */
.preview-container {
    background: var(--gray-200);
    padding: 2rem;
    border-radius: var(--radius);
    min-height: 600px;
    display: flex;
    justify-content: center;
}

.resume-page {
    width: 210mm;
    min-height: 297mm;
    max-height: 297mm;
    background: #fff;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
}

/* ---- Profile Image ---- */
.profile-img-upload {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px dashed var(--gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition);
    background: var(--gray-50);
}

.profile-img-upload:hover {
    border-color: var(--primary);
    background: rgba(79,70,229,.04);
}

.profile-img-upload img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---- Guidance Panel ---- */
.guidance-banner {
    background: linear-gradient(135deg, rgba(16,185,129,.08), rgba(6,182,212,.08));
    border: 1px solid rgba(16,185,129,.2);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.guidance-banner i {
    color: var(--success);
}

/* ---- Utilities ---- */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.section-title i {
    color: var(--primary);
}

.divider {
    height: 1px;
    background: var(--gray-200);
    margin: 1.5rem 0;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ---- Responsive ---- */
@media (max-width: 991px) {
    .hero-title { font-size: 2.2rem; }
    .wizard-progress { gap: .15rem; }
    .wizard-step { padding: .4rem .7rem; font-size: .75rem; }
}

@media (max-width: 767px) {
    .hero-title { font-size: 1.8rem; }
    .hero-section { padding: 4rem 0 3rem; }
    .resume-page { width: 100%; min-height: auto; max-height: none; }
    .preview-container { padding: 1rem; }
    .wizard-step span.step-label { display: none; }
}

/* ---- Loading Spinner ---- */
.spinner-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    display: none;
}

.spinner-overlay.show { display: flex; }
