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

:root {
    color-scheme: dark;
    --app-bg: #0f1115;
    --panel-bg: rgba(24, 24, 27, 1);
    --panel-border: rgba(63, 63, 70, 0.86);
    --text-main: #f4f4f5;
    --text-muted: #a1a1aa;
    --text-soft: #71717a;
    --hover-bg: rgba(24, 24, 27, 0.34);
    --field-bg: rgba(9, 9, 11, 0.86);
}

html[data-theme="light"] {
    color-scheme: light;
    --app-bg: #f8fafc;
    --panel-bg: #ffffff;
    --panel-border: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-soft: #64748b;
    --hover-bg: #f1f5f9;
    --field-bg: #ffffff;
}

@media (prefers-color-scheme: light) {
    html[data-theme="system"] {
        color-scheme: light;
        --app-bg: #f8fafc;
        --panel-bg: #ffffff;
        --panel-border: #e2e8f0;
        --text-main: #0f172a;
        --text-muted: #475569;
        --text-soft: #64748b;
        --hover-bg: #f1f5f9;
        --field-bg: #ffffff;
    }
}

html[data-theme="light"] header,
html[data-theme="light"] .bg-zinc-950,
html[data-theme="light"] .bg-zinc-950\/90,
html[data-theme="light"] .bg-zinc-950\/80,
html[data-theme="light"] .bg-zinc-900,
html[data-theme="light"] .bg-zinc-900\/40,
html[data-theme="light"] .bg-zinc-900\/50,
html[data-theme="light"] .bg-zinc-900\/60,
html[data-theme="system"] header,
html[data-theme="system"] .bg-zinc-950,
html[data-theme="system"] .bg-zinc-950\/90,
html[data-theme="system"] .bg-zinc-950\/80,
html[data-theme="system"] .bg-zinc-900,
html[data-theme="system"] .bg-zinc-900\/40,
html[data-theme="system"] .bg-zinc-900\/50,
html[data-theme="system"] .bg-zinc-900\/60 {
    background-color: var(--panel-bg) !important;
}

html[data-theme="light"] .text-white,
html[data-theme="light"] .text-zinc-100,
html[data-theme="light"] .text-zinc-200,
html[data-theme="system"] .text-white,
html[data-theme="system"] .text-zinc-100,
html[data-theme="system"] .text-zinc-200 {
    color: var(--text-main) !important;
}

html[data-theme="light"] .text-zinc-300,
html[data-theme="light"] .text-zinc-400,
html[data-theme="light"] .text-zinc-500,
html[data-theme="system"] .text-zinc-300,
html[data-theme="system"] .text-zinc-400,
html[data-theme="system"] .text-zinc-500 {
    color: var(--text-muted) !important;
}

html[data-theme="light"] .border-zinc-800,
html[data-theme="light"] .border-zinc-900,
html[data-theme="system"] .border-zinc-800,
html[data-theme="system"] .border-zinc-900 {
    border-color: var(--panel-border) !important;
}

* {
    box-sizing: border-box;
}

body {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
    background:
        radial-gradient(circle at 15% 0%, rgba(245, 158, 11, 0.12), transparent 28rem),
        radial-gradient(circle at 90% 15%, rgba(20, 184, 166, 0.10), transparent 24rem),
        var(--app-bg);
    color: var(--text-main);
}

.bee-gradient {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.surface-panel {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.24);
}

.metric-tile {
    min-height: 82px;
    border: 1px solid rgba(63, 63, 70, 0.8);
    background: rgba(24, 24, 27, 0.58);
    border-radius: 12px;
    padding: 14px;
}

.metric-tile strong,
.metric-tile span {
    display: block;
}

.metric-tile strong {
    color: white;
    font-size: 0.95rem;
}

.metric-tile span {
    color: #a1a1aa;
    font-size: 0.78rem;
    margin-top: 0.2rem;
}

