/* ═══ ShareBox — Premium Modern Dark Theme ═══ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #0b0d12;
    --bg-secondary: #111318;
    --bg-card: #15171e;
    --bg-elevated: #1a1d26;
    --bg-hover: #1e2130;
    --bg-input: #13151c;
    --border: #1f2233;
    --border-hover: #2d3148;
    --border-active: #3b82f6;
    --text-primary: #e4e6ee;
    --text-secondary: #7c82a0;
    --text-dim: #4a4f6a;
    --accent: #3b82f6;
    --accent-soft: rgba(59, 130, 246, 0.12);
    --accent-hover: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.15);
    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.12);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.12);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.12);
    --purple: #8b5cf6;
    --purple-soft: rgba(139, 92, 246, 0.12);
    --gradient-brand: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(59,130,246,0.08) 0%, rgba(139,92,246,0.05) 100%);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.25);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.35);
    --shadow-glow: 0 0 30px rgba(59,130,246,0.1);
    --transition: all 0.2s cubic-bezier(.4,0,.2,1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.hidden { display: none !important; }

/* ═══ Icons (Lucide via CSS) ═══ */
.icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    flex-shrink: 0;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 32px; height: 32px; }
.icon-2xl { width: 48px; height: 48px; }

/* ═══ Header ═══ */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 28px;
    height: 60px;
    background: rgba(17, 19, 24, 0.85);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    width: 28px;
    height: 28px;
    background: var(--gradient-brand);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(59,130,246,0.3);
}

.brand-icon svg { stroke: white; width: 16px; height: 16px; }

.brand {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-name {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    margin-right: 4px;
}

/* ═══ Buttons ═══ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    line-height: 1;
}

.btn-primary {
    background: var(--gradient-brand);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(59,130,246,0.25);
}
.btn-primary:hover {
    opacity: 0.92;
    box-shadow: 0 4px 20px rgba(59,130,246,0.35);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 8px 16px;
}
.btn-ghost:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn-accent {
    background: var(--accent);
    color: white;
    font-weight: 600;
}
.btn-accent:hover { background: var(--accent-hover); }

.btn-full { width: 100%; justify-content: center; }

.btn-icon-only {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 6px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-icon-only:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-icon-only.danger:hover { color: var(--danger); }
.btn-icon-only svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ═══ Main ═══ */
.main {
    max-width: 860px;
    margin: 0 auto;
    padding: 36px 24px;
}

/* ═══ Upload Zone ═══ */
.upload-zone {
    border: 1.5px dashed var(--border);
    border-radius: 16px;
    padding: 56px 32px;
    text-align: center;
    background: var(--gradient-subtle);
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, var(--accent-soft) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.upload-zone:hover::before,
.upload-zone.dragover::before {
    opacity: 1;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
}

.upload-zone.dragover {
    transform: scale(1.005);
}

.upload-icon-wrap {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: var(--accent-soft);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.upload-icon-wrap svg {
    width: 32px;
    height: 32px;
    stroke: var(--accent);
}

.upload-zone h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

.upload-zone p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.btn-upload {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
    z-index: 1;
    padding: 11px 28px;
    font-size: 14px;
}

.upload-hint {
    font-size: 12px !important;
    color: var(--text-dim) !important;
    margin-top: 14px !important;
    margin-bottom: 0 !important;
    position: relative;
    z-index: 1;
}

/* ═══ Progress ═══ */
.upload-progress { margin-bottom: 20px; }

.progress-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
}

.progress-item .fi-icon { flex-shrink: 0; }
.progress-item .file-name { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress-item .file-size { color: var(--text-dim); font-size: 12px; flex-shrink: 0; }

.progress-bar-bg {
    width: 100px;
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-brand);
    border-radius: 2px;
    transition: width 0.3s;
    width: 0%;
}

.progress-status {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
    width: 36px;
    text-align: right;
    flex-shrink: 0;
}
.progress-status.done { color: var(--success); }

/* ═══ Upload Results ═══ */
.upload-results {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
    overflow: hidden;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--success-soft);
}

.results-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}
.result-item:last-child { border-bottom: none; }
.result-item:hover { background: var(--bg-hover); }

.result-info { flex: 1; min-width: 0; }
.result-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-size { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.result-link { display: flex; gap: 6px; flex-shrink: 0; max-width: 320px; }

.result-link-input {
    flex: 1;
    padding: 7px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--accent);
    font-size: 11px;
    font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;
    outline: none;
    min-width: 160px;
}
.result-link-input:focus { border-color: var(--accent); }

.btn-copy {
    padding: 7px 16px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    border-radius: var(--radius-xs);
    min-width: 90px;
}

/* ═══ Files Section ═══ */
.files-section { margin-top: 0; }

.files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 12px;
}

.files-header h3 {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
}

.files-controls { display: flex; gap: 8px; }

