/* =========================================================================
   MoonlitCloud – Doodle / Peanuts-Comic Style
   Palette: Cream #F5F0E8, Dark Ink #1C1208, Red #D94F3D, Yellow #F2C94C,
            Blue #4A90D9, Kraft #E8DCC8
   Fonts: Patrick Hand (handwritten), Caveat (display)
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Patrick+Hand&family=Caveat:wght@400;600;700&display=swap');

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

:root {
    --cream: #F5F0E8;
    --kraft: #E8DCC8;
    --paper: #FAF7F0;
    --ink: #1C1208;
    --ink-light: #3D3020;
    --red: #D94F3D;
    --red-dark: #B83A2A;
    --red-light: #F5C4BD;
    --yellow: #F2C94C;
    --yellow-dark: #D4A017;
    --blue: #4A90D9;
    --blue-light: #C8DEFF;
    --gray-200: #E0D9CC;
    --gray-300: #C9BFA8;
    --gray-400: #A89880;
    --gray-500: #8A7A60;
    --gray-600: #6B5D44;
    --font: 'Patrick Hand', cursive;
    --font-display: 'Caveat', cursive;
    --radius: 6px;
    --radius-lg: 12px;
    --shadow-sketch: 3px 3px 0px var(--ink);
    --shadow-sm: 2px 2px 0px var(--ink);
    --transition: 0.15s ease;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

/* Lined paper background texture */
body {
    font-family: var(--font);
    background-color: var(--cream);
    background-image:
        repeating-linear-gradient(
            transparent,
            transparent 27px,
            rgba(74, 144, 217, 0.12) 27px,
            rgba(74, 144, 217, 0.12) 28px
        );
    background-attachment: local;
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    font-size: 1.05rem;
}

/* ── Typography ────────────────────────────────────────────────────────── */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    color: var(--ink);
}

h1 { font-size: 3rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

/* ── Sketchy border mixin via pseudo elements ──────────────────────────── */
.sketch-box {
    border: 2.5px solid var(--ink);
    border-radius: 2px 8px 4px 6px / 6px 2px 8px 4px;
    box-shadow: var(--shadow-sketch);
    position: relative;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border: 2.5px solid var(--ink);
    border-radius: 3px 10px 5px 8px / 8px 4px 10px 3px;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: var(--shadow-sketch);
    letter-spacing: 0.02em;
}

.btn:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0px var(--ink);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--yellow);
    color: var(--ink);
}
.btn-primary:hover:not(:disabled) {
    background: var(--yellow-dark);
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0px var(--ink);
}

.btn-secondary {
    background: var(--kraft);
    color: var(--ink);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--gray-200);
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0px var(--ink);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
    border-color: var(--gray-400);
    box-shadow: 2px 2px 0 var(--gray-400);
    padding: 8px 12px;
}
.btn-ghost:hover:not(:disabled) {
    background: var(--kraft);
    color: var(--ink);
    border-color: var(--ink);
    box-shadow: var(--shadow-sketch);
}

.btn-danger {
    background: transparent;
    color: var(--red);
    border-color: var(--red);
    box-shadow: 2px 2px 0px var(--red);
}
.btn-danger:hover:not(:disabled) {
    background: var(--red);
    color: var(--paper);
    box-shadow: 3px 3px 0px var(--red-dark);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
}

/* ── Button Loader ─────────────────────────────────────────────────────── */
.btn.loading .btn-text { visibility: hidden; }
.btn .spinner {
    display: none;
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(28,18,8,0.2);
    border-top-color: var(--ink);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
.btn.loading .spinner { display: block; }

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

/* ── Page Loader ───────────────────────────────────────────────────────── */
.page-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    gap: 16px;
}

