/* ===== MD Reader — Glassmorphism ===== */
:root {
    --bg-start: #667eea;
    --bg-end: #764ba2;
    --glass-bg: rgba(255,255,255,0.15);
    --glass-border: rgba(255,255,255,0.25);
    --glass-shadow: 0 8px 32px rgba(0,0,0,0.15);
    --blur: 16px;
    --radius: 16px;
    --text: #1a1a2e;
    --text-light: rgba(255,255,255,0.9);
}

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

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

.backdrop {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
    z-index: -1;
}

/* ===== Glass ===== */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--glass-shadow);
}

/* ===== Layout ===== */
.container {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ===== Header ===== */
.header {
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.header h1 { font-size: 1.4rem; color: var(--text-light); }
.subtitle { font-size: 0.85rem; color: rgba(255,255,255,0.6); }

/* ===== Dropzone ===== */
.dropzone {
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
    border: 2px dashed rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.1);
}
.dropzone:hover, .dropzone.dragover {
    transform: scale(1.01);
    border-color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.2);
}
.drop-content { color: var(--text-light); }
.drop-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.drop-content p { font-size: 1.1rem; margin-bottom: 0.5rem; }
.drop-or { display: block; font-size: 0.8rem; opacity: 0.6; margin-bottom: 0.5rem; }
.btn-browse {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 10px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-browse:hover { background: rgba(255,255,255,0.3); }
.url-section {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    align-items: center;
}
.url-input {
    flex: 1;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.15);
    color: var(--text-light);
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
}
.url-input::placeholder { color: rgba(255,255,255,0.4); }
.url-input:focus { border-color: rgba(255,255,255,0.6); }

/* ===== File info bar ===== */
.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    margin: 1rem 0;
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
}
.btn-clear {
    background: rgba(255,255,255,0.2);
    border: none;
    color: var(--text-light);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.btn-clear:hover { background: rgba(255,0,0,0.3); }

/* ===== Preview ===== */
.preview {
    padding: 2rem;
    margin-top: 1rem;
    background: rgba(255,255,255,0.85);
    color: var(--text);
    line-height: 1.7;
}
.preview h1, .preview h2, .preview h3, .preview h4, .preview h5, .preview h6 {
    margin: 1.5em 0 0.5em;
    line-height: 1.3;
}
.preview h1 { font-size: 1.8rem; border-bottom: 2px solid #e0e0e0; padding-bottom: 0.3em; }
.preview h2 { font-size: 1.4rem; border-bottom: 1px solid #e0e0e0; padding-bottom: 0.2em; }
.preview h3 { font-size: 1.2rem; }
.preview p { margin: 0.75em 0; }
.preview a { color: var(--bg-start); text-decoration: none; }
.preview a:hover { text-decoration: underline; }
.preview code {
    background: rgba(100,100,200,0.1);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Consolas', 'Fira Code', monospace;
}
.preview pre {
    background: #1a1a2e;
    color: #e0e0e0;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    overflow-x: auto;
    margin: 1em 0;
}
.preview pre code { background: none; padding: 0; color: inherit; }
.preview blockquote {
    border-left: 4px solid var(--bg-start);
    padding: 0.5rem 1rem;
    margin: 1em 0;
    background: rgba(100,100,200,0.06);
    border-radius: 0 8px 8px 0;
}
.preview ul, .preview ol { padding-left: 1.5em; margin: 0.75em 0; }
.preview li { margin: 0.3em 0; }
.preview table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.preview th, .preview td { border: 1px solid #ddd; padding: 0.5rem 0.75rem; text-align: left; }
.preview th { background: rgba(100,100,200,0.08); font-weight: 600; }
.preview img { max-width: 100%; border-radius: 8px; margin: 0.5em 0; }
.preview hr { border: none; border-top: 1px solid #ddd; margin: 1.5em 0; }

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 2rem 1rem 1rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .container { padding: 1rem; }
    .header { padding: 1rem; }
    .header h1 { font-size: 1.2rem; }
    .dropzone { padding: 2rem 1rem; }
    .preview { padding: 1.25rem; }
}