.auth-tab,
.nav-item,
.mobile-nav,
.icon-button,
.menu-item,
.profile-pill,
.primary-button,
.secondary-button {
    transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.auth-tab {
    height: 2.5rem;
    border-radius: 0.6rem;
    color: #a1a1aa;
    font-weight: 700;
    font-size: 0.9rem;
}

.auth-tab.active {
    background: #f59e0b;
    color: #18181b;
}

.field-label {
    display: block;
    margin-bottom: 0.45rem;
    color: #a1a1aa;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.field-input,
.search-input {
    width: 100%;
    border: 1px solid #27272a;
    background: var(--field-bg);
    color: var(--text-main);
    border-radius: 0.85rem;
    outline: none;
}

.field-input {
    padding: 0.78rem 1rem;
}

.search-input {
    padding: 0.50rem 0.50rem 0.50rem 2.5rem;
    border-radius: 999px;
}

.field-input:focus,
.search-input:focus,
.composer-input:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.5);
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 999px;
    padding: 0.3rem 1rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #18181b;
    font-weight: 900;
}

.primary-button:hover {
    opacity: 0.9;
}

.primary-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.secondary-button {
    border: 1px solid #52525b;
    color: white;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.82rem;
    min-height: 2.4rem;
    padding: 0.5rem 1rem;
}

.secondary-button:hover {
    border-color: #f59e0b;
    color: #fbbf24;
}

.danger-button {
    display: inline-flex;
    min-height: 2.6rem;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid rgba(244, 63, 94, 0.45);
    border-radius: 999px;
    background: rgba(244, 63, 94, 0.12);
    color: #fb7185;
    font-size: 0.85rem;
    font-weight: 900;
    padding: 0.6rem 1rem;
}

.danger-button:hover {
    border-color: rgba(244, 63, 94, 0.72);
    background: rgba(244, 63, 94, 0.18);
}

.danger-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.alert-box {
    border-radius: 0.85rem;
    padding: 0.8rem 0.95rem;
    margin-bottom: 1rem;
    font-size: 0.82rem;
}

.alert-error {
    background: rgba(76, 5, 25, 0.42);
    border: 1px solid rgba(159, 18, 57, 0.7);
    color: #fda4af;
}

.alert-success {
    background: rgba(6, 78, 59, 0.34);
    border: 1px solid rgba(5, 150, 105, 0.6);
    color: #86efac;
}

.nav-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #4f4f54;
    border-radius: 0.85rem;
    padding: 0.78rem 1rem;
    text-align: left;
    font-weight: 700;
}

.nav-item i {
    width: 1.25rem;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(39, 39, 42, 0.8);
    color: #fbbf24;
}

.mobile-nav {
    width: 2.5rem;
    height: 2.5rem;
    display: grid;
    place-items: center;
    color: #71717a;
    border-radius: 999px;
}

.mobile-nav.active,
.mobile-nav:hover {
    color: #fbbf24;
    background: rgba(39, 39, 42, 0.8);
}

.icon-button {
    width: 2.3rem;
    height: 2.3rem;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    color: #a1a1aa;
}

.icon-button:hover {
    color: #fbbf24;
    background: rgba(39, 39, 42, 0.82);
}

.profile-pill {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid #27272a;
    background: rgba(24, 24, 27, 0.86);
    border-radius: 999px;
    padding: 0.25rem 0.65rem 0.25rem 0.75rem;
    color: #d4d4d8;
    font-size: 0.8rem;
    font-weight: 700;
}

.profile-pill:hover {
    border-color: #52525b;
}

.avatar-sm,
.avatar-md,
.avatar-xl {
    border-radius: 999px;
    object-fit: cover;
    background: #27272a;
    border: 1px solid rgba(245, 158, 11, 0.45);
}

.avatar-sm {
    width: 2rem;
    height: 2rem;
}

.avatar-md {
    width: 2.75rem;
    height: 2.75rem;
}

.avatar-xl {
    width: 6rem;
    height: 6rem;
    border-width: 4px;
    border-color: #0f1115;
}

.menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    text-align: left;
}

.menu-item i {
    width: 1.2rem;
    color: #71717a;
}

