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

/* ===========================
   TOKENS & RESET
   =========================== */
:root {
    --primary: #7c3aed;
    --primary-light: #a78bfa;
    --primary-glow: rgba(124, 58, 237, 0.4);
    --secondary: #ec4899;
    --accent: #06b6d4;
    --success: #10b981;
    --danger: #ef4444;

    --bg: #07090f;
    --glass-bg: rgba(255, 255, 255, 0.045);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-hover: rgba(255, 255, 255, 0.08);

    --text: #f1f5f9;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;

    --shadow-card: 0 0 0 1px rgba(255,255,255,0.05), 0 20px 60px rgba(0,0,0,0.4);
    --shadow-btn: 0 4px 15px rgba(124, 58, 237, 0.4);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===========================
   ANIMATED AURORA BACKGROUND
   =========================== */
.bg-aurora {
    position: fixed; inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.aurora {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.18;
    animation: drift 18s ease-in-out infinite alternate;
}

.aurora-1 {
    width: 700px; height: 700px;
    background: radial-gradient(circle, #7c3aed, transparent 70%);
    top: -200px; left: -200px;
    animation-duration: 22s;
}

.aurora-2 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, #ec4899, transparent 70%);
    bottom: -150px; right: -150px;
    animation-duration: 18s;
    animation-delay: -8s;
}

.aurora-3 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, #06b6d4, transparent 70%);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    animation-duration: 25s;
    animation-delay: -4s;
}

@keyframes drift {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(60px, -40px) scale(1.08); }
    100% { transform: translate(-40px, 80px) scale(0.95); }
}

/* ===========================
   APP SHELL
   =========================== */
#app {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

/* ===========================
   GLASS UTILITY
   =========================== */
.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ===========================
   NAVBAR
   =========================== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-xl);
    margin: 1.25rem 0 2rem;
    box-shadow: var(--shadow-card);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-btn);
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.logo-bubble {
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-share {
    color: var(--text-subtle);
    font-weight: 400;
}

/* Auth */
.auth-section { display: flex; align-items: center; }

.btn-google {
    display: flex; align-items: center; gap: 0.625rem;
    padding: 0.6rem 1.2rem;
    background: white;
    color: #1f1f1f;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.btn-google:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.user-info {
    display: flex; align-items: center; gap: 0.75rem;
}

.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: var(--radius-sm);
    color: #fca5a5;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
    color: #fca5a5;
}

.hidden { display: none !important; }

/* ===========================
   MAIN GRID
   =========================== */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    align-items: start;
}

.col-left {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.col-right {
    position: sticky;
    top: 1.5rem;
}

/* ===========================
   CARDS
   =========================== */
.card {
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.3s;
}

.card-header {
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.25rem;
}

.card-title svg { opacity: 0.7; }

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.gradient-text {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ===========================
   EXPIRY SLIDER
   =========================== */
.expiry-section {
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
}

.expiry-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.875rem;
    font-size: 0.9rem;
    color: var(--text-subtle);
}

.expiry-header strong { color: var(--primary-light); }

.slider-wrap { padding: 0 0.25rem; }

.expiry-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: linear-gradient(to right, var(--primary) 0%, rgba(255,255,255,0.15) 0%);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    transition: background 0.15s;
}

.expiry-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.4), 0 2px 8px rgba(0,0,0,0.4);
    transition: transform 0.15s;
}

.expiry-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }

.expiry-slider::-moz-range-thumb {
    width: 20px; height: 20px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.4);
}

.slider-ticks {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ===========================
   DROP ZONE
   =========================== */
.drop-zone {
    border: 2px dashed var(--glass-border);
    border-radius: var(--radius-md);
    padding: 2.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.drop-zone::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: var(--radius-md);
}

.drop-zone:hover { border-color: var(--primary); transform: translateY(-3px); }
.drop-zone:hover::before { opacity: 0.05; }
.drop-zone.drag-over { border-color: var(--primary-light); border-style: solid; }
.drop-zone.drag-over::before { opacity: 0.08; }

.drop-inner { position: relative; z-index: 1; }

.drop-icon {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1.25rem;
    box-shadow: 0 8px 25px var(--primary-glow);
    animation: pulse-icon 3s ease-in-out infinite;
}

@keyframes pulse-icon {
    0%, 100% { box-shadow: 0 8px 25px var(--primary-glow); }
    50% { box-shadow: 0 8px 40px rgba(124, 58, 237, 0.6); }
}

.drop-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.drop-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.login-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ===========================
   FILE LIST
   =========================== */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 80px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
    opacity: 0.6;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    transition: all 0.2s;
    animation: slideUp 0.3s ease-out;
}

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

.file-item:hover { background: var(--glass-hover); border-color: rgba(255,255,255,0.12); }

.file-icon {
    width: 40px; height: 40px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(124,58,237,0.2), rgba(236,72,153,0.2));
    border: 1px solid rgba(124,58,237,0.3);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: var(--primary-light);
}

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

.file-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.2rem;
}

.file-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.file-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    background: rgba(124, 58, 237, 0.15);
    border: 1px solid rgba(124, 58, 237, 0.3);
    color: var(--primary-light);
    white-space: nowrap;
    flex-shrink: 0;
}

.file-badge.expiring { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: #fca5a5; }

.file-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-icon {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: transparent;
    color: var(--text-subtle);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover { background: rgba(255,255,255,0.1); color: white; border-color: rgba(255,255,255,0.2); }
.btn-icon.btn-share:hover { color: var(--primary-light); border-color: rgba(124,58,237,0.5); background: rgba(124,58,237,0.1); }
.btn-icon.btn-delete:hover { color: #fca5a5; border-color: rgba(239,68,68,0.5); background: rgba(239,68,68,0.1); }

/* Upload progress */
.progress-bar {
    width: 100%; height: 3px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 2px;
    transition: width 0.2s;
    width: 0%;
}

/* ===========================
   SHARE CARD
   =========================== */
.share-card { }

.qr-wrapper {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    min-height: 180px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.qr-placeholder {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 0.75rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.8rem;
}

.qr-code img, .qr-code canvas {
    display: block;
    max-width: 100%;
    border-radius: 4px;
}

.share-url-section { margin-bottom: 1.25rem; }

.section-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.url-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.75rem;
}

.url-text {
    flex: 1;
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
    color: var(--accent);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-btn {
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.copy-btn:hover:not(:disabled) { background: rgba(255,255,255,0.1); color: white; }
.copy-btn:disabled { opacity: 0.3; cursor: default; }

.copy-feedback {
    font-size: 0.78rem;
    color: var(--success);
    text-align: center;
    margin-top: 0.4rem;
    animation: fadeIn 0.2s;
}

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

/* How it works */
.how-it-works { padding-top: 1rem; border-top: 1px solid var(--glass-border); }

.steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.steps li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-subtle);
    line-height: 1.4;
}

.step-num {
    display: flex; align-items: center; justify-content: center;
    width: 22px; height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 900px) {
    #app { padding: 0 1rem 3rem; }
    .main-grid { grid-template-columns: 1fr; }
    .col-right { position: static; order: -1; }
    .navbar { padding: 0.75rem 1rem; }
    .user-name { display: none; }
    .btn-google span { display: none; }
}

@media (max-width: 480px) {
    .file-item { flex-wrap: wrap; }
    .file-actions { width: 100%; justify-content: flex-end; }
    .card { padding: 1.25rem; }
}
