/* ========================================
   ScrollText.io - Complete Stylesheet
   ======================================== */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    line-height: 1.5;
}

/* ===== Navigation ===== */
.navbar {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo a {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.6rem;
    font-weight: 800;
}

.logo-icon {
    font-size: 1.8rem;
}

@media (max-width: 768px) {
    .logo-icon {
        font-size: 1.4rem;
    }
    .logo-text {
        font-size: 1.2rem;
    }
}
.logo-text { color: #1a1a2e; }
.logo-accent { color: #667eea; }

.nav-menu {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-menu a {
    text-decoration: none;
    color: #4a5568;
    font-weight: 600;
    transition: color 0.2s;
    cursor: pointer;
}

.nav-menu a:hover { color: #667eea; }

.nav-lang {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.lang-btn {
    background: #edf2f7;
    border: none;
    padding: 6px 14px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.lang-btn.active {
    background: #667eea;
    color: white;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.hamburger span {
    width: 28px;
    height: 3px;
    background: #1a1a2e;
    margin: 4px 0;
    border-radius: 3px;
}

/* ===== Container & Cards ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 32px;
}

.hero {
    text-align: center;
    padding: 40px 20px;
}

.hero h1 {
    font-size: 3rem;
    background: linear-gradient(135deg, #fff 0%, #a8c0ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
}

.card {
    background: rgba(255,255,255,0.95);
    border-radius: 32px;
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

/* ===== Mode Tabs ===== */
.mode-tabs {
    display: flex;
    gap: 16px;
    margin-bottom: 28px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 12px;
}

.mode-tab {
    background: none;
    border: none;
    padding: 10px 24px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 40px;
    transition: all 0.2s;
    color: #64748b;
}

.mode-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
}

.mode-tab:hover:not(.active) {
    background: #e2e8f0;
    color: #1e293b;
}

.mode-panel {
    display: none;
}

.mode-panel.active {
    display: block;
}

/* ===== Presets Section ===== */
.presets-section {
    background: #f1f5f9;
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 24px;
}

.presets-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
    letter-spacing: 1px;
}

.presets-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.preset-btn {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 8px 18px;
    border-radius: 40px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
    color: #1e293b;
}

.preset-btn:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* ===== Preview Area ===== */
.preview-area {
    background: #f8fafc;
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 28px;
    border: 2px solid #e2e8f0;
    position: relative;
}

.preview-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    margin-bottom: 12px;
}

#creditsCanvas, #twCanvas {
    width: 100%;
    height: auto;
    background: #000;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.fullscreen-container {
    position: relative;
    width: 100%;
}

.fullscreen-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-container.fullscreen canvas {
    width: 90%;
    height: auto;
    max-height: 90vh;
}

.fullscreen-btn {
    margin-top: 12px;
    background: #334155;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.fullscreen-btn:hover {
    background: #1e293b;
}

/* ===== Controls Grid ===== */
.controls-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group.full-width {
    grid-column: span 3;
}

.control-group label {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.85rem;
}

input, select, textarea {
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    font-size: 0.95rem;
    transition: all 0.2s;
    font-family: inherit;
}

textarea {
    resize: vertical;
    font-family: 'Courier New', monospace;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

input[type="color"] {
    height: 48px;
    cursor: pointer;
    padding: 4px;
}

input[type="range"] {
    cursor: pointer;
}

.value-display {
    color: #667eea;
    font-weight: 700;
    margin-left: 6px;
}

/* ===== Export Section ===== */
.export-section {
    background: #f1f5f9;
    border-radius: 24px;
    padding: 24px;
    text-align: center;
    margin-bottom: 24px;
}

.export-section h3 {
    margin-bottom: 20px;
    color: #1e293b;
}

.export-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.export-btn {
    border: none;
    padding: 14px 24px;
    border-radius: 48px;
    cursor: pointer;
    transition: all 0.25s;
    min-width: 180px;
    font-weight: 700;
    color: white;
}

.export-gif { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.export-video { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.export-link { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }

.export-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(0,0,0,0.25);
}

.export-status {
    margin-top: 16px;
    padding: 12px;
    border-radius: 40px;
    font-weight: 600;
}

.export-status.success { background: #d4edda; color: #155724; }
.export-status.error { background: #f8d7da; color: #721c24; }
.export-status.loading { background: #fff3cd; color: #856404; }

/* ===== Donation Bar ===== */
.donation-bar {
    background: linear-gradient(135deg, #fff9e8 0%, #ffe6cc 100%);
    border-radius: 24px;
    padding: 20px;
    text-align: center;
}

.donation-bar p {
    margin-bottom: 12px;
    font-weight: 600;
    color: #7c5e2e;
}

.donate-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 28px;
    border-radius: 40px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s;
}

.donate-btn:hover {
    transform: scale(1.03);
    background: #e05555;
}

/* ===== Info Note ===== */
.info-note {
    background: #e0f2fe;
    border-radius: 20px;
    padding: 16px 20px;
    margin-top: 20px;
    border-left: 4px solid #0284c7;
}

.info-note p {
    color: #0c4a6e;
    font-size: 0.85rem;
}

/* ===== How To / FAQ / Contact ===== */
.howto-steps {
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.step {
    text-align: center;
    flex: 1;
    min-width: 200px;
    background: #f8fafc;
    padding: 24px;
    border-radius: 28px;
}

.step-num {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: bold;
    margin: 0 auto 16px;
}

.faq-item {
    margin-bottom: 16px;
    padding: 18px 24px;
    background: #f8fafc;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.faq-item:hover {
    background: #f1f5f9;
}

.faq-question {
    font-weight: 800;
    color: #1e293b;
}

.faq-answer {
    color: #475569;
    margin-top: 8px;
    display: block;
}

.contact-content {
    text-align: center;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 24px 0;
    flex-wrap: wrap;
}

.contact-links a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 20px;
    background: #f1f5f9;
    border-radius: 30px;
    transition: all 0.2s;
}

.contact-links a:hover {
    background: #667eea;
    color: white;
}

.footer {
    text-align: center;
    padding: 28px;
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
}

.footer a {
    color: white;
    text-decoration: none;
    border-bottom: 1px dotted rgba(255,255,255,0.5);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 20px;
        text-align: center;
        box-shadow: 0 10px 25px rgba(0,0,0,0.1);
        z-index: 999;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .controls-grid {
        grid-template-columns: 1fr;
    }
    
    .control-group.full-width {
        grid-column: span 1;
    }
    
    .card {
        padding: 20px;
    }
    
    .export-btn {
        min-width: 140px;
        padding: 10px 16px;
        font-size: 0.7rem;
    }
    
    .presets-grid {
        justify-content: center;
    }
    
    .mode-tabs {
        justify-content: center;
    }
    
    .mode-tab {
        padding: 6px 16px;
        font-size: 0.85rem;
    }
}