.menu-item:hover {
    background: rgba(39, 39, 42, 0.82);
    color: #fbbf24;
}

.composer-input {
    width: 100%;
    resize: none;
    border: 1px solid transparent;
    background: transparent;
    color: white;
    border-radius: 0.8rem;
    outline: none;
    padding: 0.5rem;
}

.post-card {
    display: flex;
    gap: 0.8rem;
    padding: 1rem;
}

.post-card:hover {
    background: var(--hover-bg);
}

.post-body {
    min-width: 0;
    flex: 1;
}

.post-meta {
    color: #71717a;
    font-size: 0.82rem;
    margin-left: 0.25rem;
}

.post-text {
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    margin-top: 0.25rem;
}

.post-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.75rem;
    color: #71717a;
    font-size: 0.85rem;
}

.post-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2rem;
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 800;
}

.post-action:hover,
.post-action.active {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.1);
}

.post-stat {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.35rem 0.45rem;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 700;
}

.post-menu-wrap {
    position: relative;
    flex-shrink: 0;
}

.post-menu-trigger {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: var(--text-muted);
}

.post-menu-trigger:hover {
    background: #27272a;
    color: #fbbf24;
}

.post-menu {
    position: absolute;
    top: 2.25rem;
    right: 0;
    width: 10rem;
    z-index: 30;
    overflow: hidden;
    border: 1px solid var(--panel-border);
    border-radius: 0.85rem;
    background: var(--panel-bg);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.post-menu button {
    width: 100%;
    min-height: 2.55rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    color: var(--text-main);
    font-size: 0.85rem;
    text-align: left;
}

.post-menu button:hover {
    background: var(--hover-bg);
}

.post-menu button i {
    width: 1rem;
    color: var(--text-soft);
}

.post-menu .danger {
    color: #fb7185;
}

.comment-thread {
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid #27272a;
}

.comment-form {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
}

.comment-compose {
    flex: 1;
    min-width: 0;
}

.comment-input {
    width: 100%;
    min-height: 2.25rem;
    resize: vertical;
    border: 0;
    border-bottom: 1px solid #3f3f46;
    background: transparent;
    color: #f4f4f5;
    outline: none;
    padding: 0.35rem 0;
    font-size: 0.9rem;
}

.comment-input:focus {
    border-bottom-color: #f59e0b;
}

.comment-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.45rem;
    margin-top: 0.45rem;
}

.comment-cancel,
.comment-submit,
.comment-action {
    min-height: 2rem;
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 800;
}

.comment-cancel {
    color: #d4d4d8;
}

.comment-cancel:hover,
.comment-action:hover {
    background: #27272a;
}

.comment-submit {
    background: #f59e0b;
    color: #18181b;
}

.comment-list {
    margin-top: 1rem;
    display: grid;
    gap: 0.85rem;
}

.comment-empty {
    color: #71717a;
    font-size: 0.85rem;
    padding-left: 2.7rem;
}

.comment-card {
    display: flex;
    gap: 0.7rem;
    align-items: flex-start;
}

.comment-body {
    flex: 1;
    min-width: 0;
}

.comment-bubble {
    color: var(--text-main);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
}

.comment-header strong {
    color: var(--text-main);
}

.comment-header span {
    color: #71717a;
}

.comment-bubble p {
    margin-top: 0.2rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 0.9rem;
    line-height: 1.45;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    margin-top: 0.25rem;
    color: #a1a1aa;
}

.comment-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.comment-action.active {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.1);
}

.reply-action {
    color: #d4d4d8;
}

.reply-form {
    margin-top: 0.6rem;
}

.reply-list {
    display: grid;
    gap: 0.8rem;
    margin-top: 0.8rem;
    padding-left: 0.4rem;
}

.status-line {
    padding: 0 1rem;
    border-bottom: 8px solid #747272;
}

.view-title {
    color: white;
    font-size: 1.45rem;
    font-weight: 900;
}

.view-copy {
    color: #a1a1aa;
    font-size: 0.92rem;
    margin-top: 0.25rem;
}