.page-loader .loader-ring {
    width: 44px;
    height: 44px;
    border: 3px solid var(--gray-300);
    border-top-color: var(--red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.page-loader span {
    color: var(--gray-600);
    font-family: var(--font-display);
    font-size: 1.1rem;
}

/* ── Navbar ─────────────────────────────────────────────────────────────── */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    height: 68px;
    background: var(--paper);
    border-bottom: 3px solid var(--ink);
    position: sticky;
    top: 0;
    z-index: 100;
    /* slight wavy bottom via box-shadow trick */
    box-shadow: 0 3px 0 var(--ink);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--ink);
}

.navbar-brand .logo {
    width: 38px;
    height: 38px;
    background: var(--red);
    border: 2.5px solid var(--ink);
    border-radius: 4px 12px 4px 10px / 10px 4px 12px 4px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-brand .logo svg {
    width: 20px;
    height: 20px;
    stroke: var(--paper);
    fill: none;
    stroke-width: 1.8;
}

.navbar-brand span {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -0.01em;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-user img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 2.5px solid var(--ink);
    box-shadow: var(--shadow-sm);
}

.navbar-user .user-name {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink-light);
}

/* ── Landing / Hero ────────────────────────────────────────────────────── */
.landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 68px);
    text-align: center;
    padding: 40px 20px;
    position: relative;
}

/* Decorative hand-drawn asterisks / stars scattered around */
.landing::before {
    content: '* * *';
    position: absolute;
    top: 60px;
    left: 60px;
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--yellow-dark);
    letter-spacing: 12px;
    opacity: 0.5;
}
.landing::after {
    content: '~ ~ ~';
    position: absolute;
    bottom: 80px;
    right: 60px;
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--blue);
    letter-spacing: 12px;
    opacity: 0.4;
}

.landing-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 18px;
    border-radius: 2px 12px 4px 10px / 10px 3px 12px 5px;
    background: var(--yellow);
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 28px;
    border: 2px solid var(--ink);
    box-shadow: var(--shadow-sm);
    transform: rotate(-1deg);
}

.landing h1 {
    font-size: 4rem;
    font-weight: 700;
    max-width: 700px;
    margin-bottom: 16px;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.landing h1 .accent {
    color: var(--red);
    text-decoration: underline;
    text-decoration-style: wavy;
    text-underline-offset: 5px;
    text-decoration-thickness: 2px;
}

.landing p {
    font-size: 1.15rem;
    color: var(--gray-600);
    max-width: 480px;
    margin-bottom: 40px;
    line-height: 1.7;
}

.landing .btn {
    padding: 14px 40px;
    font-size: 1.2rem;
    transform: rotate(-0.5deg);
}

/* ── Landing Features ──────────────────────────────────────────────────── */
.landing-features {
    display: flex;
    gap: 40px;
    margin-top: 72px;
    padding-top: 40px;
    border-top: 2.5px dashed var(--gray-300);
}

.landing-features .feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease;
}

.landing-features .feature:hover {
    transform: translateY(-4px) rotate(-1deg);
}

.landing-features .feature-icon {
    width: 52px;
    height: 52px;
    background: var(--kraft);
    border: 2.5px solid var(--ink);
    border-radius: 4px 14px 4px 12px / 12px 4px 14px 4px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.landing-features .feature-icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--red);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.landing-features .feature h4 {
    font-size: 1.05rem;
    font-weight: 700;
}

.landing-features .feature p {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin: 0;
}

/* ── Dashboard ─────────────────────────────────────────────────────────── */
.dashboard {
    max-width: 1100px;
    margin: 0 auto;
    padding: 36px 40px 60px;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.dashboard-header h2 {
    font-size: 1.8rem;
    position: relative;
}

/* Underline squiggle on heading */
.dashboard-header h2::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -6px;
    height: 3px;
    background: var(--red);
    border-radius: 2px;
    clip-path: polygon(0 0, 4% 100%, 8% 0, 12% 100%, 16% 0, 20% 100%, 24% 0, 28% 100%, 32% 0, 36% 100%, 40% 0, 44% 100%, 48% 0, 52% 100%, 56% 0, 60% 100%, 64% 0, 68% 100%, 72% 0, 76% 100%, 80% 0, 84% 100%, 88% 0, 92% 100%, 96% 0, 100% 100%, 100% 100%, 0 100%);
}

