* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--fg);
    font-weight: 600;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}

button,
input,
textarea {
    font-family: inherit;
}

:root {
    --bg: #0b0f1a;
    --fg: #e9ecf6;
    --card: rgba(255, 255, 255, .06);
    --card2: rgba(255, 255, 255, .08);
    --line: rgba(255, 255, 255, .1);
    --muted: #a0a0a0;
    --muted2: #808080;
    --brand: #9bb0ff;
    --good: #52d38a;
    --bad: #ff6b6b;
    --shadow: 0 10px 30px rgba(0, 0, 0, .4);
    --r: 18px;
    --th: 72px;
}

body.light {
    background: #f0f0f0;
    background-attachment: fixed;
    background-size: cover;
    color: #333333;
    font-weight: 600;
}

body.light {
    --bg: #f5f6f8;
    --fg: #1a1f2c;
    --card: #ffffff;
    --card2: #f8f9fa;
    --line: rgba(0, 0, 0, 0.08);
    --muted: #64748b;
    --muted2: #475569;
}

body.light .item {
    background: rgba(0, 0, 0, 0.03);
}

body.light .item:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.light .item.unread {
    background: rgba(155, 176, 255, 0.08);
}

.container {
    width: 100%;
    margin: 0;
    padding: 14px 14px 26px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(20px);
    background: rgba(10, 14, 25, .88);
    border-bottom: 1px solid var(--line);
    min-height: var(--th);
    display: flex;
    align-items: center;
    color: #e9ecf6
}

body.light .topbar {
    background: rgba(255, 255, 255, .8);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    color: #151a2b
}

.topbar .container {
    padding-top: 0;
    padding-bottom: 0;
}

.topbar .row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    min-height: var(--th);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    letter-spacing: .2px
}

.logo {
    width: 50px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, #9bb0ff, #c8a9ff);
    box-shadow: 0 10px 30px rgba(155, 176, 255, .35);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden
}

.nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

.nav a {
    padding: 8px 10px;
    border-radius: 999px;
    color: var(--muted);
    border: 1px solid transparent
}

.nav a:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff
}

.nav a.active {
    background: rgba(155, 176, 255, .18);
    border-color: rgba(155, 176, 255, .35);
    color: #fff
}

body.light .nav a:hover {
    background: rgba(0, 0, 0, .04);
    color: #000;
}

body.light .nav a.active {
    background: #4a6fff;
    border-color: #4a6fff;
    color: #fff;
}

.actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-wrap: wrap
}

.mobile-create-topic {
    display: none;
}

.pill {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .05);
    border-radius: 999px;
    padding: 8px 10px;
    min-width: 220px;
    flex: 1 1 220px
}

.pill input {
    border: none;
    outline: none;
    background: transparent;
    color: inherit;
    width: 100%;
    min-width: 0
}

.iconbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--card);
    cursor: pointer;
    color: #fff;
    transition: all 0.2s;
}

.iconbtn:hover {
    background: rgba(255, 255, 255, .15);
    transform: translateY(-1px);
}

body.light .iconbtn {
    color: var(--fg);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--card);
    cursor: pointer;
    color: inherit
}

.btn:hover {
    background: rgba(255, 255, 255, .1)
}

.btn.primary {
    background: rgba(155, 176, 255, .22);
    border-color: rgba(155, 176, 255, .45)
}

.btn.primary:hover {
    background: rgba(155, 176, 255, .28)
}

.btn.bad {
    background: rgba(255, 107, 107, .18);
    border-color: rgba(255, 107, 107, .38)
}

.btn.bad:hover {
    background: rgba(255, 107, 107, .24)
}

body.light .btn {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.08);
}

body.light .btn:hover {
    background: #f0f2f8;
}

body.light .btn.primary {
    background: #4a6fff;
    border-color: #4a6fff;
    color: #fff;
}

body.light .btn.primary:hover {
    background: #3b5bdb;
}

