/* ============================
   Stream Overlay Generator - Styles
   ============================ */

:root {
    --bg-primary: #0e0e10;
    --bg-secondary: #18181b;
    --bg-tertiary: #1f1f23;
    --text-primary: #efeff1;
    --text-secondary: #adadb8;
    --text-muted: #848494;
    --accent-primary: #9146ff;
    --accent-secondary: #772ce8;
    --accent-hover: #a970ff;
    --accent-subtle: rgba(145, 70, 255, 0.15);
    --border-color: #2f2f35;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --transition-fast: 0.15s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--space-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--space-sm);
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color var(--transition-fast);
}

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

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: var(--space-xl);
    flex: 1;
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Input Section */
.input-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.form-group label svg {
    color: var(--accent-primary);
}

.form-group input[type="text"] {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Overlay Type Buttons */
.overlay-types {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

.overlay-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md) var(--space-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.overlay-type-btn .type-icon {
    font-size: 1.5rem;
}

.overlay-type-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.overlay-type-btn.active {
    background: var(--accent-subtle);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Size Presets */
.size-presets {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.size-btn {
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.size-btn.active {
    background: var(--accent-subtle);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* Color Pickers */
.color-pickers {
    display: flex;
    gap: var(--space-md);
}

.color-picker-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

.color-picker-item input[type="color"] {
    width: 50px;
    height: 40px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    background: none;
}

.color-picker-item input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.color-picker-item input[type="color"]::-webkit-color-swatch {
    border-radius: 6px;
    border: 2px solid var(--border-color);
}

.color-picker-item span {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Color Themes */
.color-themes {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.theme-btn {
    width: 32px;
    height: 32px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    padding: 2px;
    background: var(--bg-tertiary);
    transition: all var(--transition-fast);
}

.theme-btn:hover {
    border-color: var(--text-primary);
    transform: scale(1.1);
}

.theme-btn span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

/* Range Slider */
input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent-primary);
    border-radius: 50%;
    cursor: pointer;
}

/* Toggle Switch */
.toggle-group {
    margin-top: var(--space-sm);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    font-size: 0.85rem;
}

.toggle-label input {
    display: none;
}

.toggle-switch {
    width: 44px;
    height: 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    position: relative;
    transition: all var(--transition-fast);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.toggle-label input:checked+.toggle-switch {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.toggle-label input:checked+.toggle-switch::after {
    left: 22px;
    background: white;
}

/* Preview Section */
.preview-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.preview-wrapper {
    background: repeating-conic-gradient(#2a2a2e 0% 25%, #1f1f23 0% 50%) 50% / 16px 16px;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-sm);
    max-width: 100%;
    overflow: auto;
}

#overlay-canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.size-info {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Download Button */
.download-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-bottom: var(--space-md);
}

.download-btn:hover {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-primary));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.help-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent-primary);
}

.help-text strong {
    color: var(--accent-primary);
}

/* FAQ & Footer */
.faq-section {
    margin-top: var(--space-xl);
    padding: var(--space-xl);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.faq-section h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
    text-align: center;
}

.faq-item {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.faq-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.faq-item h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.faq-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.footer {
    margin-top: var(--space-xl);
    padding: var(--space-lg) 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer a {
    color: var(--accent-primary);
    text-decoration: none;
}


/* SEO Guide Section */
.seo-guide {
    max-width: 900px;
    margin: 4rem auto;
    padding: 0 1.5rem;
    color: var(--text-secondary);
}

.seo-guide h2 {
    color: var(--text-primary);
    font-size: 2rem;
    margin: 3rem 0 1.5rem;
    text-align: center;
}

.seo-guide h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
}

.seo-guide p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    line-height: 1.8;
}

.seo-guide ul,
.seo-guide ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.seo-guide li {
    margin-bottom: 0.75rem;
    font-size: 1.05rem;
}

.seo-guide a {
    color: var(--accent-primary);
    text-decoration: none;
}

.seo-guide a:hover {
    text-decoration: underline;
}

.seo-guide strong {
    color: var(--text-primary);
}

.guide-highlight {
    background: var(--bg-secondary);
    border-left: 4px solid var(--accent-primary);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 12px 12px 0;
}