/* Nebula UI refresh · themes, typography, mobile, forum editor */

body[data-theme="light"] {
    --bg: #f6f7fb;
    --bg-deep: #eceef5;
    --sidebar: #ffffff;
    --sidebar-deep: #f1f3f9;
    --panel: #ffffff;
    --panel-raised: #f7f8fc;
    --panel-soft: #eef1f8;
    --input: #f1f3f9;
    --text: #151824;
    --text-soft: #303646;
    --muted: #5c6475;
    --faint: #717a8c;
    --line: rgba(20, 25, 40, .1);
    --line-strong: rgba(20, 25, 40, .18);
    --shadow: 0 18px 55px rgba(35, 42, 65, .14);
    background: #f6f7fb;
    color: #151824;
}

body[data-theme="gradient"] {
    --bg: #0b1020;
    --bg-deep: #070b16;
    --sidebar: #131a30;
    --sidebar-deep: #0e1426;
    --panel: #17213b;
    --panel-raised: #1d2947;
    --panel-soft: #223053;
    --input: #0e1528;
    --blurple: #8b5cf6;
    --blurple-hover: #7c3aed;
    --blurple-soft: rgba(139, 92, 246, .18);
    background:
        radial-gradient(900px 520px at 15% -10%, rgba(139, 92, 246, .3), transparent 60%),
        radial-gradient(760px 480px at 100% 10%, rgba(236, 72, 153, .18), transparent 65%),
        #0b1020;
}

body[data-theme="glass"] {
    --bg: #111827;
    --bg-deep: #0b1220;
    --sidebar: rgba(25, 34, 54, .72);
    --sidebar-deep: rgba(17, 24, 39, .62);
    --panel: rgba(30, 41, 59, .62);
    --panel-raised: rgba(51, 65, 85, .58);
    --panel-soft: rgba(71, 85, 105, .45);
    --input: rgba(15, 23, 42, .58);
    --line: rgba(255, 255, 255, .12);
    --line-strong: rgba(255, 255, 255, .2);
    background:
        radial-gradient(760px 500px at 20% 0, rgba(56, 189, 248, .2), transparent 65%),
        radial-gradient(700px 500px at 100% 100%, rgba(167, 139, 250, .2), transparent 65%),
        #111827;
}

body[data-theme="glass"] .sidebar,
body[data-theme="glass"] .chat-main,
body[data-theme="glass"] .auth-card,
body[data-theme="glass"] .modal,
body[data-theme="glass"] .admin-panel,
body[data-theme="glass"] .admin-topbar {
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

body[data-theme="gradient"] .auth-shell,
body[data-theme="gradient"] .app,
body[data-theme="glass"] .auth-shell,
body[data-theme="glass"] .app {
    background: transparent;
}

body[data-theme="light"] .auth-shell,
body[data-theme="light"] .app {
    background: #f6f7fb;
}

body[data-theme="light"] .sidebar,
body[data-theme="light"] .chat-main,
body[data-theme="light"] .modal,
body[data-theme="light"] .admin-panel {
    color: #151824;
}

body[data-theme="light"] .auth-hero h1,
body[data-theme="light"] .auth-card h2,
body[data-theme="light"] .channel-head h1,
body[data-theme="light"] .admin-hero h1 {
    color: #151824;
}

body[data-theme="light"] .auth-lead,
body[data-theme="light"] .auth-footnote,
body[data-theme="light"] .sidebar-empty {
    color: #5c6475;
}

body[data-theme="light"] .message-text,
body[data-theme="light"] .admin-message-text {
    color: #202635;
}

/* Modern, airy AI-landing feel for the auth/home screen */
.auth-hero h1 {
    max-width: 12ch;
    letter-spacing: -.055em;
    line-height: 1.04;
}

.auth-hero h1 span {
    background: linear-gradient(100deg, var(--blurple), #eb459e 60%, #f0b232);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-layout {
    gap: clamp(28px, 5vw, 80px);
}

.auth-card {
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.auth-art {
    opacity: .62;
}

.message-text {
    font-size: var(--chat-font-size, 15px);
}

.author-suffix {
    margin-left: 3px;
    color: #f0b232;
    font-size: .82em;
    filter: drop-shadow(0 0 4px rgba(240, 178, 50, .4));
}

.btn {
    font-size: calc(13px * var(--button-scale, 1));
    padding: calc(9px * var(--button-scale, 1)) calc(18px * var(--button-scale, 1));
}

.btn-small {
    font-size: calc(11px * var(--button-scale, 1));
    padding: calc(7px * var(--button-scale, 1)) calc(12px * var(--button-scale, 1));
}

.icon-btn {
    min-width: calc(32px * var(--button-scale, 1));
    min-height: calc(32px * var(--button-scale, 1));
}

/* Forum editor */
.forum-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 2px 0 6px;
}

.forum-editor-toolbar button {
    min-width: 30px;
    height: 28px;
    padding: 0 7px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 6px;
    background: rgba(255, 255, 255, .04);
    color: #c9ced8;
    font-size: 11px;
    cursor: pointer;
}

.forum-editor-toolbar button:hover {
    border-color: rgba(139, 92, 246, .45);
    background: rgba(139, 92, 246, .12);
}

body[data-theme="light"] .forum-editor-toolbar button {
    border-color: rgba(20, 25, 40, .14);
    background: #f1f3f9;
    color: #303646;
}

/* Mobile / touch */
@media (max-width: 760px) {
    .auth-layout {
        gap: 18px;
        padding: 18px;
    }

    .auth-hero h1 {
        font-size: clamp(28px, 8vw, 42px);
    }

    .auth-card {
        border-radius: 18px;
        padding: 18px;
    }

    .auth-art {
        display: none;
    }

    .sidebar {
        width: min(84vw, 300px);
    }

    .icon-btn,
    .btn,
    .btn-small,
    .auth-tab,
    .emoji-item {
        min-height: 42px;
    }

    .chat-input,
    .message-input,
    textarea {
        font-size: 16px;
    }

    .admin-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }

    .admin-tab {
        flex: 0 0 auto;
        padding: 10px 12px;
    }

    .admin-topbar,
    .forum-topbar,
    .album-topbar,
    .download-topbar {
        padding-left: 12px;
        padding-right: 12px;
    }

    .forum-form-row,
    .album-form-row,
    .download-form-row {
        grid-template-columns: 1fr;
    }

    .table-wrap {
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .auth-shell {
        padding: 10px;
    }

    .auth-hero {
        text-align: left;
    }

    .feature-pills {
        gap: 5px;
    }

    .feature-pills span {
        font-size: 9px;
    }

    .admin-main {
        padding-left: 10px;
        padding-right: 10px;
    }
}