.btn.ghost {
    background: transparent
}

.chip {
 display: inline-flex;
align-items: center;
justify-content: center;
padding: 3px 8px;
border-radius: 999px;
border: 1px solid var(--line);
color: var(--muted);
font-size: 12px;
line-height: 1;
}

.chip.brand {
    border-color: rgba(155, 176, 255, .45);
    background: rgba(155, 176, 255, .12);
    color: #fff
}

.layout {
    display: grid;
    grid-template-columns: 260px 1fr 280px;
    gap: 14px;
    align-items: start
}

.layout.admin {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    width: 100%;
    margin: 20px 0;
    align-items: start;
    padding: 0;
}

/* Force container to be full width for admin pages */
body[data-page^="mod"] .container,
body[data-page="adminSettings"] .container,
body[data-page="adminPages"] .container {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
}

/* Sidebar Layout */
.leftCol {
    position: sticky;
    top: calc(var(--th) + 40px);
    align-self: start;
}

.leftCol .card {
    border: none;
    background: transparent;
    box-shadow: none;
}

.leftCol .hd {
    padding: 0 0 12px 0;
    border-bottom: 2px solid var(--line);
    margin-bottom: 8px;
}

.leftCol .bd {
    padding: 0;
}

.leftCol .item {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 8px 4px;
    gap: 8px;
}

.leftCol .item:hover {
    background: rgba(255, 255, 255, 0.02);
    padding-left: 8px;
}

.leftCol .item .h3 {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--fg);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leftCol .item .small {
    font-size: 11px;
    opacity: 0.5;
}

body.light .leftCol .item {
    border-bottom-color: rgba(0, 0, 0, 0.04);
}

body.light .leftCol .item:hover {
    background: rgba(0, 0, 0, 0.02);
}


.layout.admin .centerCol {
    width: 100%;
    min-width: 0;
    /* Fix for grid overflow */
}

.admin-nav-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 12px;
    position: sticky;
    top: 80px;
    box-shadow: var(--shadow);
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 14px;
    color: var(--muted);
    font-weight: 600;
    transition: all 0.2s;
    margin-bottom: 4px;
}

.admin-nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.admin-nav-item.active {
    background: rgba(155, 176, 255, 0.12);
    color: var(--brand);
    border: 1px solid rgba(155, 176, 255, 0.2);
}

.rightCol {
    position: sticky;
    top: calc(var(--th) + 40px);
    z-index: 10;
    align-self: start;
}

.admin-nav-item .icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

body.light .admin-nav-card {
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

body.light .admin-nav-item:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--brand);
}

body.light .admin-nav-item.active {
    background: rgba(155, 176, 255, 0.15);
    color: #4a69bd;
}


/* Notification Bell Animations */
@keyframes bellPulse {

    0%,
    100% {
        opacity: 1;
        filter: brightness(1.3) drop-shadow(0 0 8px var(--brand));
    }

    50% {
        opacity: 0.2;
        filter: brightness(0.6);
    }
}

@keyframes bellShake {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-10deg);
    }

    75% {
        transform: rotate(10deg);
    }
}

@keyframes bellBounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-5px);
    }

    60% {
        transform: translateY(-3px);
    }
}

@keyframes bellRing {

    0%,
    100% {
        transform: rotate(0deg);
    }

    5%,
    15%,
    25%,
    35%,
    45% {
        transform: rotate(-8deg);
    }

    10%,
    20%,
    30%,
    40% {
        transform: rotate(8deg);
    }

    50% {
        transform: rotate(0deg);
    }
}

.notification-bell {
    position: relative;
    transition: all 0.3s ease;
}

.notification-bell.has-notifications {
    animation: bellPulse 1.5s infinite;
}

.notification-bell.has-notifications:hover {
    transform: scale(1.1);
}

/* Notification dot removed as per request */

