:root {
    --bg: #121216;
    --sidebar: #17171d;
    --card: #1e1e26;
    --text: #f2f2f7;
    --muted: #9a9aab;
    --accent: #7c6cff;
    --accent-soft: rgba(124, 108, 255, 0.15);
    --border: #2e2e3a;
    --danger: #ff6b6b;
    --radius: 14px;
}

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

html, body {
    min-height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: radial-gradient(1200px 600px at 80% -10%, #241f4d 0%, var(--bg) 55%);
    color: var(--text);
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 12px;
}

.error {
    color: var(--danger);
    font-size: 13px;
    margin-bottom: 10px;
}

.app {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.logo {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-align: center;
}

.logo span {
    color: var(--accent);
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-links a {
    color: var(--text);
    text-decoration: none;
    font-size: 16px;
    padding: 11px 12px;
    border-radius: 9px;
    transition: background 0.2s, color 0.2s;
}

.nav-links a:hover {
    background: #23232d;
}

.nav-links a.active {
    background: var(--accent-soft);
    color: #cfc9ff;
    font-weight: 600;
}

.sidebar-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.main {
    flex: 1;
    min-width: 0;
    padding: 32px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-head {
    margin-bottom: 22px;
}

.page-head h1 {
    font-size: 28px;
    margin-bottom: 4px;
}

.section-title {
    font-size: 20px;
    margin: 36px 0 16px;
}

.search-bar {
    width: 100%;
    max-width: 640px;
    padding: 14px 20px;
    border: 1px solid var(--border);
    border-radius: 30px;
    background: #202028;
    color: var(--text);
    font-size: 15px;
    outline: none;
    margin-bottom: 24px;
}

.search-bar:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.photo-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.25s, border-color 0.25s;
}

.photo-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent);
}

.photo-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    background: #0f0f14;
}

.photo-info {
    padding: 14px;
}

.photo-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.photo-top h4 {
    font-size: 15px;
    line-height: 1.3;
}

.fav-btn {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}

.fav-btn:hover {
    color: #ffd166;
}

.fav-btn.active {
    color: #ffd166;
}

.photo-likes {
    display: flex;
    gap: 14px;
    margin-top: 10px;
    font-size: 13px;
    color: var(--muted);
}

.model-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.model-tab {
    padding: 9px 18px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    transition: 0.2s;
}

.model-tab:hover {
    border-color: var(--accent);
}

.model-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

.notice {
    background: var(--accent-soft);
    border: 1px solid rgba(124, 108, 255, 0.35);
    color: #cfc9ff;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    max-width: 720px;
}

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 36px;
    text-align: center;
    cursor: pointer;
    background: #191921;
    margin-bottom: 18px;
    transition: 0.2s;
    outline: none;
}

.upload-zone:hover,
.upload-zone:focus-visible {
    border-color: var(--accent);
    background: #1d1b2b;
}

.upload-zone.locked {
    cursor: default;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 720px;
}

.upload-preview {
    max-width: 100%;
    max-height: 260px;
    border-radius: 10px;
    margin-top: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
    font-size: 14px;
    color: var(--muted);
    max-width: 480px;
}

.text-input {
    background: #202028;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    width: 100%;
}

.text-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.consent {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    max-width: 560px;
    margin: 6px 0 18px;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
}

.consent input {
    margin-top: 3px;
    accent-color: var(--accent);
}

.btn {
    padding: 11px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    background: var(--accent);
    color: #fff;
    transition: 0.2s;
}

.btn:hover {
    filter: brightness(1.12);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: #cfc9ff;
    background: var(--accent-soft);
}

.btn-danger {
    background: transparent;
    border: 1px solid rgba(255, 107, 107, 0.5);
    color: var(--danger);
}

.profile-header {
    display: flex;
    gap: 28px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    background: #222;
}

.profile-info {
    flex: 1;
    min-width: 240px;
}

.profile-stats {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    color: var(--muted);
    margin-top: 10px;
    font-size: 14px;
}

.profile-actions {
    margin-top: 18px;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 26px;
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    width: 100%;
    margin-top: 12px;
}

.auth-tabs {
    display: flex;
    gap: 8px;
    margin: 16px 0 18px;
    background: #16161c;
    padding: 4px;
    border-radius: 10px;
}

.auth-tab {
    flex: 1;
    padding: 9px;
    background: transparent;
    border: none;
    color: var(--muted);
    cursor: pointer;
    border-radius: 8px;
    font-weight: 600;
    font-family: inherit;
    font-size: 14px;
}

.auth-tab.active {
    background: var(--accent);
    color: #fff;
}

.auth-hint {
    margin-top: 12px;
}

.post-modal-card {
    max-width: 860px;
}

.post-image {
    width: 100%;
    max-height: 52vh;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 16px;
    background: #0f0f14;
}

.post-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
}

.post-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.comment-section {
    margin-top: 18px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

.comment-section h4 {
    margin-bottom: 8px;
}

.comment {
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid #26262f;
}

.comment-input {
    width: 100%;
    padding: 11px 13px;
    background: #202028;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 10px;
    margin-top: 10px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
}

.comment-input:focus {
    border-color: var(--accent);
}

.empty {
    color: var(--muted);
    font-size: 14px;
    padding: 16px 0;
}

.site-footer {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.ad-slot {
    width: 100%;
    max-width: 970px;
    min-height: 120px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    background: #17171d;
    color: var(--muted);
    font-size: 13px;
    overflow: hidden;
}

@media (max-width: 860px) {
    .app {
        flex-direction: column;
    }

    .sidebar {
        position: static;
        width: 100%;
        height: auto;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 14px;
        padding: 14px 18px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .logo {
        font-size: 20px;
    }

    .nav-links {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
    }

    .nav-links a {
        padding: 8px 10px;
        font-size: 14px;
    }

    .sidebar-footer {
        margin-top: 0;
        flex-direction: row;
        align-items: center;
    }

    #sidebar-user {
        display: none;
    }

    .main {
        padding: 20px 16px;
    }
}
