/* Avan CMS - Public Frontend - RTL, Responsive, PWA-like */
@font-face {
    font-family: 'IRANSans';
    src: url('../font/IRANSans-web.eot');
    src: url('../font/IRANSans-web.eot?#iefix') format('embedded-opentype'),
         url('../font/IRANSans-web.woff2') format('woff2'),
         url('../font/IRANSans-web.woff') format('woff'),
         url('../font/IRANSans-web.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}
:root {
    --primary: #2dc9c8;
    --primary-hover: #229e9d;
    --primary-light: #84e3e2;
    --bg: #f2fafa;
    --card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --overlay: rgba(45, 201, 200, 0.95);
    --shadow: 0 15px 35px -5px rgba(45, 201, 200, 0.15);
    --radius: 24px;
    --radius-sm: 14px;
    --border: rgba(0,0,0,0.05);
    --header-bg: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] {
    --primary: #2dc9c8;
    --primary-hover: #4fd1d0;
    --bg: #1a1b1d;
    --card: #202124;
    --text: #ffffff;
    --text-muted: #e5e5e5;
    --overlay: rgba(50, 50, 50, 0.95);
    --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.4);
    --border: rgba(255,255,255,0.1);
    --header-bg: rgba(40, 40, 40, 0.9);
}
* { box-sizing: border-box; margin: 0; padding: 0; outline-color: var(--primary); }
html { scroll-behavior: smooth; }
body {
    font-family: 'IRANSans', 'Vazirmatn', 'Tahoma', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    direction: rtl;
    min-height: 100vh;
    padding-bottom: env(safe-area-inset-bottom, 0);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; display: block; }

/* Header */
.header {
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border);
    transition: background 0.3s ease, border-color 0.3s ease;
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.header { position: relative; }
.header h1 { font-size: 1.25rem; font-weight: 700; color: var(--primary); }

/* User Dropdown */
.user-dropdown {
    position: relative;
    display: inline-block;
}
.user-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-weight: 600;
}
.user-dropdown-content {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    background: var(--card);
    min-width: 180px;
    box-shadow: var(--shadow);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    z-index: 60;
    border: 1px solid var(--border);
    animation: fadeIn 0.2s ease;
}
.user-dropdown:hover .user-dropdown-content {
    display: flex;
    flex-direction: column;
}
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: right;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text);
    transition: background 0.2s;
}
.dropdown-item:hover {
    background: rgba(0,0,0,0.04);
    color: var(--primary);
}
[data-theme="dark"] .dropdown-item:hover {
    background: rgba(255,255,255,0.05);
}
.dropdown-item svg {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}
.dropdown-item.text-danger:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Generic card (used in auth pages too) */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}
.card-body {
    padding: 1.25rem;
}

/* Generic form fields (login/forgot/reset/register) */
.field { margin-bottom: 1rem; }
.field label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    color: var(--text);
}
.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 0.75rem 0.9rem;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    color: var(--text);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
[data-theme="dark"] .field input,
[data-theme="dark"] .field select,
[data-theme="dark"] .field textarea {
    background: rgba(255,255,255,0.03);
    border-color: var(--border);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(45, 201, 200, 0.18);
}
.field input[type="email"],
.field input[type="password"],
.field input[type="number"] {
    direction: ltr;
    text-align: left;
}
.field input::placeholder { color: rgba(100, 116, 139, 0.85); }
[data-theme="dark"] .field input::placeholder { color: rgba(229, 229, 229, 0.75); }

