/* Auto Generator - Sascha Fitness */
/* Reuses CSS variables from style.css (linked first in auto.html) */

/* Top Navigation */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nav-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    gap: 0;
    padding: 0 2rem;
}

.nav-link {
    padding: 0.875rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Push body down for fixed nav */
body {
    padding-top: 4.5rem;
}

/* Phases */
.phase {
    animation: fadeIn 0.4s ease;
}

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

/* Phase 1: Launch */
.launch-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    gap: 1.5rem;
    text-align: center;
}

.btn-launch {
    padding: 1.25rem 3rem;
    font-size: 1.25rem;
    font-weight: 700;
    border: none;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary), hsl(260, 70%, 65%));
    color: white;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    box-shadow: 0 4px 24px rgba(139, 92, 246, 0.25);
}

.btn-launch:hover {
    box-shadow: 0 8px 40px rgba(139, 92, 246, 0.4);
    transform: translateY(-3px);
}

.btn-launch:active {
    transform: translateY(0);
}

.launch-desc {
    max-width: 480px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.launch-link {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--transition);
}

.launch-link:hover {
    color: var(--primary);
}

/* Phase 2: Progress */
.progress-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    max-width: 560px;
    margin: 4rem auto;
}

.progress-steps {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0.4;
    transition: opacity 0.4s ease;
}

.progress-step.active,
.progress-step.done {
    opacity: 1;
}

.pstep-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
    font-weight: 700;
    border: 2px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-muted);
    transition: all 0.3s ease;
}

/* Spinner for active step */
.progress-step.active .pstep-icon {
    border-color: var(--primary);
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
    background: transparent;
    color: transparent;
}

/* Checkmark for done step */
.progress-step.done .pstep-icon {
    border-color: var(--success);
    background: var(--success);
    color: white;
    animation: none;
}

.progress-step.done .pstep-icon::after {
    content: '\2713';
    font-size: 0.8rem;
}

.pstep-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.progress-step.active .pstep-label {
    color: var(--text-primary);
}

.progress-step.done .pstep-label {
    color: var(--success);
}

.progress-hint {
    margin-top: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Phase 3: Review */

/* Pipeline Card */
.pipeline-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.pipeline-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.pipeline-row:last-child {
    margin-bottom: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-pillar {
    color: white;
}

.badge-pillar[data-pillar="entrenamientos"] { background: hsl(210, 55%, 55%); }
.badge-pillar[data-pillar="nutricion"] { background: hsl(155, 50%, 48%); }
.badge-pillar[data-pillar="estilo_vida"] { background: hsl(35, 55%, 52%); }
.badge-pillar[data-pillar="educacion_fitness"] { background: hsl(330, 50%, 55%); }

.badge-intent {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.badge-score {
    font-weight: 700;
    font-size: 0.85rem;
}

.badge-score.improved {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.badge-score.same {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.kw-chip {
    padding: 0.25rem 0.65rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.pipeline-idea-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.pipeline-idea-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: 0.25rem;
}

.pipeline-detail {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pipeline-detail strong {
    color: var(--text-secondary);
}

/* Review Section */
.review-section {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.review-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.edit-title-input {
    font-size: 1.4rem;
    font-weight: 700;
    padding: 0.75rem 1rem;
}

.edit-meta-input {
    font-size: 0.95rem;
}

/* Content Tabs */
.content-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border-bottom: 2px solid var(--border);
}

.content-tabs .tab {
    padding: 0.625rem 1.25rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.content-tabs .tab:hover {
    color: var(--text-primary);
}

.content-tabs .tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.content-panel {
    margin-top: 0;
}

.edit-content-textarea {
    width: 100%;
    min-height: 600px;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Fira Code', 'Consolas', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    resize: vertical;
    transition: var(--transition);
}

.edit-content-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.html-preview {
    min-height: 600px;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border: 2px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    overflow-y: auto;
    line-height: 1.8;
    color: var(--text-secondary);
}

.html-preview h1 { font-size: 2rem; margin: 1.5rem 0 1rem; color: var(--text-primary); }
.html-preview h2 { font-size: 1.5rem; margin: 1.5rem 0 0.75rem; color: var(--primary); }
.html-preview h3 { font-size: 1.25rem; margin: 1rem 0 0.5rem; color: var(--text-primary); }
.html-preview p { margin-bottom: 1rem; }
.html-preview ul, .html-preview ol { margin: 0.5rem 0 1rem 1.5rem; }
.html-preview li { margin-bottom: 0.5rem; }
.html-preview strong { color: var(--text-primary); }

/* Review Actions */
.review-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

/* Export Panel */
.export-panel {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
    animation: fadeIn 0.4s ease;
}

/* Toast override for error */
.toast.error {
    background: var(--danger);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-inner {
        padding: 0 1rem;
    }

    .nav-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    body {
        padding-top: 4rem;
    }

    .launch-card {
        min-height: 40vh;
    }

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

    .progress-card {
        padding: 1.5rem;
        margin: 2rem auto;
    }

    .pipeline-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .review-actions {
        flex-direction: column;
    }

    .edit-content-textarea {
        min-height: 400px;
    }

    .html-preview {
        min-height: 400px;
    }

    .edit-title-input {
        font-size: 1.1rem;
    }
}
