/* Blog Post Generator v2 - Sascha Fitness */

:root {
    --primary: hsl(260, 70%, 60%);
    --primary-hover: hsl(260, 70%, 55%);
    --secondary: hsl(200, 70%, 55%);
    --success: hsl(140, 60%, 50%);
    --danger: hsl(0, 70%, 60%);
    --warning: hsl(45, 90%, 55%);

    --bg-primary: hsl(240, 20%, 10%);
    --bg-secondary: hsl(240, 15%, 14%);
    --bg-tertiary: hsl(240, 12%, 18%);

    --text-primary: hsl(0, 0%, 95%);
    --text-secondary: hsl(0, 0%, 70%);
    --text-muted: hsl(0, 0%, 50%);

    --border: hsl(240, 10%, 25%);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);

    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, hsl(260, 20%, 12%) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 2rem;
    line-height: 1.6;
}

.container { max-width: 900px; margin: 0 auto; }

header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

header p { color: var(--text-secondary); font-size: 1.1rem; }

/* Workflow */
.workflow { display: flex; flex-direction: column; gap: 0; }

.step {
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    transition: var(--transition);
    position: relative;
}

.step:not(.disabled) {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.step.disabled { opacity: 0.5; pointer-events: none; }
.step.completed { border-color: var(--success); opacity: 1; }

.step-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }

.step-number {
    width: 48px; height: 48px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; font-weight: 700; flex-shrink: 0; color: white;
}

.step.completed .step-number {
    background: linear-gradient(135deg, var(--success), hsl(140, 60%, 60%));
}

.step-header h2 { flex: 1; font-size: 1.5rem; font-weight: 600; }

.status-badge {
    padding: 0.4rem 1rem; border-radius: 20px;
    font-size: 0.85rem; font-weight: 500;
    background: var(--bg-tertiary); color: var(--text-secondary);
}
.status-badge.active { background: var(--primary); color: white; }
.status-badge.completed { background: var(--success); color: white; }

.step-content { padding-left: 64px; }

.step-connector {
    width: 3px; height: 40px;
    background: var(--border); margin: 0 auto 0 46px;
}

/* Form Elements */
.form-group { margin-bottom: 1.5rem; }

.form-group label {
    display: block; margin-bottom: 0.5rem;
    color: var(--text-secondary); font-weight: 500; font-size: 0.95rem;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 0.875rem 1rem;
    background: var(--bg-tertiary); border: 2px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-size: 1rem; transition: var(--transition); font-family: inherit;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.text-muted { color: var(--text-muted); font-size: 0.85rem; }

/* Buttons */
.btn {
    padding: 0.875rem 1.75rem; border: none; border-radius: var(--radius-sm);
    font-size: 1rem; font-weight: 600; cursor: pointer;
    transition: var(--transition); display: inline-flex;
    align-items: center; gap: 0.5rem; font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), hsl(260, 70%, 65%));
    color: white;
}
.btn-primary:hover {
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-tertiary); color: var(--text-primary);
    border: 2px solid var(--border);
}
.btn-secondary:hover { border-color: var(--primary); }

.btn-success {
    background: linear-gradient(135deg, var(--success), hsl(140, 60%, 55%));
    color: white;
}
.btn-success:hover {
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.3);
    transform: translateY(-2px);
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.button-group { display: flex; gap: 1rem; margin-top: 1rem; flex-wrap: wrap; }

/* Loading Spinner */
.loading { text-align: center; padding: 2rem; }

.spinner {
    width: 48px; height: 48px;
    border: 4px solid var(--bg-tertiary); border-top-color: var(--primary);
    border-radius: 50%; animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading p { color: var(--text-secondary); }

/* Pillar Cards */
.pillar-cards {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.pillar-card {
    background: var(--bg-tertiary); border: 2px solid var(--border);
    border-radius: var(--radius-sm); padding: 1.25rem;
    cursor: pointer; transition: var(--transition);
    text-align: center;
}

.pillar-card:hover { border-color: var(--primary); }

.pillar-card.selected {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.15);
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.2);
}

.pillar-card .pillar-icon { font-size: 2rem; margin-bottom: 0.5rem; }

.pillar-card .pillar-name {
    font-weight: 600; font-size: 0.95rem; margin-bottom: 0.25rem;
}

.pillar-card .pillar-desc {
    font-size: 0.8rem; color: var(--text-muted); line-height: 1.4;
}

/* Intent Selector */
.intent-selector { display: flex; gap: 1rem; }

.intent-option {
    display: flex; align-items: center; gap: 0.5rem;
    cursor: pointer; padding: 0.5rem 1rem;
    background: var(--bg-tertiary); border: 2px solid var(--border);
    border-radius: var(--radius-sm); transition: var(--transition);
    font-size: 0.9rem; color: var(--text-secondary);
}

.intent-option:has(input:checked) {
    border-color: var(--primary); color: var(--text-primary);
    background: rgba(139, 92, 246, 0.1);
}

