:root {
    --bg-base: #09090b;
    --bg-surface: #121215;
    --bg-surface-hover: #18181b;
    --border: #27272a;
    --border-focus: #6366f1;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --text-primary: #f4f4f5;
    --text-muted: #a1a1aa;
    --radius-lg: 16px;
    --radius-md: 10px;
    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Навигация */
.navbar {
    background: rgba(18, 18, 21, 0.75);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--accent);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.limit-badge {
    background: rgba(99, 102, 241, 0.1);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.25);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

/* Кнопки */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-accent {
    background: var(--text-primary);
    color: #000;
}
.btn-accent:hover { background: #e4e4e7; }

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-outline:hover { background: var(--bg-surface-hover); }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text-primary); }

/* Hero & Uploader */
.hero-section {
    padding: 50px 20px 40px;
    text-align: center;
}

.hero-title {
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 10px;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 36px;
}

.uploader-card {
    background: var(--bg-surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 48px 24px;
    max-width: 720px;
    margin: 0 auto 50px;
    position: relative;
    transition: all 0.2s ease;
}

.uploader-card.dragover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.05);
    transform: scale(1.01);
}

.file-hidden { display: none; }

.icon-circle {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    color: var(--accent);
}

.dropzone-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.dropzone-hint {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

kbd {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 12px;
}

.uploader-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.url-input-wrap {
    display: flex;
    gap: 8px;
    max-width: 500px;
    margin: 20px auto 0;
}

.input-text {
    flex: 1;
    background: #000;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    outline: none;
    font-family: inherit;
}
.input-text:focus { border-color: var(--accent); }

.hidden { display: none !important; }

/* Прогресс-бар */
.upload-progress-list {
    margin-top: 24px;
    text-align: left;
}

.progress-item {
    background: #000;
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    border: 1px solid var(--border);
}

.progress-bar {
    height: 6px;
    background: var(--accent);
    border-radius: 3px;
    width: 0%;
    transition: width 0.2s ease;
    margin-top: 8px;
}

/* Табы */
.gallery-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    justify-content: flex-start;
}

.tab-btn {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.tab-btn.active {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

/* Сетка галереи */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 60px;
}

.gallery-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-surface);
    aspect-ratio: 1 / 1;
    display: block;
    border: 1px solid var(--border);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.gallery-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    padding: 8px 12px;
    font-size: 12px;
    color: #fff;
    display: flex;
    justify-content: flex-end;
}

/* Страница просмотра изображения */
.view-section {
    padding: 40px 20px 60px;
}

.image-viewer-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.image-display-box {
    text-align: center;
    background: #000;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
}

.image-display-box img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
    object-fit: contain;
}

.image-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px;
}

.meta-tags {
    display: flex;
    gap: 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.codes-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.code-field label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.copy-input {
    display: flex;
    gap: 8px;
}

.copy-input input {
    flex: 1;
    background: #000;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    color: var(--text-primary);
    font-family: monospace;
    font-size: 13px;
    outline: none;
}

/* Формы авторизации */
.auth-container {
    max-width: 440px;
    margin: 60px auto;
}

.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
}

.auth-card h2 {
    font-size: 24px;
    margin-bottom: 6px;
}

.auth-sub {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.btn-block {
    width: 100%;
    margin-top: 8px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: 16px;
}

.auth-footer-text {
    margin-top: 20px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

.auth-footer-text a {
    color: var(--accent);
    text-decoration: none;
}

/* Админка */
.admin-container {
    padding: 40px 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.stat-badge {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.admin-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px;
}

.admin-thumb img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 6px;
}

.admin-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin: 8px 0;
    color: var(--text-muted);
}

.admin-actions {
    display: flex;
    gap: 6px;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 11px;
}

.btn-danger {
    background: #ef4444;
    color: #fff;
}
.btn-danger:hover {
    background: #dc2626;
}