/* Advertisement Styles */
.ad {
    border: 1px dashed var(--line);
    border-radius: var(--r);
    padding: 14px;
    background: var(--card);
    overflow: hidden;
}

.ad-top {
    margin-bottom: 14px;
}

.ad-right {
    height: 200px;
    min-height: 200px;
    max-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ad-right img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 8px;
}

.ad-right [data-ad-content] {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ad-right a {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
}

/* GIF Animation Fix */
.ad img.ad-gif {
    animation: none !important;
    image-rendering: auto;
    -webkit-image-rendering: auto;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
    will-change: auto;
}

/* Force GIF playback */
.ad img[src$=".gif"] {
    animation: none !important;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;
}

/* Admin Message Form Styles */
.admin-message-form {
    max-width: 500px;
    margin: 0 auto;
}

.form-header {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px 0;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark, #2a4365) 100%);
    border-radius: 12px;
    color: white;
    margin: -20px -20px 24px -20px;
}

.form-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.form-header h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 700;
}

.form-header p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.4;
}

.form-content {
    padding: 0 8px;
}

.form-content .input-group {
    margin-bottom: 20px;
}

.input-label {
    display: flex;
    align-items: center;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 14px;
}

.label-icon {
    margin-right: 8px;
    font-size: 16px;
}

.admin-message-form .inp {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: var(--bg);
    color: var(--text);
}

.admin-message-form .inp:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.admin-message-form textarea.inp {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
    line-height: 1.5;
}

.input-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-style: italic;
}

/* Profile Settings Card Styles */
.profile-settings-card {
    background: var(--card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
}

.settings-header {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark, #2a4365) 100%);
    color: white;
    text-align: center;
    padding: 24px 20px;
}

.settings-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: float 3s ease-in-out infinite;
}

.settings-header h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 700;
}

.settings-header p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.settings-content {
    padding: 24px;
}

.settings-section {
    margin-bottom: 32px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h4 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    transition: all 0.3s ease;
}

.settings-item:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.item-info strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text);
}