.help-inline {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}
.error { color: #dc2626; font-size: 0.9rem; margin-bottom: 0.5rem; }
.success-msg { color: #16a34a; font-size: 0.9rem; margin-bottom: 0.5rem; }

/* Auth pages: قرار دادن فرم‌ها در موقعیت مناسب */
.auth-main {
    min-height: calc(100vh - 180px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
}
.auth-main .card {
    margin-top: 2.5rem;
    margin-bottom: 2.5rem;
}

/* Auth card sizing */
.auth-card {
    width: 100%;
    max-width: 420px;
    margin: 2rem auto;
    padding: 1.75rem 1.5rem;
}
.auth-card.auth-card-lg { max-width: 520px; }
.header-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.header-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition: transform .2s, opacity .2s;
}
.header.open .header-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.header.open .header-toggle span:nth-child(2) { opacity: 0; }
.header.open .header-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.header-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 55;
}
.header-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn:active { transform: scale(0.96); }
.btn-primary { 
    background: var(--primary); 
    color: #fff; 
    box-shadow: 0 4px 12px rgba(45, 201, 200, 0.25);
}
.btn-primary:hover { 
    background: var(--primary-hover); 
    box-shadow: 0 8px 25px -5px rgba(45, 201, 200, 0.5);
    transform: translateY(-2px);
}
.btn-primary:active { transform: translateY(0) scale(0.96); }
.btn-ghost { 
    background: transparent; 
    color: var(--text-muted); 
    border: 1px solid transparent; 
}
.btn-ghost:hover { 
    color: var(--primary);
    background: rgba(45, 201, 200, 0.08); 
}
.btn-icon {
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-block { width: 100%; }

/* Main */
.main { max-width: 1200px; margin: 0 auto; padding: 2rem 1rem; min-height: 70vh; }
.main h2 { 
    font-size: 1.5rem; 
    font-weight: 800;
    margin-bottom: 1.5rem; 
    color: var(--text);
    letter-spacing: -0.5px;
}

/* Search - بالای دسته‌ها و مطالب */
.search-wrap { position: relative; margin-bottom: 2rem; }
.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border: 2px solid transparent;
    background: #fff;
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    direction: rtl;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    transition: all 0.2s ease;
}
.search-input:focus { 
    outline: none; 
    border-color: var(--primary);
    box-shadow: 0 8px 30px rgba(45, 201, 200, 0.15);
    transform: translateY(-2px);
}
.search-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    margin-top: 4px;
    background: var(--card);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    max-height: 320px;
    overflow-y: auto;
    z-index: 60;
}
.search-suggestions.visible { display: block; }
.search-suggestions .suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border, #e2e8f0);
    transition: background .15s;
}
.search-suggestions .suggestion-item:last-child { border-bottom: none; }
.search-suggestions .suggestion-item:hover { background: var(--bg); }
.search-suggestions .suggestion-item .thumb { width: 48px; height: 36px; object-fit: cover; border-radius: 6px; }
.search-suggestions .suggestion-item .thumb-wrap { width: 48px; height: 36px; background: linear-gradient(135deg, var(--primary-light), var(--primary)); border-radius: 6px; flex-shrink: 0; }
.search-suggestions .suggestion-item .title { font-size: 0.9rem; font-weight: 500; }
.search-suggestions .suggestion-item .meta { font-size: 0.75rem; color: var(--text-muted); }

/* Pagination */
.pagination-wrap { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; justify-content: center; margin-top: 1.5rem; }
.pagination-wrap .btn { min-width: 40px; }
.pagination-wrap .page-info { font-size: 0.9rem; color: var(--text-muted); margin: 0 0.5rem; }

/* Topics grid - icons + text */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 85px);
    gap: 0.75rem;
    justify-content: center;
}
.topic-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.25rem;
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.03);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
    height: 100%;
    min-height: 120px;
    width: 100%;
}
.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px -4px rgba(45, 201, 200, 0.25);
    border-color: rgba(45, 201, 200, 0.2);
}
.topic-card .icon-wrap {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
}
.topic-card:hover .icon-wrap {
    animation: floatIcon 3s ease-in-out infinite;
    transform: scale(1.1);
}
@keyframes floatIcon {
    0%, 100% { transform: translateY(0) scale(1.1); }
    50% { transform: translateY(-6px) scale(1.1); }
}
.topic-card .icon-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}
.topic-card .icon-wrap:empty::after {
    content: '';
    width: 32px;
    height: 32px;
    background: #e2e8f0;
    border-radius: 8px;
    opacity: 0.5;
}
.topic-card .title {
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    color: var(--text);
    line-height: 1.3;
    transition: color 0.3s ease;
}
.topic-card:hover .title {
    color: var(--primary);
}

/* Overlay - dimmed + sub-topics as buttons */
.overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    overflow-y: auto;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.overlay-title { color: #fff; font-size: 1.25rem; margin-bottom: 1.5rem; text-align: center; }
.overlay-subtopics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    max-width: 400px;
}
.overlay-subtopics .btn {
    min-width: 140px;
    padding: 0.75rem 1rem;
    background: rgba(255,255,255,.95);
    color: var(--primary);
    font-weight: 600;
}
.overlay-close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    width: 44px;
    height: 44px;
    border: none;
    background: rgba(255,255,255,.2);
    color: #fff;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.overlay-close:hover { background: rgba(255,255,255,.35); }

