/* ============================================================
   Download Station — Liquid Glass · Editorial Minimalism
   Fonts: Noto Serif SC (display), DM Sans (body), DM Mono (code)
   Palette: warm white + deep charcoal + amber gold accents
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,400;0,500;1,400&family=DM+Sans:ital,opsz,wght@0,9..40,200..800;1,9..40,200..800&family=Noto+Serif+SC:wght@300;400;500;600;700;900&display=swap');

/* ---- CSS Variables ---- */
:root {
    --bg:            #fafaf8;
    --surface:       rgba(255, 255, 255, 0.55);
    --surface-hover: rgba(255, 255, 255, 0.78);
    --surface-solid: #ffffff;
    --text-primary:  #1a1a1a;
    --text-secondary:#6b6b6b;
    --text-muted:    #a0a0a0;
    --accent:        #c8a45c;
    --accent-hover:  #b8934a;
    --accent-dim:    rgba(200, 164, 92, 0.12);
    --border:        rgba(0, 0, 0, 0.06);
    --border-strong: rgba(0, 0, 0, 0.10);
    --shadow-sm:     0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md:     0 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-lg:     0 12px 40px rgba(0, 0, 0, 0.08);
    --radius-sm:     8px;
    --radius-md:     14px;
    --radius-lg:     22px;
    --radius-xl:     28px;
    --font-display:  'Noto Serif SC', serif;
    --font-body:     'DM Sans', -apple-system, sans-serif;
    --font-mono:     'DM Mono', 'Courier New', monospace;
    --transition:    0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --noise:         url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    line-height: 1.6;
}

/* Noise texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: var(--noise);
    background-repeat: repeat;
    opacity: 0.7;
}

/* ---- Glass Panel ---- */
.glass {
    background: var(--surface);
    backdrop-filter: blur(18px) saturate(130%);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.glass-hover:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
    transition: all var(--transition);
}

/* ---- Typography ---- */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

h1 { font-size: 2.4rem; font-weight: 600; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.3rem; }

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--accent); }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition);
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg);
    border-color: var(--text-primary);
}
.btn-primary:hover {
    background: #333;
    border-color: #333;
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.btn-accent {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.btn-accent:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.btn-glass {
    background: var(--surface);
    backdrop-filter: blur(18px) saturate(130%);
    -webkit-backdrop-filter: blur(18px) saturate(130%);
    border: 1px solid var(--border);
    color: var(--text-primary);
}
.btn-glass:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 6px 16px;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

.btn-danger {
    background: transparent;
    color: #c97a7a;
    border-color: rgba(201, 122, 122, 0.3);
}
.btn-danger:hover {
    background: rgba(201, 122, 122, 0.08);
    border-color: rgba(201, 122, 122, 0.5);
    color: #b55a5a;
}

/* ---- Layout ---- */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

.container-wide {
    max-width: 1100px;
}

/* ---- Nav bar ---- */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    margin: 16px 24px;
    position: relative;
    z-index: 2;
}

.navbar .brand {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.navbar .nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.navbar .nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition);
}
.navbar .nav-links a:hover {
    color: var(--text-primary);
}

/* ---- Homepage ---- */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 85vh;
    text-align: center;
    padding: 40px 20px;
}

.intro-card {
    max-width: 680px;
    width: 100%;
    padding: 48px 44px;
    text-align: left;
    animation: fadeRise 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.intro-card h1 {
    margin-bottom: 24px;
    color: var(--text-primary);
}

.intro-card p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.8;
    opacity: 0;
    animation: fadeRise 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-fill-mode: both;
}

.intro-card p:nth-child(2)  { animation-delay: 0.3s; }
.intro-card p:nth-child(3)  { animation-delay: 0.5s; }
.intro-card p:nth-child(4)  { animation-delay: 0.7s; }
.intro-card p:nth-child(5)  { animation-delay: 0.9s; }
.intro-card p:nth-child(6)  { animation-delay: 1.1s; }
.intro-card p:nth-child(7)  { animation-delay: 1.3s; }
.intro-card p:nth-child(8)  { animation-delay: 1.5s; }
.intro-card p:nth-child(9)  { animation-delay: 1.7s; }
.intro-card p:nth-child(10) { animation-delay: 1.9s; }

.intro-card .btn-wrapper {
    text-align: center;
    margin-top: 36px;
    opacity: 0;
    animation: fadeRise 0.7s cubic-bezier(0.4, 0, 0.2, 1) 2.2s forwards;
}

.btn-enter {
    padding: 16px 44px;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

/* ---- Files page ---- */
.page-header {
    margin: 24px 0 32px;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.breadcrumbs a {
    color: var(--text-secondary);
    font-weight: 500;
}
.breadcrumbs a:hover { color: var(--accent); }

.breadcrumbs .sep {
    color: var(--text-muted);
    user-select: none;
}

.breadcrumbs .current {
    color: var(--text-primary);
    font-weight: 600;
}

.file-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-row {
    display: flex;
    align-items: center;
    padding: 14px 22px;
    gap: 14px;
    cursor: pointer;
    transition: all var(--transition);
}

.file-row .icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    width: 36px;
    text-align: center;
}

.file-row .file-name {
    flex: 1;
    font-weight: 500;
    font-size: 0.95rem;
    font-family: var(--font-body);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-row .file-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    white-space: nowrap;
    flex-shrink: 0;
}

.file-row .actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 1rem;
}

/* ---- Admin Login ---- */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 44px 40px;
}

.login-card h1 {
    text-align: center;
    margin-bottom: 8px;
}

.login-card .subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-solid);
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: all var(--transition);
    outline: none;
}

.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.error-msg {
    background: rgba(201, 122, 122, 0.08);
    border: 1px solid rgba(201, 122, 122, 0.2);
    color: #b55a5a;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    margin-bottom: 16px;
    text-align: center;
}

/* ---- Admin Panel ---- */
.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

/* Upload Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    width: 100%;
    max-width: 500px;
    padding: 32px;
    animation: fadeRise 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal h2 {
    margin-bottom: 24px;
    font-size: 1.4rem;
}

.modal .form-group {
    margin-bottom: 16px;
}

.progress-wrapper {
    margin-top: 20px;
}

.progress-bar-outer {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-inner {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.2s ease;
    width: 0%;
}

.progress-text {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.progress-text .resume-hint {
    color: var(--accent);
    cursor: pointer;
    font-weight: 500;
}

.progress-text .resume-hint:hover {
    text-decoration: underline;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ---- Animations ---- */
@keyframes fadeRise {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0%   { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .container, .container-wide {
        padding: 0 16px;
    }
    .navbar {
        margin: 8px 10px;
        padding: 12px 18px;
    }
    .intro-card {
        padding: 32px 24px;
    }
    .hero {
        min-height: 75vh;
        padding: 20px 10px;
    }
    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.4rem; }
    .file-row .file-meta {
        display: none;
    }
}
