/* --- CV Builder Page Specific Styles --- */

.cv-page-wrapper {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 4rem 1.5rem 6rem 1.5rem;
    box-sizing: border-box;
}

/* Match floating bottom-nav width on desktop (nav is 60% / left-right 20%) */
@media (min-width: 768px) {
    .cv-page-wrapper {
        width: 72%;
        max-width: 1100px;
        margin-left: auto;
        margin-right: auto;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (max-width: 640px) {
    .cv-page-wrapper {
        padding: 2rem 1rem 4rem 1rem;
    }
}

.wizard-stepper {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 16px;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    -webkit-overflow-scrolling: touch;
}

.wizard-stepper::-webkit-scrollbar {
    display: none;
}

.step-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    opacity: 0.6;
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 6px 12px;
    border-radius: 50px;
}

.step-indicator:hover {
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.05);
}

.step-indicator.active {
    opacity: 1;
    font-weight: 700;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.step-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.step-indicator.active .step-num {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
}

.cv-wizard-container {
    width: 100%;
    margin-top: 1.5rem;
    box-sizing: border-box;
}

.wizard-step-content {
    display: none;
    width: 100%;
}

.wizard-step-content.active {
    display: block;
    animation: fadeInStep 0.35s ease-out;
}

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

.main-step-card {
    width: 100%;
    box-sizing: border-box;
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

@media (max-width: 768px) {
    .main-step-card {
        padding: 1.5rem 1.2rem;
    }
}

.step-heading {
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
}

.step-subheading {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.8rem;
    line-height: 1.5;
}

.form-grid-2col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.2rem;
}

@media (min-width: 640px) {
    .form-grid-2col {
        grid-template-columns: 1fr 1fr;
    }
}

.input-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.glass-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.85rem 1.1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    color: #f8fafc;
    outline: none;
    font-size: 0.92rem;
    transition: all 0.25s ease;
}

.glass-input:focus {
    border-color: #3b82f6;
    background: rgba(0, 0, 0, 0.45);
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.35);
}

.mobile-textarea {
    min-height: 120px;
    padding: 0.9rem 1.1rem;
    line-height: 1.6;
    resize: vertical;
}

.dynamic-row-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 1.4rem;
    margin-bottom: 1.2rem;
    position: relative;
    transition: all 0.25s ease;
}

.dynamic-row-card:hover {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.32);
}

.btn-delete-row {
    position: absolute;
    top: 12px;
    right: 14px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #ef4444;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-delete-row:hover {
    background: #ef4444;
    color: #ffffff;
    transform: scale(1.1);
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.4rem;
}

@media (min-width: 640px) {
    .template-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .template-grid { grid-template-columns: repeat(3, 1fr); }
}

.template-card {
    position: relative;
    border-radius: 18px;
    padding: 1.5rem 1.2rem;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    overflow: hidden;
}

.template-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, rgba(59, 130, 246, 0.15), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.template-card:hover {
    transform: translateY(-4px);
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.template-card:hover::before {
    opacity: 1;
}

.template-card.active {
    border-color: #3b82f6;
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.18), rgba(37, 99, 235, 0.05));
    box-shadow: 0 0 24px rgba(59, 130, 246, 0.3);
}

.template-icon-badge {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.1));
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1rem auto;
    transition: all 0.3s ease;
}

.template-card.active .template-icon-badge,
.template-card:hover .template-icon-badge {
    background: #3b82f6;
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    transform: scale(1.08);
}

.template-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: #ffffff;
}

.template-card p {
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.45;
}

.color-picker-flex {
    display: flex;
    gap: 14px;
    align-items: center;
}

.color-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.color-btn.active, .color-btn:hover {
    border-color: #ffffff;
    transform: scale(1.2);
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.4);
}

.step-nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
}

.quick-chips-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip-item {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.8rem;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip-item:hover {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
    transform: translateY(-2px);
}

.skill-tag-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(59, 130, 246, 0.18);
    border: 1px solid rgba(59, 130, 246, 0.4);
    padding: 5px 14px;
    border-radius: 50px;
    font-size: 0.82rem;
    color: #e2e8f0;
    margin: 4px;
}