/* ── Upload Zone ───────────────────────────────────────────────────────── */
.upload-zone {
    border: 3px dashed var(--gray-300);
    border-radius: 4px 16px 4px 14px / 14px 4px 16px 4px;
    padding: 52px;
    text-align: center;
    transition: all var(--transition);
    cursor: pointer;
    background: var(--paper);
    margin-bottom: 36px;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(28,18,8,0.04);
}

/* Corner doodles */
.upload-zone::before,
.upload-zone::after {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--gray-400);
    position: absolute;
    line-height: 1;
}
.upload-zone::before { content: '+'; top: 10px; left: 16px; }
.upload-zone::after  { content: '+'; bottom: 10px; right: 16px; }

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--red);
    background: rgba(217, 79, 61, 0.04);
}

.upload-zone.dragover {
    transform: scale(1.01) rotate(0.3deg);
}

.upload-zone svg {
    width: 44px;
    height: 44px;
    stroke: var(--gray-400);
    fill: none;
    stroke-width: 1.8;
    margin-bottom: 12px;
    transition: stroke var(--transition);
}

.upload-zone:hover svg,
.upload-zone.dragover svg {
    stroke: var(--red);
}

.upload-zone h3 {
    font-size: 1.15rem;
    margin-bottom: 6px;
    color: var(--ink-light);
}

.upload-zone p {
    font-size: 0.85rem;
    color: var(--gray-500);
    font-family: var(--font);
}

.upload-zone input[type="file"] { display: none; }

/* ── Upload Progress ──────────────────────────────────────────────────── */
.upload-progress {
    display: none;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--paper);
    border-radius: 3px 10px 3px 8px / 8px 3px 10px 3px;
    border: 2.5px solid var(--ink);
    box-shadow: var(--shadow-sketch);
}

.upload-progress.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.upload-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.upload-progress-header span {
    font-size: 0.9rem;
    color: var(--gray-600);
    font-family: var(--font-display);
    font-weight: 600;
}

.upload-progress-header .percent {
    font-variant-numeric: tabular-nums;
}

.progress-bar {
    height: 6px;
    background: var(--kraft);
    border-radius: 3px;
    overflow: hidden;
    border: 1.5px solid var(--ink);
}

.progress-bar .fill {
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        var(--red),
        var(--red) 6px,
        var(--red-dark) 6px,
        var(--red-dark) 12px
    );
    transition: width 0.3s ease;
    width: 0%;
}

/* ── File Grid ─────────────────────────────────────────────────────────── */
.files-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.files-header h3 {
    font-size: 1.2rem;
    color: var(--ink-light);
}

.file-count {
    font-size: 0.85rem;
    color: var(--gray-600);
    background: var(--yellow);
    padding: 3px 14px;
    border-radius: 2px 8px 2px 6px / 6px 2px 8px 2px;
    border: 1.5px solid var(--ink);
    font-family: var(--font-display);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transform: rotate(0.5deg);
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.file-card {
    background: var(--paper);
    border: 2.5px solid var(--ink);
    border-radius: 3px 12px 4px 10px / 10px 3px 12px 4px;
    overflow: hidden;
    transition: all 0.15s ease;
    cursor: pointer;
    animation: popIn 0.3s ease;
    box-shadow: var(--shadow-sketch);
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.92) rotate(-1deg); }
    to   { opacity: 1; transform: scale(1) rotate(0deg); }
}

.file-card:hover {
    transform: translate(-2px, -3px) rotate(-0.5deg);
    box-shadow: 5px 5px 0px var(--ink);
}

.file-card-preview {
    height: 140px;
    background: var(--kraft);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border-bottom: 2px solid var(--ink);
}