/* Subcategories row above posts list */
.posts-subcategories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.posts-subcategories .btn {
    padding: 0.5rem 1rem;
    background: var(--card);
    color: var(--primary);
    border: 1px solid var(--primary-light);
    font-weight: 500;
}
.posts-subcategories .btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Posts list */
.posts-list { display: flex; flex-direction: column; gap: 1rem; }
.post-item {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    cursor: pointer;
    transition: box-shadow .2s;
}
.post-item:hover { box-shadow: 0 8px 28px rgba(0,0,0,.12); }
.post-item .thumb {
    width: 100px;
    min-height: 80px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    object-fit: cover;
}
.post-item .body { flex: 1; padding: 0.75rem 0.5rem 0.75rem 0; }
.post-item .body h3 { font-size: 1rem; margin-bottom: 0.25rem; color: var(--text); }
.post-item .body .meta { font-size: 0.8rem; color: var(--text-muted); }
.post-item.vip {
    border-right: 4px solid var(--primary);
    position: relative;
    padding-left: 2.5rem;
}
.post-item.vip::before {
    content: '🔒 VIP';
    position: absolute;
    left: 0.75rem;
    top: 0.75rem;
    font-size: 0.8rem;
    color: #b91c1c;
    background: #fee2e2;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
}
body.vip-user .post-item.vip::before {
    content: '🔓 VIP';
    color: #166534;
    background: #dcfce7;
}

/* Single post view */
.post-single { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 1.5rem; }
.post-single .thumb { width: 100%; max-height: 280px; object-fit: cover; }
.post-single .head { padding: 1.25rem 1.5rem; }
.post-single .head h1 { font-size: 1.35rem; margin-bottom: 0.5rem; }
.post-single .head .meta { font-size: 0.85rem; color: var(--text-muted); }
.post-single .content { padding: 0 1.5rem 1.5rem; }
.post-single .content img { max-width: 100%; height: auto; border-radius: var(--radius-sm); margin: 0.5rem 0; cursor: pointer; transition: opacity 0.2s; }
.post-single .content img:hover { opacity: 0.9; }
.post-single .content iframe { max-width: 100%; border-radius: var(--radius-sm); }
.back-btn { margin-bottom: 1rem; display: inline-flex; align-items: center; gap: 0.5rem; }

/* Captcha fields (frontend auth forms) */
.captcha-field .captcha-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.captcha-field .captcha-img {
    display: inline-block;
    width: 160px;
    height: 56px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #f8fafc;
}
.captcha-refresh-btn {
    border: none;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
}
.captcha-refresh-btn:hover {
    background: rgba(45, 201, 200, 0.08);
}

