/* Inner Echo - Styles */

:root {
    --bg: #0d0d0f;
    --surface: #1a1a1f;
    --border: #2a2a30;
    --text: #e8e8ed;
    --text-muted: #8888aa;
    --accent: #a78bfa;
    --accent-hover: #c4b5fd;
    --success: #6ee7b7;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 640px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.tagline {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Form */
.generator-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-group label {
    font-size: 0.95rem;
    color: var(--text-muted);
}

textarea,
select,
input[type="email"],
input[type="text"] {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    width: 100%;
}

textarea:focus,
select:focus,
input[type="email"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
}

textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

/* Duration Slider */
.duration-selector {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.duration-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: var(--surface);
    border-radius: 4px;
    outline: none;
    border: 1px solid var(--border);
}

.duration-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.duration-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.duration-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.duration-display {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 1.25rem;
}

.duration-display #duration-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text);
}

.price-display {
    color: var(--accent);
    font-weight: 500;
}

.price-display #price-value {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Tone Options */
.tone-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tone-option {
    cursor: pointer;
}

.tone-option input {
    display: none;
}

.tone-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    transition: all 0.2s ease;
}

.tone-card strong {
    display: block;
    margin-bottom: 0.25rem;
}

.tone-card small {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.tone-option input:checked + .tone-card {
    border-color: var(--accent);
    background: rgba(167, 139, 250, 0.1);
}

.tone-option:hover .tone-card {
    border-color: var(--accent);
}

/* Form Row (side by side) */
.form-row {
    display: flex;
    gap: 1.5rem;
}

.form-group.half {
    flex: 1;
}

/* Toggle Buttons */
.toggle-group {
    display: flex;
    gap: 0.5rem;
}

.toggle-btn {
    flex: 1;
    cursor: pointer;
}

.toggle-btn input {
    display: none;
}

.toggle-btn span {
    display: block;
    text-align: center;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.toggle-btn input:checked + span {
    border-color: var(--accent);
    background: rgba(167, 139, 250, 0.15);
    color: var(--accent);
}

.toggle-btn:hover span {
    border-color: var(--accent);
}

@media (max-width: 480px) {
    .form-row {
        flex-direction: column;
        gap: 1.5rem;
    }
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    transition: all 0.2s ease;
}

.checkbox-label:hover {
    border-color: var(--accent);
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: "✓";
    color: var(--bg);
    font-size: 14px;
    font-weight: bold;
}

.checkbox-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.checkbox-text strong {
    font-size: 0.95rem;
}

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

/* Button */
.generate-btn,
.btn-primary,
.btn-secondary {
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 8px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.generate-btn:hover,
.btn-primary:hover {
    background: var(--accent-hover);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.generate-btn.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    border-color: var(--accent);
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.note {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Result Page */
.result-page {
    text-align: center;
}

.result-page h2 {
    font-weight: 400;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.download-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.download-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s ease;
}

.download-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.download-card .icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.download-card h3 {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.download-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.preview {
    text-align: left;
    margin-bottom: 2rem;
}

.script-preview {
    background: var(--surface);
    border-radius: 8px;
    padding: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
}

.actions {
    margin-top: 2rem;
}

/* Error Page */
.error-page {
    text-align: center;
}

.error-box {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    color: #fca5a5;
}

/* Footer */
footer {
    margin-top: 4rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 480px) {
    .download-cards {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 2rem;
    }
}