.file-card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-card-preview .file-type-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--gray-500);
}

.file-card-preview .file-type-icon svg {
    width: 34px;
    height: 34px;
    stroke: var(--gray-500);
    fill: none;
    stroke-width: 1.8;
}

.file-card-preview .file-type-icon span {
    font-size: 0.7rem;
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-600);
}

.file-card-preview .video-play-badge {
    position: absolute;
    width: 46px;
    height: 46px;
    background: var(--ink);
    border-radius: 50%;
    border: 2px solid var(--paper);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.file-card-preview .video-play-badge svg {
    width: 18px;
    height: 18px;
    fill: var(--paper);
    stroke: none;
    margin-left: 3px;
}

.file-card-body {
    padding: 14px 16px;
}

.file-card-name {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-card-size {
    font-size: 0.78rem;
    color: var(--gray-500);
}

.file-card-actions {
    display: flex;
    gap: 2px;
}

.file-card-actions button {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    color: var(--gray-500);
}

.file-card-actions button:hover {
    background: var(--kraft);
    color: var(--ink);
    border: 1.5px solid var(--ink);
}

.file-card-actions button.shared-active { color: var(--red); }

.file-card-actions button svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.file-card-actions button.delete-btn:hover {
    background: var(--red-light);
    color: var(--red);
    border-color: var(--red);
}

/* Shared badge */
.file-card .shared-badge {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--red);
    color: var(--paper);
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 2px 6px 2px 4px / 4px 2px 6px 2px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1.5px solid var(--ink);
    box-shadow: 1px 1px 0 var(--ink);
}

.file-card .shared-badge.visible { display: block; }

/* ── Empty State ───────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.empty-state svg {
    width: 60px;
    height: 60px;
    stroke: var(--gray-300);
    fill: none;
    stroke-width: 1.8;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.3rem;
    color: var(--ink-light);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.9rem;
    font-family: var(--font);
}

/* ── Modal Base ────────────────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(28, 18, 8, 0.55);
    backdrop-filter: blur(2px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

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

.modal {
    background: var(--paper);
    border-radius: 4px 16px 4px 12px / 12px 4px 16px 4px;
    width: 100%;
    max-width: 500px;
    border: 2.5px solid var(--ink);
    box-shadow: 6px 6px 0px var(--ink);
    animation: slideUp 0.25s ease;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 2px solid var(--ink);
    background: var(--kraft);
}

.modal-header h3 {
    font-size: 1.15rem;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: 2px solid var(--ink);
    background: var(--paper);
    border-radius: 3px 10px 3px 8px / 8px 3px 10px 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

.modal-close:hover {
    background: var(--red-light);
    border-color: var(--red);
    color: var(--red);
    transform: rotate(5deg);
}

.modal-close svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
}

.modal-body { padding: 24px; }

.modal-footer {
    padding: 16px 24px;
    border-top: 2px solid var(--ink);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    background: var(--kraft);
}

/* ── Share Modal ──────────────────────────────────────────────────────── */
.share-url-box {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.share-url-box input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--ink);
    border-radius: 3px 8px 3px 6px / 6px 3px 8px 3px;
    font-family: var(--font);
    font-size: 0.9rem;
    background: var(--cream);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

.share-url-box input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 2px 2px 0 var(--blue);
}

.copied-toast {
    display: none;
    font-size: 0.85rem;
    color: var(--red);
    margin-top: 8px;
    font-family: var(--font-display);
    font-weight: 600;
}

.copied-toast.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* ── Preview Modal ─────────────────────────────────────────────────────── */
.preview-modal .modal {
    max-width: 900px;
    max-height: 90vh;
}

.preview-content {
    max-height: 60vh;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--kraft);
    border-radius: 3px 8px 3px 6px / 6px 3px 8px 3px;
    border: 2px solid var(--ink);
    min-height: 200px;
}

.preview-content img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
}

