/* ============================================
   AI RESUME BUILDER — Builder Page Styles
   ============================================ */

/* ============ BUILDER LAYOUT ============ */
.builder-page {
    padding-top: 80px;
    min-height: 100vh;
}

.builder-container {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 0;
    min-height: calc(100vh - 80px);
}

/* ============ STEPPER SIDEBAR ============ */
.builder-sidebar {
    background: var(--gradient-card);
    border-right: 1px solid var(--border);
    padding: 32px 24px;
    position: sticky;
    top: 80px;
    height: calc(100vh - 80px);
    overflow-y: auto;
}

.stepper {
    margin-bottom: 24px;
}

.stepper-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 4px;
    position: relative;
}

.stepper-item:hover {
    background: var(--bg-glass);
}

.stepper-item.active {
    background: transparent;
}

.stepper-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.stepper-item.completed .step-circle {
    background: var(--gradient-success);
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--bg-glass-strong);
    border: 2px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.stepper-item.active .step-circle {
    background: var(--gradient-primary);
    border-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-glow);
}

.step-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.stepper-item.active .step-label {
    color: var(--text-primary);
    font-weight: 600;
}

.stepper-item.completed .step-label {
    color: var(--success-light);
}

.step-connector {
    width: 2px;
    height: 12px;
    background: var(--border);
    margin-left: 41px;
    margin-bottom: 4px;
}

.step-connector.completed {
    background: var(--success);
}

/* ============ BUILDER MAIN ============ */
.builder-main {
    padding: 32px 40px;
}

/* ============ FORM SECTIONS ============ */
.form-section {
    display: none;
}

.form-section.active {
    display: block;
    animation: fadeInUp 0.4s ease;
}

.form-section-header {
    margin-bottom: 32px;
}

.form-section-header h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.form-section-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* Form Groups */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 15px;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary);
    background: var(--bg-glass-strong);
    box-shadow: 0 0 0 3px rgba(108, 58, 237, 0.15);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

/* ============ AI ENHANCE BUTTON ============ */
.ai-enhance-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    background: rgba(108, 58, 237, 0.15);
    border: 1px solid rgba(108, 58, 237, 0.3);
    color: var(--primary-dark);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 12px;
}

.ai-enhance-btn:hover {
    background: rgba(108, 58, 237, 0.25);
    box-shadow: 0 0 15px rgba(108, 58, 237, 0.2);
}

.ai-enhance-btn.enhancing {
    animation: pulseGlow 1.5s ease-in-out infinite;
}

/* ============ REPEATABLE ENTRIES ============ */
.entry-card {
    background: var(--bg-glass);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 16px;
    position: relative;
    transition: var(--transition);
}

.entry-card:hover {
    border-color: var(--border-light);
}

.entry-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.entry-card-header h4 {
    font-size: 16px;
}

.remove-entry-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.remove-entry-btn:hover {
    background: rgba(239, 68, 68, 0.25);
}

.add-entry-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-md);
    border: 2px dashed var(--border-light);
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}

.add-entry-btn:hover {
    border-color: var(--primary);
    color: var(--primary-light);
    background: rgba(108, 58, 237, 0.05);
}

/* ============ SKILLS TAGS ============ */
.skills-input-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    border: 1px solid var(--border);
    min-height: 50px;
    cursor: text;
}

.skill-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    background: rgba(108, 58, 237, 0.2);
    border: 1px solid rgba(108, 58, 237, 0.3);
    color: var(--primary-light);
    font-size: 13px;
    font-weight: 500;
}

.skill-tag .remove-skill {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    color: var(--text-secondary);
    border: none;
}

.skill-tag .remove-skill:hover {
    background: rgba(239, 68, 68, 0.3);
    color: white;
}

.skills-input {
    border: none !important;
    background: transparent !important;
    padding: 4px !important;
    flex: 1;
    min-width: 120px;
    color: var(--text-primary);
    font-size: 14px;
}

.skills-input:focus {
    box-shadow: none !important;
}

/* ============ PHOTO UPLOAD ============ */
.photo-upload-zone {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 3px dashed var(--border-light);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    overflow: hidden;
    position: relative;
    margin-bottom: 16px;
}

.photo-upload-zone:hover {
    border-color: var(--primary);
}

.photo-upload-zone img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
}

.photo-upload-zone .upload-icon {
    font-size: 28px;
    color: var(--text-muted);
}

.photo-upload-zone .upload-text {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============ FILE UPLOAD ============ */
.file-upload-zone {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-glass);
}

.file-upload-zone:hover {
    border-color: var(--primary);
    background: rgba(108, 58, 237, 0.05);
}

.file-upload-zone.drag-over {
    border-color: var(--primary);
    background: rgba(108, 58, 237, 0.1);
}

.file-upload-icon {
    font-size: 48px;
    color: var(--primary-light);
    margin-bottom: 16px;
}

.file-upload-zone h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.file-upload-zone p {
    font-size: 14px;
    color: var(--text-secondary);
}

.file-upload-zone .file-types {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
}