.item-info p {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.4;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.stat-card {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--brand);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Global Loader */
.global-loader {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
    color: #fff;
    font-weight: 700;
    gap: 16px;
}

body.light .global-loader {
    background: rgba(255, 255, 255, 0.6);
    color: #000;
}

.global-loader .spinner {
    width: 44px;
    height: 44px;
    border: 4px solid var(--line);
    border-top: 4px solid var(--brand);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Mobile Responsive for Profile Settings */
@media (max-width: 768px) {
    .settings-header {
        padding: 20px 16px;
    }

    .settings-icon {
        font-size: 36px;
        margin-bottom: 8px;
    }

    .settings-header h3 {
        font-size: 18px;
    }

    .settings-header p {
        font-size: 13px;
    }

    .settings-content {
        padding: 16px;
    }

    .settings-section {
        margin-bottom: 24px;
    }

    .settings-section h4 {
        font-size: 14px;
    }

    .settings-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px;
    }

    .settings-item .btn {
        width: 100%;
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-number {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .settings-header {
        padding: 16px 12px;
    }

    .settings-icon {
        font-size: 32px;
    }

    .settings-header h3 {
        font-size: 16px;
    }

    .settings-content {
        padding: 12px;
    }

    .settings-section {
        margin-bottom: 20px;
    }

    .settings-item {
        padding: 10px;
    }
}

@media (max-width: 768px) {
    .admin-message-form {
        max-width: 100%;
        margin: 0;
    }

    .form-header {
        margin: -20px -20px 24px -20px;
        padding: 16px 20px;
    }

    .form-icon {
        font-size: 36px;
        margin-bottom: 8px;
    }

    .form-header h3 {
        font-size: 18px;
    }

    .form-header p {
        font-size: 13px;
    }

    .form-content {
        padding: 0;
    }

    .input-label {
        font-size: 13px;
    }

    .admin-message-form .inp {
        padding: 10px 12px;
        font-size: 16px;
        /* Prevents zoom on iOS */
    }

    .admin-message-form textarea.inp {
        min-height: 100px;
    }
}

@media (max-width: 480px) {
    .form-header {
        padding: 12px 16px;
        margin: -16px -16px 20px -16px;
    }

    .form-icon {
        font-size: 32px;
    }

    .form-header h3 {
        font-size: 16px;
    }

    .form-header p {
        font-size: 12px;
    }

    .admin-message-form .inp {
        padding: 8px 12px;
    }
}

/* Responsive Design - Mobile First Approach */
@media (max-width:1200px) {
    .container {
        padding: 12px 12px 24px;
    }

    .layout {
        grid-template-columns: 240px 1fr 260px;
        gap: 12px;
    }
}

@media (max-width:980px) {
    .container {
        padding: 10px 10px 20px;
    }

    .layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .centerCol {
        min-width: 0;
    }

    .layout.admin {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .admin-sidebar {
        order: -1;
    }

    .admin-nav-card {
        position: static;
        top: auto;
    }

    .leftCol {
        position: static;
        height: auto;
        max-height: 300px;
        overflow: hidden;
        order: -1;
    }

    .leftCol .card {
        max-height: 300px;
        overflow-y: auto;
    }

    .rightCol {
        position: static;
        order: 1;
        margin-top: 16px;
    }

    .leftCol,
    .rightCol {
        width: 100%;
        min-width: 0;
    }

    .actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
    }

    .pill {
        min-width: 0;
        flex: 1 1 100%;
        order: -1;
    }

    .nav {
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }

    .nav a {
        padding: 6px 8px;
        font-size: 14px;
    }

    .actions {
        margin-left: 0;
        justify-content: space-between;
        align-items: center;
    }

    .topbar .row {
        flex-wrap: wrap;
        gap: 8px;
        min-height: auto;
        padding: 8px 0;
    }

    .brand {
        font-size: 16px;
        gap: 8px;
    }

    .logo {
        width: 28px;
        height: 28px;
    }
}

@media (max-width:720px) {
    .container {
        padding: 8px 8px 16px;
    }

    html,
    body {
        overflow-x: hidden;
    }

    .topbar {
        min-height: auto;
        padding: 4px 0;
    }

    .topbar .container {
        padding: 0;
    }

    .brand {
        font-size: 14px;
        flex: 1;
    }

    .logo {
        width: 24px;
        height: 24px;
    }

    .nav {
        display: none;
        /* Hide main nav on mobile, use hamburger instead */
    }

    .mobile-create-topic {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        white-space: nowrap;
    }

    .actions {
        gap: 6px;
    }

    .iconbtn {
        width: 36px;
        height: 36px;
    }

    .btn {
        padding: 8px 10px;
        font-size: 13px;
    }

    .card {
        border-radius: 16px;
        margin-bottom: 12px;
    }

    .card .hd {
        padding: 10px 12px;
    }

    .card .hd h2 {
        font-size: 14px;
    }

    .card .bd {
        padding: 10px 12px;
    }

    .entry {
        padding: 10px;
        border-radius: 12px;
    }

    .entryActions {
        flex-wrap: wrap;
        gap: 6px;
    }

    .xbtn {
        padding: 4px 8px;
        font-size: 10px;
    }

    .profile-card {
        border-radius: 20px;
        margin: 8px;
    }

    .profile-info {
        padding: 0 16px 20px;
    }

    .profile-avatar-large {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }

    .profile-details h2 {
        font-size: 20px;
    }

    .profile-tabs {
        margin: 16px 16px 0;
        padding: 0 2px;
    }

    .tab-btn {
        padding: 10px 16px;
        font-size: 14px;
    }

    .auth-card {
        margin: 12px;
        padding: 24px;
        border-radius: 20px;
    }

    .auth-header h1 {
        font-size: 22px;
    }

    .auth-inp {
        padding: 12px 14px;
        font-size: 14px;
    }

    .auth-btn {
        padding: 12px;
        font-size: 14px;
    }

    .modal {
        width: min(480px, 95%);
        margin: 16px;
        border-radius: 20px;
    }

    .modal .hd {
        padding: 12px 14px;
    }

    .modal .bd {
        padding: 12px 14px;
    }

    .toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
        border-radius: 12px;
    }

    #toastHost {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }
}

@media (max-width:480px) {
    .container {
        padding: 6px 6px 12px;
    }

    .layout {
        gap: 12px;
    }

    .card {
        border-radius: 14px;
        margin-bottom: 10px;
    }

    .card .hd {
        padding: 18px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .card .hd h2 {
        font-size: 13px;
    }

    .card .bd {
        padding: 8px 10px;
    }

    .entry {
        padding: 8px;
        border-radius: 10px;
    }

    .entryHead {
        flex-direction: column;
        gap: 8px;
    }

    .userchip {
        width: 100%;
    }

    .avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .entryActions {
        justify-content: space-between;
        width: 100%;
    }

    .xbtn {
        flex: 1;
        justify-content: center;
        padding: 6px 4px;
        font-size: 11px;
        min-width: 0;
    }

    .profile-card {
        margin: 6px;
        border-radius: 16px;
    }

    .profile-cover {
        height: 80px;
    }

    .profile-info {
        padding: 0 12px 16px;
        margin-top: -35px;
    }

    .profile-avatar-large {
        width: 60px;
        height: 60px;
        font-size: 24px;
        border-width: 3px;
    }

    .profile-details h2 {
        font-size: 18px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .profile-tabs {
        margin: 12px 12px 0;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .tab-count {
        font-size: 10px;
        padding: 1px 6px;
    }

    .auth-card {
        margin: 8px;
        padding: 20px;
        border-radius: 16px;
    }

    .auth-header h1 {
        font-size: 20px;
    }

    .auth-inp {
        padding: 10px 12px;
        font-size: 13px;
    }

    .auth-btn {
        padding: 10px;
        font-size: 13px;
    }

    .modal {
        width: min(420px, 98%);
        margin: 12px;
        border-radius: 16px;
    }

    .modal .hd {
        padding: 10px 12px;
    }

    .modal .bd {
        padding: 10px 12px;
    }

    .inp,
    textarea {
        padding: 8px 10px;
        font-size: 13px;
        border-radius: 12px;
    }

    .btn {
        padding: 8px 10px;
        font-size: 12px;
        border-radius: 10px;
    }

    .iconbtn {
        width: 32px;
        height: 32px;
    }

    .chip {
        font-size: 12px;
        padding: 2px 6px;
    }

    .small {
        font-size: 11px;
    }

    .h3 {
        font-size: 13px;
    }

    .p {
        font-size: 12px;
    }
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow);
    overflow: hidden
}

.card .hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: none
}

.card .hd h2 {
    margin: 0;
    font-size: 15px;
    letter-spacing: .2px
}

.card .bd {
    padding: 12px 14px
}

.list {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.item {
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .04);
    display: flex;
    gap: 10px;
    align-items: flex-start;
    transition: background 0.2s;
}

.item.unread {
    background: rgba(155, 176, 255, 0.05);
}

.item:hover {
    background: rgba(255, 255, 255, .07)
}

.item .grow {
    flex: 1;
    min-width: 0
}

.h3 {
    margin: 0;
    font-weight: 800;
    font-size: 14px
}

.p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
    overflow-wrap: anywhere
}

.kv {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center
}

.small {
    font-size: 12px;
    color: var(--muted2)
}

.ad {
    border: 1px dashed rgba(255, 255, 255, .25);
    border-radius: var(--r);
    padding: 14px;
    background: rgba(255, 255, 255, .04)
}

.ad-top {
    margin-bottom: 14px
}

.ad-right {
    min-height: 130px
}

.entry {
    padding: 12px 12px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, .04)
}

.entry [data-entry-text] {
    font-family: Arial;
    font-size: 15px;
    font-weight: 400;
    color: white;
    line-height: 1.5;
}

body.light .entry [data-entry-text] {
    color: black;
}

.entryHead {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px
}

.userchip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, #9bb0ff, #c8a9ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-text {
    font-size: 14px;
    color: #fff;
}

