/* AI Tools Hub - Dark Theme, Mobile-First */
:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-card: #1e2130;
    --bg-input: #252837;
    --text-primary: #e4e6f0;
    --text-secondary: #8b8fa3;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --border: #2d3041;
    --radius: 12px;
    --radius-sm: 8px;
}

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

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

.container { max-width: 800px; margin: 0 auto; padding: 0 16px; }

/* Navbar */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; }
.logo { color: var(--accent); text-decoration: none; font-weight: 700; font-size: 1.2rem; }
.nav-links { display: flex; gap: 16px; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.nav-links a:hover { color: var(--text-primary); }

/* Hero */
.hero { text-align: center; padding: 48px 0 32px; }
.hero h1 { font-size: 2rem; margin-bottom: 8px; }
.hero p { color: var(--text-secondary); font-size: 1.1rem; max-width: 500px; margin: 0 auto; }

/* Tool Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    padding: 24px 0;
}
.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text-primary);
    display: block;
}
.tool-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.1);
}
.tool-card .icon { font-size: 2.5rem; margin-bottom: 12px; }
.tool-card h3 { font-size: 1rem; margin-bottom: 4px; }
.tool-card p { color: var(--text-secondary); font-size: 0.85rem; }

/* Tool Page */
.tool-page { padding: 32px 0; }
.tool-page h1 { font-size: 1.8rem; margin-bottom: 8px; }
.tool-page .subtitle { color: var(--text-secondary); margin-bottom: 24px; }

/* Upload Area */
.upload-area {
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 16px;
}
.upload-area:hover, .upload-area.dragover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.05);
}
.upload-area .icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.5; }
.upload-area p { color: var(--text-secondary); }
.upload-area .browse { color: var(--accent); font-weight: 600; }
.upload-area input[type="file"] { display: none; }

/* Input */
.input-group { margin-bottom: 16px; }
.input-group label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 0.9rem; }

input[type="text"], input[type="url"], textarea, select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
}
textarea { min-height: 120px; resize: vertical; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { background: var(--border); cursor: not-allowed; }
.btn-secondary { background: var(--bg-input); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); }

/* Results */
.result-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 16px;
}
.result-box.success { border-color: var(--success); }
.result-box.error { border-color: var(--error); }

/* File list */
.file-list { margin: 12px 0; }
.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-input);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.file-item:hover {
    border-color: var(--accent);
}
.file-item .file-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}
.file-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.file-item .size { color: var(--text-secondary); font-size: 0.8rem; flex-shrink: 0; }
.file-item .remove { color: var(--error); cursor: pointer; margin-left: 8px; font-size: 1.2rem; flex-shrink: 0; opacity: 0.7; transition: opacity 0.2s; }
.file-item .remove:hover { opacity: 1; }

/* Upload area has-file state */
.upload-area.has-file {
    border-color: var(--success);
    border-style: solid;
    background: rgba(34, 197, 94, 0.05);
}
.upload-area.has-file .icon {
    opacity: 0.3;
}
.upload-area.has-file p {
    color: var(--success);
}

/* Format options */
.format-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.format-btn {
    padding: 8px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}
.format-btn:hover { border-color: var(--accent); color: var(--accent); }
.format-btn.selected { border-color: var(--accent); background: rgba(99, 102, 241, 0.1); color: var(--accent); }

/* Video preview */
.video-preview {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    text-align: left;
}
.video-preview img { width: 160px; border-radius: var(--radius-sm); object-fit: cover; }
.video-preview .info h3 { font-size: 1rem; margin-bottom: 4px; }
.video-preview .info p { color: var(--text-secondary); font-size: 0.85rem; }

/* Progress */
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    overflow: hidden;
    margin: 12px 0;
}
.progress-bar .fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s;
    width: 0%;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Animated Progress Bar */
.progress-animated {
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
    margin: 16px 0;
}
.progress-animated .fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #7c3aed, var(--accent));
    background-size: 200% 100%;
    border-radius: 3px;
    animation: progressShimmer 1.5s ease-in-out infinite;
    width: 100%;
}
@keyframes progressShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Processing overlay */
.processing-overlay {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    margin: 12px 0;
    color: var(--accent);
    font-weight: 500;
}
.processing-overlay .spinner {
    flex-shrink: 0;
}