.upload-or {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 32px 0;
}

.upload-or::before,
.upload-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.upload-or span {
    color: var(--text-muted);
    font-size: 14px;
}

/* ============ SCORE DISPLAY ============ */
.score-section {
    text-align: center;
    padding: 40px 0;
}

.score-ring-container {
    width: 200px;
    height: 200px;
    margin: 0 auto 32px;
    position: relative;
}

.score-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-ring-bg {
    fill: none;
    stroke: var(--bg-glass-strong);
    stroke-width: 8;
}

.score-ring-fill {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.5s ease;
}

.score-value {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-number {
    font-family: 'Outfit', sans-serif;
    font-size: 56px;
    font-weight: 900;
    line-height: 1;
}

.score-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.score-grade {
    display: inline-block;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 14px;
    font-weight: 700;
    margin-top: 16px;
}

.score-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-width: 500px;
    margin: 32px auto 0;
}

.score-item {
    text-align: left;
}

.score-item-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.score-item-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--bg-glass-strong);
    overflow: hidden;
}

.score-item-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease;
}

/* ============ SUGGESTIONS ============ */
.suggestions-list {
    max-width: 600px;
    margin: 0 auto;
}

.suggestion-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    border: 1px solid var(--border);
    margin-bottom: 12px;
    transition: var(--transition);
}

.suggestion-card:hover {
    border-color: var(--border-light);
}

.suggestion-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.suggestion-icon.high {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-light);
}

.suggestion-icon.medium {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent);
}

.suggestion-icon.low {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-light);
}

.suggestion-text h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.suggestion-text p {
    font-size: 13px;
    color: var(--text-secondary);
}

.suggestion-apply {
    margin-left: auto;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    background: rgba(108, 58, 237, 0.15);
    color: var(--primary-light);
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.suggestion-apply:hover {
    background: rgba(108, 58, 237, 0.3);
}

/* ============ TEMPLATE SELECTOR ============ */
.template-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.template-card {
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    background: white;
}

.template-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.template-card.selected {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.template-card.selected::after {
    content: '✓';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
}

.template-card {
    position: relative;
}

.template-card-body {
    height: 300px;
    overflow: hidden;
    padding: 12px;
}

.template-card-footer {
    padding: 12px 16px;
    background: var(--gradient-card);
    border-top: 1px solid var(--border);
}

.template-card-footer h4 {
    font-size: 14px;
    color: var(--text-primary);
}

.template-card-footer p {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============ LIVE PREVIEW ============ */
.preview-container {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    aspect-ratio: 210/297;
    /* A4 */
    position: relative;
}

.preview-container .resume-content {
    padding: 40px;
    color: #1a1a1a;
    font-size: 12px;
}

/* ============ PAYMENT MODAL ============ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--navy-light);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-light);
    width: 100%;
    max-width: 460px;
    padding: 36px;
    animation: scaleIn 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h3 {
    font-size: 22px;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-glass);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    border: none;
}

.modal-close:hover {
    background: var(--bg-glass-strong);
}

.payment-amount {
    text-align: center;
    padding: 24px;
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    margin-bottom: 24px;
}

.payment-amount .amount {
    font-family: 'Outfit', sans-serif;
    font-size: 48px;
    font-weight: 800;
}

.payment-amount .amount-sub {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.payment-methods {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.payment-method {
    flex: 1;
    min-width: 100px;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-glass);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    color: var(--text-secondary);
}

.payment-method.active {
    border-color: var(--primary);
    background: rgba(108, 58, 237, 0.1);
    color: var(--primary-light);
}

.payment-method:hover {
    border-color: var(--primary-light);
}

.payment-success {
    text-align: center;
    padding: 40px 0;
    display: none;
}

.payment-success.active {
    display: block;
    animation: scaleIn 0.5s ease;
}

.payment-success .success-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 20px;
    background: var(--gradient-success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: white;
}

.payment-success h3 {
    font-size: 22px;
    margin-bottom: 8px;
}

.payment-success p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* ============ NAV BUTTONS ============ */
.builder-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1024px) {
    .builder-container {
        grid-template-columns: 1fr;
    }

    .builder-sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 100;
        padding: 12px 16px;
        border-top: 1px solid var(--border);
        border-right: none;
        background: rgba(3, 7, 18, 0.95);
        backdrop-filter: blur(20px);
    }

    .stepper {
        display: flex;
        gap: 0;
        margin-bottom: 0;
        overflow-x: auto;
    }

    .step-connector {
        display: none;
    }

    .stepper-item {
        flex-direction: column;
        padding: 8px 12px;
        min-width: 60px;
    }

    .step-circle {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .step-label {
        font-size: 10px;
        text-align: center;
    }

    .builder-main {
        padding: 20px 16px;
        padding-bottom: 100px;
        max-height: none;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .template-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .score-breakdown {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .template-grid {
        grid-template-columns: 1fr;
    }

    .builder-main {
        padding: 16px 12px;
        padding-bottom: 100px;
    }
}