.intent-option input { accent-color: var(--primary); }

/* Keyword Chips */
.keyword-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.keyword-chip {
    padding: 0.4rem 0.9rem; background: var(--bg-tertiary);
    border: 1px solid var(--border); border-radius: 20px;
    font-size: 0.85rem; color: var(--text-secondary);
    cursor: pointer; transition: var(--transition);
    user-select: none;
}

.keyword-chip:hover { border-color: var(--primary); color: var(--text-primary); }

.keyword-chip.selected {
    background: rgba(139, 92, 246, 0.2); border-color: var(--primary);
    color: var(--primary);
}

/* Ideas List */
.ideas-list { display: flex; flex-direction: column; gap: 1rem; }

.idea-card {
    background: var(--bg-tertiary); border: 2px solid var(--border);
    border-radius: var(--radius-sm); padding: 1.5rem;
    cursor: pointer; transition: var(--transition);
}

.idea-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.15);
}

.idea-card.selected {
    border-color: var(--primary); background: rgba(139, 92, 246, 0.1);
}

.idea-card h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.idea-card p { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 0.75rem; }

.idea-keywords { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.keyword-tag {
    padding: 0.25rem 0.75rem; background: var(--bg-secondary);
    border-radius: 12px; font-size: 0.85rem; color: var(--text-secondary);
}

.pillar-tag {
    padding: 0.25rem 0.75rem; border-radius: 12px; font-size: 0.8rem;
    background: rgba(139, 92, 246, 0.2); color: var(--primary); font-weight: 500;
}

/* Duplicate Result */
.duplicate-result {
    padding: 1.5rem; background: var(--bg-tertiary); border-radius: var(--radius-sm);
}

.duplicate-status { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }

.duplicate-icon {
    width: 56px; height: 56px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 2rem;
}
.duplicate-icon.unique { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.duplicate-icon.warning { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.duplicate-icon.similar { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

.duplicate-info h3 { font-size: 1.25rem; margin-bottom: 0.25rem; }
.similarity-score { font-size: 1.5rem; font-weight: 700; color: var(--primary); }

/* Outline Preview */
.outline-preview {
    background: var(--bg-tertiary); border-radius: var(--radius-sm);
    padding: 1.5rem; margin-top: 1rem;
}

.outline-hook {
    padding: 1rem; background: rgba(139, 92, 246, 0.1);
    border-left: 4px solid var(--primary); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 1rem;
}

.outline-hook .hook-type {
    font-size: 0.8rem; color: var(--primary); font-weight: 600;
    text-transform: uppercase; margin-bottom: 0.25rem;
}

.outline-section {
    padding: 0.75rem 0; border-bottom: 1px solid var(--border);
}
.outline-section:last-child { border-bottom: none; }

.outline-h2 {
    font-size: 1.05rem; font-weight: 600; margin-bottom: 0.5rem;
    display: flex; align-items: center; gap: 0.5rem;
}

.outline-h2 .kw-badge {
    font-size: 0.7rem; padding: 0.15rem 0.5rem;
    background: rgba(34, 197, 94, 0.2); color: var(--success);
    border-radius: 10px;
}

.outline-h3 {
    padding-left: 1.5rem; color: var(--text-secondary);
    font-size: 0.9rem; margin: 0.25rem 0;
}

.outline-words {
    font-size: 0.8rem; color: var(--text-muted); padding-left: 1.5rem;
}

.outline-faq { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.outline-faq h4 { font-size: 0.95rem; color: var(--primary); margin-bottom: 0.5rem; }

.outline-faq-item {
    padding: 0.4rem 0; font-size: 0.9rem; color: var(--text-secondary);
}

/* Post Preview */
.post-preview {
    background: var(--bg-tertiary); border-radius: var(--radius-sm);
    padding: 1.5rem; max-height: 500px; overflow-y: auto;
}

.post-meta {
    margin-bottom: 1rem; padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.post-meta h3 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.post-meta .meta-desc { color: var(--text-secondary); font-size: 0.95rem; }

/* Quality Scores */
.quality-scores {
    display: grid; grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem; margin-top: 1rem;
}

.score-card {
    background: var(--bg-tertiary); border-radius: var(--radius-sm);
    padding: 1rem; text-align: center;
}

.score-card .score-value {
    font-size: 1.75rem; font-weight: 700; margin-bottom: 0.25rem;
}
.score-card .score-value.high { color: var(--success); }
.score-card .score-value.medium { color: var(--warning); }
.score-card .score-value.low { color: var(--danger); }

.score-card .score-label {
    font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase;
}

.quality-issues { margin-top: 1rem; }

.issue-card {
    display: flex; align-items: flex-start; gap: 0.75rem;
    padding: 0.75rem; background: var(--bg-tertiary);
    border-radius: var(--radius-sm); margin-bottom: 0.5rem;
    border-left: 3px solid var(--border);
}
.issue-card.high { border-left-color: var(--danger); }
.issue-card.medium { border-left-color: var(--warning); }
.issue-card.low { border-left-color: var(--secondary); }

.issue-card .issue-detail { font-size: 0.9rem; color: var(--text-secondary); }
.issue-card .issue-location { font-size: 0.8rem; color: var(--text-muted); }

/* Tabs */
.tab-group {
    display: flex; gap: 0; margin-bottom: 1rem;
    border-bottom: 2px solid var(--border);
}

.tab {
    padding: 0.75rem 1.5rem; background: none; border: none;
    color: var(--text-secondary); font-size: 0.95rem; font-weight: 500;
    cursor: pointer; transition: var(--transition); font-family: inherit;
    border-bottom: 2px solid transparent; margin-bottom: -2px;
}

.tab:hover { color: var(--text-primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Export Content */
.export-content {
    background: var(--bg-tertiary); border-radius: var(--radius-sm);
    padding: 1.5rem; max-height: 500px; overflow-y: auto;
}

.export-content pre {
    white-space: pre-wrap; word-wrap: break-word;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.85rem; line-height: 1.6;
    color: var(--text-secondary);
}

.shopify-field {
    margin-bottom: 1rem; padding: 1rem;
    background: var(--bg-secondary); border-radius: var(--radius-sm);
}

.shopify-field label {
    display: block; font-size: 0.8rem; color: var(--primary);
    text-transform: uppercase; font-weight: 600; margin-bottom: 0.5rem;
}

.shopify-field .field-value {
    font-size: 0.95rem; color: var(--text-primary);
    word-wrap: break-word;
}

/* Toast */
.toast {
    position: fixed; bottom: 2rem; right: 2rem;
    padding: 1rem 1.5rem; border-radius: var(--radius-sm);
    background: var(--success); color: white; font-weight: 500;
    box-shadow: var(--shadow); transform: translateY(100px);
    opacity: 0; transition: var(--transition); z-index: 2000;
}

.toast.show { transform: translateY(0); opacity: 1; }

/* Modal */
.modal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(8px);
    z-index: 1000; padding: 2rem;
}

.modal.active { display: flex; align-items: center; justify-content: center; }

.modal-content {
    background: var(--bg-secondary); border-radius: var(--radius);
    padding: 2rem; max-width: 900px; width: 100%;
    max-height: 90vh; overflow-y: auto; position: relative;
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute; top: 1rem; right: 1rem;
    font-size: 2rem; cursor: pointer; color: var(--text-secondary);
    transition: var(--transition);
}
.modal-close:hover { color: var(--text-primary); }

/* Rendered post content in modal */
.modal-content h1 { font-size: 2rem; margin: 1.5rem 0 1rem; }
.modal-content h2 { font-size: 1.5rem; margin: 1.5rem 0 0.75rem; color: var(--primary); }
.modal-content h3 { font-size: 1.25rem; margin: 1rem 0 0.5rem; }
.modal-content p { margin-bottom: 1rem; color: var(--text-secondary); line-height: 1.8; }
.modal-content ul, .modal-content ol { margin: 0.5rem 0 1rem 1.5rem; color: var(--text-secondary); }
.modal-content li { margin-bottom: 0.5rem; }
.modal-content strong { color: var(--text-primary); }

.placeholder {
    color: var(--text-muted); font-style: italic;
    text-align: center; padding: 2rem;
}

/* Editable Outline Fields */
.editable {
    outline: none;
    border-bottom: 1px dashed var(--border);
    padding: 2px 4px;
    border-radius: 2px;
    transition: var(--transition);
    min-width: 100px;
    display: inline-block;
}

.editable:hover {
    border-bottom-color: var(--primary);
    background: rgba(139, 92, 246, 0.05);
}

.editable:focus {
    border-bottom-color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
    box-shadow: 0 2px 0 var(--primary);
}

.outline-edit-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-style: italic;
}

/* Publish Confirmation */
.publish-confirmation {
    display: flex; align-items: center; gap: 1rem;
    margin-top: 1.5rem; padding: 1.25rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: var(--radius-sm);
}

.publish-confirmation .confirmation-icon {
    width: 48px; height: 48px; border-radius: 50%;
    background: rgba(34, 197, 94, 0.2); color: var(--success);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; flex-shrink: 0;
}

.publish-confirmation strong { color: var(--success); font-size: 1.05rem; }
.publish-confirmation p { color: var(--text-secondary); font-size: 0.9rem; margin-top: 0.25rem; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* Responsive */
@media (max-width: 768px) {
    .pillar-cards { grid-template-columns: 1fr; }
    .intent-selector { flex-direction: column; }
    .quality-scores { grid-template-columns: repeat(3, 1fr); }
    .step-content { padding-left: 0; padding-top: 1rem; }
    .button-group { flex-direction: column; }
}