.skill-tag-pill span {
    cursor: pointer;
    color: #f87171;
    font-weight: bold;
}

.adsense-glass-panel {
    width: 100%;
    box-sizing: border-box;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.4);
    text-align: center;
    margin: 2.5rem 0;
    clear: both;
}

.ad-tag {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 1px;
    display: block;
    margin-bottom: 0.5rem;
}

.ad-slot-wrapper {
    width: 100%;
    min-height: 90px;
    display: block;
    overflow: hidden;
}

.ad-slot-wrapper .adsbygoogle {
    display: block !important;
    width: 100%;
    min-width: 250px;
}

.canvas-preview-wrapper {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 1.5rem 0.5rem;
    border-radius: var(--radius-lg);
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
    overflow-y: visible;
}

@media (max-width: 640px) {
    .canvas-preview-wrapper {
        padding: 0.75rem 0.25rem;
    }
}

/* overflow:visible = multi-page PDF content is not clipped */
.cv-doc {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
    transition: transform 0.2s ease-out;
    overflow: visible;
    max-width: 794px;
}

.cv-doc--guides {
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 1121px,
        rgba(239, 68, 68, 0.4) 1121px,
        rgba(239, 68, 68, 0.4) 1123px,
        transparent 1123px
    );
}

#step1-canvas .cv-doc, #step1-canvas .cv-doc *,
#cv-canvas .cv-doc, #cv-canvas .cv-doc * {
    font-family: inherit;
}

.cv-doc > div {
    max-width: 100%;
    box-sizing: border-box;
}

.download-action-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 640px) {
    .download-action-grid {
        flex-direction: row;
        justify-content: center;
    }
}

.btn-lg {
    padding: 1.1rem 2rem;
    font-size: 1rem;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay.hidden { display: none; }

.modal-card {
    max-width: 420px;
    width: 100%;
    position: relative;
    padding: 2rem;
    border-radius: var(--radius-lg);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--text-muted);
    cursor: pointer;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-gap-2 {
    display: flex;
    gap: 8px;
}

.form-section-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

/* ---- Button spacing (stop buttons touching) ---- */

.step-nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.step-nav-buttons .btn-primary,
.step-nav-buttons .btn-secondary {
    margin: 0;
}

.download-action-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 640px) {
    .download-action-grid {
        flex-direction: row;
        justify-content: center;
        gap: 1.25rem;
    }
}

/* Skill add row: input + button */
.flex-gap-2,
.color-picker-flex {
    gap: 12px !important;
}

/* "Add Job / Add Cert / Add Skill" header buttons */
.flex-between {
    gap: 1rem;
    flex-wrap: wrap;
}

.flex-between .btn-glass-sm {
    margin-left: 0;
    flex-shrink: 0;
}

/* Skill input + Add Skill button row */
#inp-skill-item {
    margin-right: 0;
}

.input-group + .btn-glass-sm,
.glass-input + .btn-glass-sm {
    margin-left: 0.5rem;
}

/* Any horizontal button groups */
.d-flex.gap-2,
.action-buttons {
    gap: 0.75rem !important;
}

/* Template / color controls */
.color-picker-flex {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

/* Modal buttons stacked with space */
.modal-card .btn-primary,
.modal-card .btn-secondary {
    margin-bottom: 0.75rem;
}

.modal-card .btn-primary:last-child,
.modal-card .btn-secondary:last-child {
    margin-bottom: 0;
}
/* ---- Step 1 spacing: templates / aesthetics / Next / preview ---- */

/* Space under template cards (incl. Healthcare & Academic) before Customize Aesthetics */
.template-grid {
    margin-bottom: 2rem !important;
}

/* Extra space above Customize Aesthetic Styles card */
.main-step-card > .glass-card.p-4.rounded-xl.mb-6 {
    margin-top: 0.5rem;
    margin-bottom: 2rem !important;
}

/* Space between Next button and Instant Style Preview */
.step-nav-buttons {
    margin-top: 1.5rem;
    margin-bottom: 2rem !important;
}

#step1-preview-box {
    margin-top: 0.5rem;
    padding-top: 1.25rem;
}
