:root {
    --bg: #111113;
    --surface: #1a1a1f;
    --surface-2: #222228;
    --surface-3: #2a2a32;
    --border: #333340;
    --text: #e8e8ed;
    --text-dim: #8888a0;
    --accent: #39ff85;
    --accent-dim: #39ff8520;
    --accent-hover: #2de876;
    --danger: #ff4757;
    --danger-dim: #ff475720;
    --radius: 8px;
    --mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
    --sans: 'DM Sans', 'Segoe UI', system-ui, sans-serif;
}

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

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

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

/* NAV */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.nav-brand {
    font-family: var(--mono);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.nav-brand .dot { color: var(--accent); }
.nav-links { display: flex; gap: 1.5rem; }
.nav-links a {
    color: var(--text-dim);
    font-size: 0.9rem;
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); }

/* LAYOUT */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem;
}
.container-wide {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* UPLOAD ZONE */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 4rem 2rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    background: var(--surface);
    position: relative;
}
.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-dim);
}
.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.6;
}
.upload-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.upload-hint {
    color: var(--text-dim);
    font-size: 0.875rem;
}
.upload-hint kbd {
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.15rem 0.4rem;
    font-family: var(--mono);
    font-size: 0.8rem;
}

/* PROGRESS */
.progress-wrap {
    margin-top: 1.5rem;
    display: none;
}
.progress-wrap.active { display: block; }
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--surface-3);
    border-radius: 2px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.3s;
    border-radius: 2px;
}
.progress-text {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
    font-family: var(--mono);
}

/* STATS BAR */
.stats {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    justify-content: center;
}
.stat {
    text-align: center;
}
.stat-value {
    font-family: var(--mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}
.stat-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* VIEW PAGE */
.view-wrap {
    display: grid;
    gap: 2rem;
}
.image-display {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}
.image-display img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}
.image-meta {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.meta-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
}
.meta-value {
    font-family: var(--mono);
    font-size: 0.9rem;
}

/* SHARE LINKS */
.share-section { margin-top: 1.5rem; }
.share-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.share-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.share-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    min-width: 80px;
    font-family: var(--mono);
}
.share-input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.8rem;
    outline: none;
}
.share-input:focus { border-color: var(--accent); }

.btn-copy {
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-copy:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}
.btn-copy.copied {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

/* DELETE */
.delete-zone {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}
.btn-delete {
    background: var(--danger-dim);
    border: 1px solid var(--danger);
    border-radius: 4px;
    padding: 0.5rem 1rem;
    color: var(--danger);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}
.btn-delete:hover {
    background: var(--danger);
    color: white;
}

/* GALLERY */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.gallery-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.2s;
}
.gallery-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.gallery-thumb {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg);
}
.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.gallery-item:hover .gallery-thumb img {
    transform: scale(1.05);
}
.gallery-info {
    padding: 0.75rem;
}
.gallery-name {
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}
.gallery-meta {
    font-size: 0.7rem;
    color: var(--text-dim);
    font-family: var(--mono);
    margin-top: 0.25rem;
}

/* PAGINATION */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}
.pagination a, .pagination span {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-dim);
    transition: all 0.2s;
}
.pagination a:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.pagination .current {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

/* DELETED PAGE */
.message-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3rem;
    text-align: center;
    margin-top: 4rem;
}
.message-box h2 { margin-bottom: 1rem; }
.message-box p { color: var(--text-dim); }

/* FOOTER */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-dim);
    font-size: 0.75rem;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
    font-family: var(--mono);
}

/* TOAST */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--surface-2);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 0.75rem 1.25rem;
    font-size: 0.85rem;
    color: var(--accent);
    font-family: var(--mono);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    z-index: 1000;
}
.toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* RESPONSIVE */
@media (max-width: 640px) {
    .nav { padding: 0.75rem 1rem; }
    .container, .container-wide { padding: 1rem; }
    .upload-zone { padding: 2rem 1rem; }
    .stats { gap: 1rem; }
    .meta-grid { grid-template-columns: 1fr 1fr; }
    .share-row { flex-wrap: wrap; }
    .share-label { min-width: 100%; }
    .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