/* AI Score */
.ai-score {
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    margin: 16px 0;
}
.ai-score.red { color: var(--error); }
.ai-score.orange { color: var(--warning); }
.ai-score.yellow { color: #eab308; }
.ai-score.green { color: var(--success); }

.verdict { text-align: center; font-size: 1.2rem; font-weight: 600; margin-bottom: 16px; }

/* Breakdown bars */
.breakdown { margin: 16px 0; }
.breakdown-item { margin-bottom: 8px; }
.breakdown-item label { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 4px; }
.breakdown-bar { height: 6px; background: var(--bg-input); border-radius: 3px; overflow: hidden; }
.breakdown-bar .fill { height: 100%; border-radius: 3px; transition: width 0.5s; }

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 24px 0;
    margin-top: 48px;
    text-align: center;
}
.footer p { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 8px; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.footer-links a { color: var(--text-secondary); text-decoration: none; font-size: 0.8rem; }
.footer-links a:hover { color: var(--text-primary); }

/* Responsive */
@media (max-width: 640px) {
    .hero h1 { font-size: 1.5rem; }
    .tools-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .tool-card { padding: 16px; }
    .tool-card .icon { font-size: 2rem; }
    .video-preview { flex-direction: column; }
    .video-preview img { width: 100%; }
    .nav-links { gap: 10px; font-size: 0.8rem; }
}

/* TTS Hero Card — Star of the Show */
.tts-hero-card {
    margin: 0 0 24px 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #7c3aed 100%);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3);
    transition: all 0.3s;
}
.tts-hero-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.45);
}
.tts-hero-link {
    text-decoration: none;
    color: white;
    display: block;
    padding: 28px 32px;
}
.tts-hero-content {
    display: flex;
    align-items: center;
    gap: 24px;
}
.tts-hero-icon {
    font-size: 3.5rem;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
.tts-hero-info {
    flex: 1;
}
.tts-hero-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 4px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.tts-hero-desc {
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.4;
}
.tts-hero-cta {
    flex-shrink: 0;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 8px;
    padding: 12px 28px;
    font-weight: 700;
    font-size: 1.05rem;
    transition: all 0.2s;
    white-space: nowrap;
}
.tts-hero-card:hover .tts-hero-cta {
    background: rgba(255,255,255,0.35);
    border-color: rgba(255,255,255,0.8);
}

@media (max-width: 640px) {
    .tts-hero-link { padding: 20px 16px; }
    .tts-hero-content { flex-direction: column; text-align: center; gap: 12px; }
    .tts-hero-icon { font-size: 2.5rem; }
    .tts-hero-title { font-size: 1.3rem; }
    .tts-hero-cta { padding: 10px 24px; }
}

/* Hidden */
.hidden { display: none !important; }

/* Error text */
.error-text { color: var(--error); font-size: 0.85rem; margin-top: 4px; }
.success-text { color: var(--success); font-size: 0.85rem; margin-top: 4px; }

/* ===== DONATION BOX (Spotlight Minimal) ===== */
.donation-box {
    background: linear-gradient(135deg, rgba(15,15,30,0.95) 0%, rgba(20,20,40,0.95) 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 16px;
    padding: 24px 20px;
    text-align: center;
    margin: 40px auto;
    max-width: 440px;
    position: relative;
    overflow: hidden;
}

.donation-glow {
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: 16px;
    background: linear-gradient(45deg, 
        transparent 0%, 
        rgba(139, 92, 246, 0.1) 25%, 
        rgba(236, 72, 153, 0.1) 50%, 
        rgba(139, 92, 246, 0.1) 75%, 
        transparent 100%
    );
    background-size: 300% 300%;
    animation: glow-rotate 6s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes glow-rotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.donation-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.donation-badge {
    display: inline-block;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(236, 72, 153, 0.15) 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #a78bfa;
    text-transform: uppercase;
}

.donation-text {
    font-size: 0.9rem;
    color: #c4c4d4;
    line-height: 1.4;
}

.donation-text strong {
    color: #fff;
    font-weight: 600;
}

.donation-qr {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 4px 0;
}

.qr-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.qr-frame {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 8px;
    transition: all 0.3s ease;
}

.qr-frame:hover {
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.05);
    transform: translateY(-2px);
}

.qr-frame img {
    width: 64px;
    height: 64px;
    border-radius: 6px;
    display: block;
}

.qr-divider {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.1), transparent);
}

.qr-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #e4e4ec;
}

.qr-hint {
    font-size: 0.6rem;
    color: #6b6b80;
}

.donation-note {
    font-size: 0.75rem;
    color: #8b5cf6;
    font-weight: 500;
    margin-top: 2px;
}

/* Footer donation */
.footer-donation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-donation a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #a8a8b8;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.footer-donation a:hover {
    color: #a78bfa;
}

/* Mobile responsive */
@media (max-width: 640px) {
    .donation-qr {
        gap: 14px;
    }
    
    .qr-frame img {
        width: 56px;
        height: 56px;
    }
    
    .qr-frame {
        padding: 6px;
    }
    
    .donation-box {
        margin: 32px 16px;
        padding: 20px 16px;
    }
    
    .donation-badge {
        font-size: 0.6rem;
        padding: 3px 10px;
    }
    
    .donation-text {
        font-size: 0.85rem;
    }
    
    .qr-label {
        font-size: 0.7rem;
    }
    
    .qr-hint {
        font-size: 0.55rem;
    }
    
    .donation-note {
        font-size: 0.7rem;
    }
}
