/* File2Web - Dark theme */
:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a2035;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --border: #1e293b;
    --success: #22c55e;
    --error: #ef4444;
}

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

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

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

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

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* View header */
.view-header {
    text-align: left;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.view-header h1 {
    font-size: 1.5rem;
    margin-top: 0.75rem;
    word-break: break-word;
}

.back-link {
    color: var(--accent);
    font-size: 0.9rem;
}

.meta {
    display: flex;
    gap: 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Upload area */
.upload-area {
    background: var(--bg-secondary);
    border: 2px dashed var(--border);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.05);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.upload-hint {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Buttons */
.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

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

/* Status */
.status-area {
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Result */
.result-card,
.error-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
}

.result-icon,
.error-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.result-card h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    word-break: break-word;
}

.link-box {
    display: flex;
    gap: 0.5rem;
    margin: 1rem auto;
    max-width: 500px;
}

.link-box input {
    flex: 1;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.btn-copy {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
}

.btn-copy:hover {
    background: var(--accent-hover);
}

.btn-outline {
    background: #22c55e;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: background 0.2s;
}

.btn-outline:hover {
    background: #16a34a;
}

.result-hint {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

/* Error */
.error-card p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Markdown content */
.md-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    line-height: 1.8;
    font-size: 1rem;
}

.md-content h1 { font-size: 1.6rem; margin: 1.5rem 0 0.75rem; }
.md-content h2 { font-size: 1.3rem; margin: 1.25rem 0 0.5rem; }
.md-content h3 { font-size: 1.1rem; margin: 1rem 0 0.5rem; }
.md-content p { margin-bottom: 0.75rem; }
.md-content ul, .md-content ol { margin: 0.5rem 0 0.75rem 1.5rem; }
.md-content li { margin-bottom: 0.25rem; }
.md-content code {
    background: rgba(255,255,255,0.08);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}
.md-content pre {
    background: rgba(0,0,0,0.3);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
}
.md-content pre code {
    background: none;
    padding: 0;
}
.md-content blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-secondary);
}
.md-content a {
    color: var(--accent);
    text-decoration: none;
}
.md-content a:hover {
    text-decoration: underline;
}
.md-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}
.md-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

/* Image content */
.image-content {
    text-align: center;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
}
.image-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* Slide gallery */
.slide-gallery {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}
.slide-gallery h2 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}
.slide-image {
    margin-bottom: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}
.slide-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

/* PDF gallery */
.pdf-gallery {
    margin-top: 1rem;
}
.pdf-page {
    margin-bottom: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}
.pdf-page img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.page-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Preview images - seamless chunks */
.preview-chunk {
    margin: 0;
    padding: 0;
    line-height: 0;
    font-size: 0;
}
.preview-img {
    display: block;
    width: 100%;
    height: auto;
}

/* Footer */
.footer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

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

/* Responsive */
@media (max-width: 600px) {
    .container { padding: 1rem; }
    .header h1 { font-size: 1.5rem; }
    .upload-area { padding: 2rem 1rem; }
    .md-content { padding: 1.25rem; }
}