.entry-topic-link {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.entry-topic-link .chip {
    font-size: 11px;
    padding: 2px 8px;
    font-weight: 700;
}

.entryActions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    /* Reduced gap */
    margin-top: 32px;
}

.xbtn {
    display: flex;
    flex-direction: row;
    /* Yan yana olması için zorla */
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    background: #1c212d;
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 999px;
    color: #8c96ae;
    font-size: 11px;
    /* Smaller font */
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
    /* Metin kaymasını engelle */
    gap: 4px;
    /* İşaret ve sayı arasındaki boşluk */
}

.xbtn:hover {
    background: #2a3245;
    color: #fff;
}

.xbtn.active {
    background: #2a3245;
    border-color: var(--brand);
    color: var(--brand);
}

.xbtn.active[data-act="fav"] {
    background: rgba(255, 185, 56, .1);
    border-color: #ffb938;
    color: #ffb938;
}

.xbtn[data-act="report"] {
    background: rgba(255, 107, 107, .05);
    border-color: rgba(255, 107, 107, .12);
    color: #ffa4a4;
}

.xbtn[data-act="report"]:hover {
    background: rgba(255, 107, 107, .1);
    border-color: rgba(255, 107, 107, .3);
    color: #ff6b6b;
}

body.light .xbtn {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.08);
    color: #556080;
}