/* Lightbox: تصویر به اندازه واقعی با پس‌زمینه تار */
.lightbox-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}
.lightbox-content {
    position: relative;
    z-index: 2001;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.lightbox-content img {
    max-width: 90vw;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}
.lightbox-close-btn {
    color: var(--text);
    background: var(--card);
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 999px;
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
}
.lightbox-close-btn:hover {
    background: var(--border);
}

/* Views */
.view { display: none; }
.view.active { display: block; }

/* Auth modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0,0,0,.4);
    animation: fadeIn 0.2s ease;
}
.modal-box {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 50px rgba(0,0,0,.2);
}
.modal-box.modal-box-lg { max-width: 520px; }
.modal-box h3 { margin-bottom: 1rem; text-align: center; }
.modal-box .field { margin-bottom: 1rem; }
.modal-box .field label { display: block; margin-bottom: 0.35rem; font-weight: 500; }
.modal-box .field input { width: 100%; padding: 0.6rem 0.75rem; border: 1px solid #e2e8f0; border-radius: var(--radius-sm); font-size: 1rem; }
.modal-box .error { color: #dc2626; font-size: 0.9rem; margin-bottom: 0.5rem; }
.modal-box .success-msg { color: #16a34a; font-size: 0.9rem; margin-bottom: 0.5rem; }
.modal-box .help-inline { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.modal-box .small-link { font-size: 0.85rem; }
.modal-box .btn { margin-top: 0.5rem; }
.modal-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.modal-tabs .btn { flex: 1; }

/* Contact */
.contact-form .field { margin-bottom: 1rem; }
.contact-form label { display: block; margin-bottom: 0.35rem; font-weight: 500; }
.contact-form input, .contact-form textarea { width: 100%; padding: 0.6rem 0.75rem; border: 1px solid #e2e8f0; border-radius: var(--radius-sm); font-size: 1rem; font-family: inherit; }
.contact-form textarea { min-height: 120px; resize: vertical; }

/* Plans */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.plan-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 260px;
}
.plan-card h4 { margin-bottom: 0.5rem; }
.plan-card .price { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin: 0.5rem 0; }
.plan-card .desc { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1rem; }

/* Payment info modal */
.payment-plan-desc { font-size: 0.95rem; color: var(--primary); font-weight: 600; margin-bottom: 1rem; }
.payment-info-content {
    background: var(--bg);
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    white-space: pre-wrap;
    line-height: 1.7;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 72px;
}

/* Footer */
.footer { padding: 2rem 1rem 1.5rem; color: var(--text-muted); font-size: 0.9rem; border-top: 1px solid var(--border); margin-top: 2rem; }
.footer-inner { max-width: 1000px; margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 2rem; margin-bottom: 1.5rem; text-align: right; }
.footer-col { min-width: 0; }
.footer-heading { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 0.75rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 0.4rem; }
.footer-links a { color: var(--primary); text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-empty { color: var(--text-muted); font-size: 0.85rem; }
.footer-social { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.footer-social-link { display: inline-flex; align-items: center; justify-content: center; color: var(--primary); text-decoration: none; transition: opacity 0.2s; }
.footer-social-link:hover { opacity: 0.85; }
.footer-social-img { width: 28px; height: 28px; object-fit: contain; }
.footer-copyright { text-align: center; padding-top: 1rem; border-top: 1px solid var(--border); margin: 0; font-size: 0.85rem; }
@media (max-width: 600px) {
    .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; text-align: center; }
    .footer-social { justify-content: center; }
    .footer-copyright { text-align: center; }
}

/* Loading / Empty */
.loading { text-align: center; padding: 2rem; color: var(--text-muted); }
.empty { text-align: center; padding: 2rem; color: var(--text-muted); }

/* Mobile-first */
/* موبایل: منوی همبرگری هدر */
@media (max-width: 768px) {
    .header-toggle { display: flex; }
    .header-actions {
        position: fixed;
        top: 0;
        right: 0;
        width: min(280px, 85vw);
        height: 100vh;
        background: var(--card);
        box-shadow: -4px 0 24px rgba(0,0,0,.15);
        flex-direction: column;
        align-items: stretch;
        padding: 4rem 1rem 1rem;
        gap: 0.5rem;
        z-index: 60;
        transform: translateX(100%);
        transition: transform 0.25s ease;
        overflow-y: auto;
    }
    .header.open .header-actions { transform: translateX(0); }
    .header.open .header-overlay { display: block; }
    .header-actions .btn,
    .header-actions #userMenu { justify-content: center; width: 100%; }
    .header-actions #userMenu { flex-direction: column; gap: 0.5rem; }
}
@media (min-width: 769px) {
    .header-overlay { display: none !important; }
}
@media (min-width: 600px) {
    .topics-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .topic-card { min-width: 110px; }
}
@media (min-width: 768px) {
    .post-item .thumb { width: 140px; min-height: 100px; }
}

/* IC Search table */
.ic-search-wrap { overflow-x: auto; margin-top: 1rem; background: var(--card); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.ic-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.ic-table th, .ic-table td { padding: 0.5rem 0.75rem; text-align: right; border-bottom: 1px solid var(--border); }
.ic-table thead tr:first-child th { padding: 0.4rem; vertical-align: middle; }
.ic-filter-input { width: 100%; min-width: 120px; padding: 0.4rem 0.5rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
.ic-filter-select { width: 100%; min-width: 80px; padding: 0.4rem 0.5rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
.ic-table-header-row th { font-weight: 600; color: var(--text-muted); background: rgba(0,0,0,0.03); }
[data-theme="dark"] .ic-table-header-row th { background: rgba(255,255,255,0.05); }
.ic-table tbody tr:hover { background: rgba(45, 201, 200, 0.06); }
[data-theme="dark"] .ic-table tbody tr:hover { background: rgba(45, 201, 200, 0.12); }
.ic-search-note { margin-top: 1.25rem; padding: 0.75rem 1rem; background: rgba(45, 201, 200, 0.1); border-radius: var(--radius-sm); color: var(--text-muted); font-size: 0.9rem; border-right: 3px solid var(--primary); }
[data-theme="dark"] .ic-search-note { background: rgba(45, 201, 200, 0.15); }

/* Mobile responsive for IC Search */
.ic-filters-mobile {
    display: none;
    margin-top: 1rem;
    background: var(--card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 1rem;
    gap: 1rem;
    flex-direction: column;
}

.ic-filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ic-filter-field label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.ic-filters-desktop {
    display: table-row;
}

@media (max-width: 768px) {
    .ic-filters-mobile {
        display: flex;
    }
    .ic-filters-desktop {
        display: none;
    }
    .ic-search-wrap { 
        overflow-x: auto; 
        margin-top: 1rem;
    }
    .ic-table { 
        display: table; 
        width: 100%;
    }
    .ic-filter-input, .ic-filter-select { 
        width: 100%;
        padding: 0.6rem 0.75rem;
        font-size: 0.95rem;
    }
}