.search-input, .sort-select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 12px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.search-input { width: 180px; }
.search-input:focus, .sort-select:focus { border-color: var(--accent); }
.sort-select { cursor: pointer; }
.sort-select option { background: var(--bg-card); }

/* ═══ File Items ═══ */
.files-list { display: flex; flex-direction: column; gap: 4px; }

.file-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: var(--transition);
}
.file-item:hover { background: var(--bg-hover); border-color: var(--border-hover); }

.fi-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fi-icon svg { width: 20px; height: 20px; }

.fi-icon.img { background: var(--purple-soft); color: var(--purple); }
.fi-icon.img svg { stroke: var(--purple); }
.fi-icon.vid { background: rgba(239,68,68,0.12); color: var(--danger); }
.fi-icon.vid svg { stroke: var(--danger); }
.fi-icon.aud { background: var(--success-soft); color: var(--success); }
.fi-icon.aud svg { stroke: var(--success); }
.fi-icon.doc { background: var(--accent-soft); color: var(--accent); }
.fi-icon.doc svg { stroke: var(--accent); }
.fi-icon.arc { background: var(--warning-soft); color: var(--warning); }
.fi-icon.arc svg { stroke: var(--warning); }
.fi-icon.def { background: rgba(74,79,106,0.2); color: var(--text-dim); }
.fi-icon.def svg { stroke: var(--text-secondary); }

.file-info { flex: 1; min-width: 0; }

.file-info-name {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-info-meta {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 3px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.file-badges { display: flex; gap: 4px; flex-shrink: 0; }

.badge {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.badge-pass { background: var(--warning-soft); color: var(--warning); }
.badge-once { background: var(--danger-soft); color: var(--danger); }
.badge-expire { background: var(--accent-soft); color: var(--accent); }

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

/* ═══ Empty ═══ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-dim);
}
.empty-state svg { margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 13px; }

/* ═══ Modal ═══ */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 460px;
    max-width: 90vw;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s cubic-bezier(.4,0,.2,1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h3 {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-xs);
    transition: var(--transition);
    display: flex;
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.modal-body { padding: 24px; }

/* ═══ Share modal ═══ */
.share-link-box { display: flex; gap: 8px; margin-bottom: 24px; }

.share-link-input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-size: 12px;
    font-family: 'JetBrains Mono', 'Cascadia Code', monospace;
    outline: none;
}
.share-link-input:focus { border-color: var(--accent); }

/* ═══ Auth Tabs ═══ */
.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.auth-tab {
    flex: 1;
    padding: 10px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    border: none;
    background: var(--bg-input);
    color: var(--text-dim);
    cursor: pointer;
    transition: var(--transition);
}
.auth-tab:hover { color: var(--text-secondary); }
.auth-tab.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

.share-options { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }

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

.option-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}
.option-input:focus { border-color: var(--accent); }
.option-input option { background: var(--bg-card); }

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px !important;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* ═══ Input groups ═══ */
.input-group { margin-bottom: 14px; }

.input-group input {
    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: 14px;
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}
.input-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input-group input::placeholder { color: var(--text-dim); }

.error-text {
    color: var(--danger);
    font-size: 12px;
    text-align: center;
    margin-top: 10px;
    min-height: 18px;
}

/* ═══ Toast ═══ */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 2000;
}

.toast {
    padding: 11px 18px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    box-shadow: var(--shadow-md);
    animation: toastIn 0.3s cubic-bezier(.4,0,.2,1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--accent); }

@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(30px); } }

/* ═══ Scrollbar ═══ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ═══ Responsive ═══ */
@media (max-width: 640px) {
    .header { padding: 0 16px; height: 54px; }
    .main { padding: 20px 14px; }
    .upload-zone { padding: 36px 20px; }
    .upload-zone h2 { font-size: 16px; }
    .files-header { flex-direction: column; align-items: stretch; }
    .files-controls { flex-direction: column; }
    .search-input { width: 100%; }
    .file-item { flex-wrap: wrap; gap: 8px; padding: 12px; }
    .file-badges { order: 4; width: 100%; }
    .file-actions { order: 3; }
    .share-link-box { flex-direction: column; }
    .result-link { flex-direction: column; max-width: none; }
    .result-link-input { min-width: 0; }
}

/* ═══ Notifications ═══ */
.notification-btn { position: relative; }
.notif-badge {
    position: absolute;
    top: 2px; right: 2px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px; height: 16px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
}
.notif-item {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.notif-item:last-child { border-bottom: none; }
.notif-icon {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--accent-soft);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: var(--accent);
}
.notif-text { font-size: 13px; color: var(--text-secondary); }
.notif-time { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.notif-unread .notif-text { color: var(--text-primary); font-weight: 500; }
.notif-empty { text-align: center; color: var(--text-dim); padding: 30px; font-size: 13px; }