body.light .xbtn:hover {
    background: #f0f2f8;
    color: #151a2b;
}

body.light .xbtn.active {
    background: #eff3ff;
    border-color: #4a6fff;
    color: #4a6fff;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.inp,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    background: var(--card);
    border-radius: 14px;
    padding: 10px 12px;
    color: inherit;
    outline: none
}

textarea {
    min-height: 110px;
    resize: vertical
}

select.inp,
select {
    cursor: pointer;
}

select option {
    background: var(--card);
    color: #1a1f2e;
}

body.light select option {
    background: #fff;
    color: #151a2b;
}

.grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px
}

@media (max-width:720px) {
    .grid2 {
        grid-template-columns: 1fr
    }
}

.modalBackdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 90
}

.modal {
    width: min(520px, 100%);
    background: rgba(15, 20, 36, .95);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .6);
    overflow: hidden
}

body.light .modal {
    background: rgba(245, 247, 255, .95)
}

.modal .hd {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between
}

.modal .bd {
    padding: 24px;
}

.modal .ft {
    padding: 16px 24px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.modal .ft .btn {
    min-width: 140px;
}

@media (max-width: 480px) {
    .modal .ft .btn {
        width: 100%;
        min-width: 0;
    }

    .modal .bd {
        padding: 16px;
    }
}

.modalBackdrop.show {
    display: flex;
    backdrop-filter: blur(8px);
}

.footer {
    margin-top: 16px;
    padding: 18px 0;
    color: var(--muted2);
    font-size: 12px;
    border-top: 1px solid var(--line);
    background: var(--bg)
}

/* Report Modal Styles */
.report-reasons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
}

.reason-item {
    padding: 12px 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
}

.reason-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 107, 107, 0.3);
    color: var(--bad);
}

.reason-item .icon {
    font-size: 18px;
    opacity: 0.7;
}


.notice {
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--muted)
}

.notice.good {
    border-color: rgba(82, 211, 138, .35);
    background: rgba(82, 211, 138, .12);
    color: #d8ffea
}