.empty-state {
    min-height: 18rem;
    display: grid;
    place-items: center;
    text-align: center;
    color: #a1a1aa;
    border: 1px solid #27272a;
    border-radius: 1rem;
    padding: 2rem;
}

.empty-state h2 {
    color: white;
    font-weight: 800;
    margin-top: 0.8rem;
}

.empty-state p {
    max-width: 24rem;
    font-size: 0.92rem;
    margin-top: 0.35rem;
}

.widget-title {
    color: #d4d4d8;
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 900;
    margin-bottom: 0.85rem;
}

.person-row,
.trend-row,
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
}

.person-row {
    padding: 0.25rem 0;
}

.settings-row {
    padding: 1rem;
}

.settings-row strong,
.settings-row span {
    display: block;
}

.settings-row span {
    color: #a1a1aa;
    font-size: 0.85rem;
    margin-top: 0.2rem;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 5rem;
    transform: translateX(-50%);
    background: #18181b;
    color: white;
    border: 1px solid #3f3f46;
    border-radius: 999px;
    padding: 0.8rem 1rem;
    z-index: 60;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.28);
}

.verification-code-input {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 0.12em;
}

html[data-theme="light"] .app-shell {
    background: var(--app-bg);
}

html[data-theme="light"] header,
html[data-theme="light"] nav.fixed {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

html[data-theme="light"] main.border-x,
html[data-theme="light"] .border-b,
html[data-theme="light"] .border-t,
html[data-theme="light"] .divide-y > :not([hidden]) ~ :not([hidden]) {
    border-color: #e2e8f0 !important;
}

html[data-theme="light"] .surface-panel {
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

html[data-theme="light"] .metric-tile,
html[data-theme="light"] .empty-state {
    background: #ffffff;
    border-color: #e2e8f0;
}

html[data-theme="light"] .metric-tile strong,
html[data-theme="light"] .view-title,
html[data-theme="light"] .empty-state h2,
html[data-theme="light"] .widget-title,
html[data-theme="light"] .composer-input,
html[data-theme="light"] .comment-input,
html[data-theme="light"] .profile-pill,
html[data-theme="light"] .secondary-button,
html[data-theme="light"] .comment-cancel,
html[data-theme="light"] .reply-action {
    color: #0f172a;
}
html[data-theme="light"] .status-line {
    border-bottom: 8px solid #e5e3e3;
}
html[data-theme="light"] .metric-tile span,
html[data-theme="light"] .field-label,
html[data-theme="light"] .view-copy,
html[data-theme="light"] .settings-row span,
html[data-theme="light"] .status-line,
html[data-theme="light"] .comment-empty,
html[data-theme="light"] .comment-header span,
html[data-theme="light"] .post-meta {
    color: #64748b;
}

html[data-theme="light"] .field-input,
html[data-theme="light"] .search-input,
html[data-theme="light"] .profile-pill {
    border-color: #cbd5e1;
    background: #ffffff;
}

html[data-theme="light"] .auth-tab {
    color: #64748b;
}

html[data-theme="light"] .auth-tab.active,
html[data-theme="light"] .primary-button,
html[data-theme="light"] .comment-submit {
    background: #f59e0b;
    color: #111827;
}

html[data-theme="light"] .nav-item:hover,
html[data-theme="light"] .nav-item.active,
html[data-theme="light"] .mobile-nav.active,
html[data-theme="light"] .mobile-nav:hover,
html[data-theme="light"] .icon-button:hover,
html[data-theme="light"] .menu-item:hover,
html[data-theme="light"] .post-menu-trigger:hover,
html[data-theme="light"] .comment-cancel:hover,
html[data-theme="light"] .comment-action:hover {
    background: #f1f5f9;
}

html[data-theme="light"] .post-card:hover {
    background: #f8fafc;
}

html[data-theme="light"] .avatar-xl {
    border-color: #ffffff;
}

html[data-theme="light"] .alert-error {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
}

html[data-theme="light"] .alert-success {
    background: #ecfdf5;
    border-color: #bbf7d0;
    color: #047857;
}

html[data-theme="light"] .toast {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
}

html[data-theme="light"] .danger-zone {
    border-color: #fecdd3;
}

html[data-theme="light"] .danger-button {
    background: #fff1f2;
    color: #be123c;
    border-color: #fecdd3;
}

@media (prefers-color-scheme: light) {
    html[data-theme="system"] .app-shell {
        background: var(--app-bg);
    }

    html[data-theme="system"] header,
    html[data-theme="system"] nav.fixed {
        background: rgba(255, 255, 255, 0.9) !important;
        border-color: #e2e8f0 !important;
        box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
    }

    html[data-theme="system"] main.border-x,
    html[data-theme="system"] .border-b,
    html[data-theme="system"] .border-t,
    html[data-theme="system"] .divide-y > :not([hidden]) ~ :not([hidden]) {
        border-color: #e2e8f0 !important;
    }

    html[data-theme="system"] .surface-panel {
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    }

    html[data-theme="system"] .metric-tile,
    html[data-theme="system"] .empty-state {
        background: #ffffff;
        border-color: #e2e8f0;
    }

    html[data-theme="system"] .metric-tile strong,
    html[data-theme="system"] .view-title,
    html[data-theme="system"] .empty-state h2,
    html[data-theme="system"] .widget-title,
    html[data-theme="system"] .composer-input,
    html[data-theme="system"] .comment-input,
    html[data-theme="system"] .profile-pill,
    html[data-theme="system"] .secondary-button,
    html[data-theme="system"] .comment-cancel,
    html[data-theme="system"] .reply-action {
        color: #0f172a;
    }

    html[data-theme="system"] .metric-tile span,
    html[data-theme="system"] .field-label,
    html[data-theme="system"] .view-copy,
    html[data-theme="system"] .settings-row span,
    html[data-theme="system"] .status-line,
    html[data-theme="system"] .comment-empty,
    html[data-theme="system"] .comment-header span,
    html[data-theme="system"] .post-meta {
        color: #64748b;
    }

    html[data-theme="system"] .field-input,
    html[data-theme="system"] .search-input,
    html[data-theme="system"] .profile-pill {
        border-color: #cbd5e1;
        background: #ffffff;
    }

    html[data-theme="system"] .auth-tab {
        color: #64748b;
    }

    html[data-theme="system"] .auth-tab.active,
    html[data-theme="system"] .primary-button,
    html[data-theme="system"] .comment-submit {
        background: #f59e0b;
        color: #111827;
    }

    html[data-theme="system"] .nav-item:hover,
    html[data-theme="system"] .nav-item.active,
    html[data-theme="system"] .mobile-nav.active,
    html[data-theme="system"] .mobile-nav:hover,
    html[data-theme="system"] .icon-button:hover,
    html[data-theme="system"] .menu-item:hover,
    html[data-theme="system"] .post-menu-trigger:hover,
    html[data-theme="system"] .comment-cancel:hover,
    html[data-theme="system"] .comment-action:hover {
        background: #f1f5f9;
    }

    html[data-theme="system"] .post-card:hover {
        background: #f8fafc;
    }

    html[data-theme="system"] .avatar-xl {
        border-color: #ffffff;
    }

    html[data-theme="system"] .alert-error {
        background: #fff1f2;
        border-color: #fecdd3;
        color: #be123c;
    }

    html[data-theme="system"] .alert-success {
        background: #ecfdf5;
        border-color: #bbf7d0;
        color: #047857;
    }

    html[data-theme="system"] .toast {
        background: #ffffff;
        color: #0f172a;
        border-color: #cbd5e1;
    }

    html[data-theme="system"] .danger-zone {
        border-color: #fecdd3;
    }

    html[data-theme="system"] .danger-button {
        background: #fff1f2;
        color: #be123c;
        border-color: #fecdd3;
    }
}

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

    .metric-tile strong {
        font-size: 0.82rem;
    }

    .metric-tile span {
        font-size: 0.68rem;
    }
}