.preview-content pre {
    width: 100%;
    padding: 20px;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-break: break-all;
    overflow: auto;
    color: var(--ink);
}

.preview-content iframe {
    width: 100%;
    height: 60vh;
    border: none;
}

.preview-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* ── Custom Video Player ───────────────────────────────────────────────── */
.video-player-wrap {
    width: 100%;
    background: #000;
    border-radius: 4px 10px 4px 8px / 8px 4px 10px 4px;
    overflow: hidden;
    position: relative;
    border: 2px solid var(--ink);
}

.video-player-wrap video {
    width: 100%;
    display: block;
    max-height: 60vh;
}

.video-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(28,18,8,0.9));
    padding: 24px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-player-wrap:hover .video-controls,
.video-player-wrap.controls-visible .video-controls { opacity: 1; }

.video-seek {
    width: 100%;
    height: 5px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.25);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.video-seek::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--yellow);
    cursor: pointer;
    border: 2px solid var(--ink);
}

.video-seek::-moz-range-thumb {
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--yellow);
    cursor: pointer;
    border: 2px solid var(--ink);
}

.video-controls-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.video-controls-bar button {
    background: none;
    border: none;
    color: var(--cream);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: opacity var(--transition);
}
.video-controls-bar button:hover { opacity: 1; }

.video-controls-bar button svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.video-time {
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: rgba(245,240,232,0.85);
    font-variant-numeric: tabular-nums;
    margin-left: auto;
}

.video-volume-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.video-volume {
    width: 70px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.video-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--cream);
    cursor: pointer;
}

.video-volume::-moz-range-thumb {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--cream);
    cursor: pointer;
    border: none;
}

/* ── Shared Page ───────────────────────────────────────────────────────── */
.shared-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.shared-card {
    background: var(--paper);
    border: 2.5px solid var(--ink);
    border-radius: 4px 16px 4px 12px / 12px 4px 16px 4px;
    max-width: 700px;
    width: 100%;
    box-shadow: 6px 6px 0px var(--ink);
    overflow: hidden;
}

.shared-card-preview {
    background: var(--kraft);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    overflow: hidden;
    border-bottom: 2px solid var(--ink);
}

.shared-card-preview img {
    max-width: 100%;
    max-height: 500px;
    object-fit: contain;
}

.shared-card-body { padding: 24px; }

.shared-card-name {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.shared-card-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 20px;
}

.shared-card-actions { display: flex; gap: 8px; }

/* ── Confirm Modal ─────────────────────────────────────────────────────── */
.confirm-text {
    font-size: 0.95rem;
    color: var(--gray-600);
    line-height: 1.7;
}

/* ── Toast ──────────────────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--ink);
    color: var(--cream);
    padding: 12px 20px;
    border-radius: 3px 10px 3px 8px / 8px 3px 10px 3px;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    border: 2px solid var(--cream);
    box-shadow: 4px 4px 0px rgba(255,255,255,0.2);
    z-index: 9999;
    animation: slideUp 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
}

.toast.error {
    background: var(--red);
    border-color: var(--ink);
    box-shadow: 4px 4px 0px var(--red-dark);
}

/* ── Animations ────────────────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px) rotate(-1deg); }
    to { opacity: 1; transform: translateY(0) rotate(0deg); }
}

/* ── Scrollbar ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
    border: 1.5px solid var(--cream);
}
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .navbar { padding: 0 20px; }
    .landing h1 { font-size: 2.6rem; }
    .landing::before, .landing::after { display: none; }
    .landing-features { flex-direction: column; gap: 24px; }
    .dashboard { padding: 20px; }
    .upload-zone { padding: 36px 20px; }
    .file-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .modal { margin: 10px; }
    .preview-modal .modal { max-width: 95vw; }
}

@media (max-width: 480px) {
    .landing h1 { font-size: 2rem; }
    .file-grid { grid-template-columns: 1fr 1fr; }
    .navbar-user .user-name { display: none; }
}