.notice.bad {
    border-color: rgba(255, 107, 107, .35);
    background: rgba(255, 107, 107, .12);
    color: #ffe0e0
}

/* Auth Pages Modernization */
.auth-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 100px);
    padding: 20px;
}

.auth-card {
    width: min(440px, 100%);
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 28px;
    padding: 40px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
    animation: authSlideUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes authSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header .logo {
    margin: 0 auto 16px;
    width: 54px;
    height: 54px;
}

.auth-header h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 900;
    background: linear-gradient(135deg, #fff, #9bb0ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-header p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin-left: 4px;
}

.auth-inp {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 14px 18px;
    color: #fff;
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
}

.auth-inp:focus {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(155, 176, 255, 0.15);
}

.auth-btn {
    margin-top: 10px;
    padding: 14px;
    font-weight: 700;
    font-size: 15px;
    background: linear-gradient(135deg, #9bb0ff, #7a94ff);
    color: #0b0f1a;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(155, 176, 255, 0.3);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 14px;
    color: var(--muted);
}

.auth-footer a {
    color: var(--brand);
    font-weight: 600;
    margin-left: 4px;
}

.auth-footer a:hover {
    text-decoration: underline;
}

body.light .auth-card {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(0, 0, 0, 0.05);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.05);
}

body.light .auth-header h1 {
    background: linear-gradient(135deg, #151a2b, #4a6fff);
    -webkit-background-clip: text;
    background-clip: text;
}

body.light .auth-inp {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.08);
    color: #000;
}

body.light .auth-inp:focus {
    background: #fff;
    border-color: var(--brand);
}

/* Profile Page Modernization */
.profile-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.profile-cover {
    height: 120px;
    background: linear-gradient(135deg, rgba(155, 176, 255, 0.2), rgba(200, 169, 255, 0.2));
    position: relative;
}

.profile-info {
    padding: 0 24px 24px;
    margin-top: -45px;
    position: relative;
}

.profile-avatar-large {
    width: 90px;
    height: 90px;
    border-radius: 24px;
    background: linear-gradient(135deg, #9bb0ff, #c8a9ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 900;
    color: #0b0f1a;
    border: 4px solid var(--bg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.profile-details {
    margin-top: 16px;
}

.profile-details h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-details .email {
    color: var(--muted);
    font-size: 14px;
    margin-top: 4px;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.stat-item {
    text-align: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-value {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
}

.stat-label {
    display: block;
    font-size: 11px;
    color: var(--muted2);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.profile-meta {
    margin-top: 20px;
    font-size: 13px;
    color: var(--muted2);
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-meta svg {
    width: 16px;
    height: 16px;
    opacity: 0.6;
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 14px 18px;
    border-radius: 14px;
    background: rgba(15, 20, 36, .95);
    border: 1px solid var(--line);
    box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
    z-index: 100;
    animation: toastSlide 0.3s ease;
    max-width: 320px;
}

@keyframes toastSlide {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.good {
    border-color: rgba(82, 211, 138, .45);
    background: rgba(82, 211, 138, .15);
    color: #d8ffea;
}

.toast.bad {
    border-color: rgba(255, 107, 107, .45);
    background: rgba(255, 107, 107, .15);
    color: #ffe0e0;
}

body.light .toast {
    background: rgba(255, 255, 255, .98);
    border-color: rgba(0, 0, 0, 0.15);
    color: #151a2b;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .15);
}

body.light .toast.good {
    border-color: rgba(34, 139, 34, .6);
    background: rgba(34, 139, 34, .1);
    color: #0d5c0d;
}

body.light .toast.bad {
    border-color: rgba(220, 38, 38, .6);
    background: rgba(220, 38, 38, .1);
    color: #991b1b;
}

#toastHost {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state-text {
    font-size: 16px;
    font-weight: 600;
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--muted);
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid rgba(255, 255, 255, .1);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Admin Mode UI */
.topbar.admin-bar {
    background: rgba(15, 20, 36, 0.85);
    border-bottom: 2px solid var(--brand);
}

body.light .topbar.admin-bar {
    background: rgba(245, 247, 255, 0.9);
}

.brand .badge {
    font-size: 10px;
    background: var(--brand);
    color: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 800;
    margin-left: 4px;
    vertical-align: middle;
}

/* Profile Avatar Styles */
.profile-avatar-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 24px;
    background: linear-gradient(135deg, #9bb0ff, #c8a9ff);
    margin-right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    flex-shrink: 0;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-large {
    font-size: 36px;
    font-weight: 900;
    color: #fff;
}

.avatar-edit-btn {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
}

.profile-avatar-wrapper:hover .avatar-edit-btn {
    opacity: 1;
}

.avatar-edit-btn:hover {
    background: rgba(0, 0, 0, 0.6);
}

.profile-info {
    display: flex;
    align-items: flex-start;
}

@media (max-width: 600px) {
    .profile-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-avatar-wrapper {
        margin-right: 0;
        margin-bottom: 20px;
    }
}

/* Profile Tabs Styles */
.profile-tabs {
    margin-top: 24px;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 4px;
    padding: 0 4px;
    overflow-x: auto;
    scrollbar-width: none;
    /* Hide scrollbar for Firefox */
}

.profile-tabs::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar for Chrome/Safari */
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.tab-btn:hover {
    color: var(--fg);
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 20px;
    right: 20px;
    height: 3px;
    background: var(--brand);
    border-radius: 10px 10px 0 0;
    opacity: 0;
    transform: scaleX(0);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn.active {
    color: var(--brand);
}

.tab-btn.active::after {
    opacity: 1;
    transform: scaleX(1);
}

.tab-count {
    font-size: 11px;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 8px;
    margin-left: 8px;
    font-weight: 800;
    color: var(--muted);
    transition: all 0.2s;
}

.tab-btn.active .tab-count {
    background: rgba(155, 176, 255, 0.15);
    color: var(--brand);
}

body.light .tab-count {
    background: rgba(0, 0, 0, 0.05);
}

body.light .tab-btn.active .tab-count {
    background: rgba(155, 176, 255, 0.2);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    box-shadow: var(--shadow);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.back-to-top:active {
    transform: translateY(0);
}

.back-to-top svg {
    width: 20px;
    height: 20px;
    color: var(--muted);
    transition: color 0.2s;
}

.back-to-top:hover svg {
    color: var(--brand);
}

body.light .back-to-top {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body.light .back-to-top:hover {
    background: #f8f9fa;
}

body.light .back-to-top svg {
    color: #666;
}

body.light .back-to-top:hover svg {
    color: var(--brand);
}

@media (max-width:720px) {
    .back-to-top {
        bottom: 16px;
        right: 16px;
        width: 45px;
        height: 45px;
    }

    .back-to-top svg {
        width: 18px;
        height: 18px;
    }
}

#topicTitle > div,
#topicTitle .item,
#topicTitle .card {
    padding: 22px 18px;
    min-height: 72px;
    border-radius: 22px;
}

#topicTitle .h3,
#topicTitle h1,
#topicTitle h2,
#topicTitle h3 {
    font-size: 20px;
   color: orange ;
}

/* SOL PANEL SCROLLBAR - gizli, hover'da kalın */

.leftCol .bd::-webkit-scrollbar {
    width: 0;
}

.leftCol .bd:hover::-webkit-scrollbar {
    width: 9px;
}

.leftCol .bd::-webkit-scrollbar-track {
    background: transparent;
}

.leftCol .bd::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.35);
    border-radius: 0px;
}

.leftCol .bd::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.55);
}

/* Aydınlık mod */

body.light .leftCol .bd::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.35);
}

body.light .leftCol .bd::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.55);
}
