/* ========================================
   Q&A Webboard - Modern Theme with Variables
   ======================================== */

/* Base & Variables (จาก theme.php) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Sarabun', 'Kanit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--body-bg);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99,102,241,0.04) 0%, transparent 25%),
        radial-gradient(circle at 90% 80%, rgba(236,72,153,0.04) 0%, transparent 25%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.5s ease;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@keyframes pulse-soft {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.4); }
    50% { box-shadow: 0 0 0 12px rgba(99,102,241,0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-8px) rotate(1deg); }
    75% { transform: translateY(4px) rotate(-1deg); }
}

@keyframes float-slow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes ripple {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(4); opacity: 0; }
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes wave {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

@keyframes draw {
    from { stroke-dashoffset: 1000; }
    to { stroke-dashoffset: 0; }
}

/* Animation Classes */
.animate-fadeInUp {
    animation: fadeInUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    opacity: 0;
}

.animate-fadeInDown {
    animation: fadeInDown 0.6s ease-out forwards;
    opacity: 0;
}

.animate-fadeIn {
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
}

.animate-fadeInScale {
    animation: fadeInScale 0.5s ease-out forwards;
    opacity: 0;
}

.animate-slideInLeft {
    animation: slideInLeft 0.6s ease-out forwards;
    opacity: 0;
}

.animate-slideInRight {
    animation: slideInRight 0.6s ease-out forwards;
    opacity: 0;
}

.animate-zoomIn {
    animation: zoomIn 0.4s ease-out forwards;
    opacity: 0;
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

.animate-float-slow {
    animation: float-slow 6s ease-in-out infinite;
}

.animate-pulse-soft {
    animation: pulse-soft 2s infinite;
}

.animate-bounce {
    animation: bounce 2s ease-in-out infinite;
}

.animate-wave {
    animation: wave 2s ease-in-out infinite;
}

.animate-gradient {
    background-size: 200% 200%;
    animation: gradient-shift 5s ease infinite;
}

/* Delay utilities */
.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }
.delay-4 { animation-delay: 0.32s; }
.delay-5 { animation-delay: 0.40s; }
.delay-6 { animation-delay: 0.48s; }

/* Stagger children animation */
.stagger-children > * {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.10s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.20s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.30s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.40s; }

/* ========================================
   NAVBAR - Glass Morphism
   ======================================== */
.navbar-main {
    background: var(--gradient-admin) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 4px 30px rgba(0,0,0,0.15);
    transition: all 0.4s ease;
    animation: fadeInDown 0.6s ease-out;
}

.navbar-brand {
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.3));
}

.nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.nav-link:hover {
    color: white !important;
    background: rgba(255,255,255,0.12);
    transform: translateY(-2px);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 0;
    height: 2.5px;
    background: var(--accent-2);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after {
    width: 50%;
}

/* ========================================
   HEADER BANNER
   ======================================== */
.header-banner {
    background: var(--gradient-1);
    padding: 0;
    line-height: 0;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.8s ease-out;
}

.header-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><circle cx="30" cy="30" r="2" fill="rgba(255,255,255,0.12)"/><circle cx="170" cy="60" r="3" fill="rgba(255,255,255,0.08)"/><circle cx="50" cy="150" r="2.5" fill="rgba(255,255,255,0.1)"/><circle cx="160" cy="140" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="100" cy="100" r="1" fill="rgba(255,255,255,0.15)"/></svg>');
    background-size: 150px;
    animation: float-slow 8s ease-in-out infinite;
    pointer-events: none;
}

.header-banner img {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 1;
    transition: transform 0.5s ease;
}

.header-banner:hover img {
    transform: scale(1.02);
}

/* ========================================
   CATEGORY CARDS
   ======================================== */
.category-card {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-1);
    transform: scaleX(0);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: left;
}

.category-card::after {
    content: '';
    position: absolute;
    bottom: -30px;
    right: -30px;
    width: 80px;
    height: 80px;
    background: var(--gradient-1);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.5s ease;
    filter: blur(30px);
}

.category-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12), var(--shadow-glow);
    border-color: rgba(99,102,241,0.2);
}

.category-card:hover::before {
    transform: scaleX(1);
}

.category-card:hover::after {
    opacity: 0.15;
}

.category-icon {
    width: 64px;
    height: 64px;
    background: var(--gradient-2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.6rem;
    box-shadow: 0 6px 20px rgba(99,102,241,0.35);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.category-card:hover .category-icon {
    transform: rotate(-8deg) scale(1.15);
    box-shadow: 0 8px 30px rgba(99,102,241,0.5);
}

/* ========================================
   TOPIC ITEMS
   ======================================== */
.topic-item {
    background: rgba(255,255,255,0.95);
    border-radius: 16px;
    padding: 1.35rem;
    margin-bottom: 0.85rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-left: 4px solid var(--primary);
    position: relative;
    overflow: hidden;
}

.topic-item::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100%;
    background: var(--gradient-1);
    opacity: 0;
    transition: opacity 0.4s ease;
    clip-path: polygon(40% 0, 100% 0, 100% 100%, 0% 100%);
}

.topic-item:hover {
    transform: translateX(10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-left-color: var(--accent);
}

.topic-item:hover::before {
    opacity: 0.03;
}

.topic-title {
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
}

.topic-title:hover {
    color: var(--accent);
}

.topic-meta {
    font-size: 0.85rem;
    color: var(--gray);
}

/* ========================================
   BADGES & COUNTERS
   ======================================== */
.badge-pinned {
    background: var(--gradient-3) !important;
    border: none;
    box-shadow: 0 3px 10px rgba(245,158,11,0.3);
    animation: pulse-soft 3s infinite;
}

.reply-count {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    color: var(--primary-dark);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.topic-item:hover .reply-count {
    background: var(--gradient-2);
    color: white;
    box-shadow: 0 3px 12px rgba(99,102,241,0.3);
    transform: scale(1.05);
}

/* ========================================
   BUTTONS - With Ripple & Shimmer
   ======================================== */
.btn-primary-custom {
    background: var(--gradient-2);
    background-size: 200% auto;
    border: none;
    border-radius: 12px;
    padding: 0.65rem 1.75rem;
    font-weight: 600;
    color: white;
    box-shadow: 0 6px 20px rgba(99,102,241,0.35);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.btn-primary-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    transition: left 0.6s ease;
}

.btn-primary-custom:hover {
    background-position: right center;
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 12px 35px rgba(99,102,241,0.45);
    color: white;
}

.btn-primary-custom:hover::before {
    left: 100%;
}

.btn-primary-custom:active {
    transform: translateY(-1px) scale(0.97);
}

/* ========================================
   TOPIC & REPLY BOXES
   ======================================== */
.topic-box {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    padding: 2.25rem;
    margin-bottom: 1.5rem;
    border-top: 4px solid var(--primary);
    position: relative;
    overflow: hidden;
    animation: fadeInScale 0.6s ease-out;
}

.topic-box::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, transparent 70%);
    pointer-events: none;
}

.reply-box {
    background: rgba(255,255,255,0.95);
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.04);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid #e2e8f0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: fadeInUp 0.5s ease-out backwards;
}

.reply-box:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    transform: translateX(6px);
}

.reply-box.admin-reply {
    border-left-color: var(--accent-2);
    background: linear-gradient(135deg, #fffbeb, rgba(255,255,255,0.95));
}

.reply-box.member-reply {
    border-left-color: var(--primary);
    background: linear-gradient(135deg, #eef2ff, rgba(255,255,255,0.95));
}

/* ========================================
   USER BADGES
   ======================================== */
.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.user-badge:hover {
    transform: scale(1.05);
}

.badge-admin {
    background: var(--gradient-3);
    color: white;
    box-shadow: 0 3px 10px rgba(245,158,11,0.3);
}

.badge-member {
    background: var(--gradient-2);
    color: white;
    box-shadow: 0 3px 10px rgba(99,102,241,0.3);
}

.badge-guest {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    color: var(--gray);
}

/* ========================================
   MODALS - Zoom In Animation
   ======================================== */
.modal.fade .modal-dialog {
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-dialog {
    transform: scale(1);
}

.modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    overflow: hidden;
    animation: zoomIn 0.3s ease-out;
}

.modal-header {
    background: var(--gradient-2);
    color: white;
    border-bottom: none;
    padding: 1.35rem 1.75rem;
}

.modal-body {
    padding: 1.75rem;
}

/* ========================================
   FORMS - Floating Labels Effect
   ======================================== */
.form-control, .form-select {
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    padding: 0.85rem 1.15rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: rgba(255,255,255,0.9);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
    background: white;
    transform: translateY(-2px);
}

/* ========================================
   FOOTER
   ======================================== */
.footer-section {
    background: var(--gradient-admin);
    color: white;
    padding: 3rem 0;
    margin-top: 3rem;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out;
}

.footer-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="60" r="2" fill="rgba(255,255,255,0.08)"/><circle cx="50" cy="90" r="1" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: 60px;
    animation: float-slow 10s ease-in-out infinite;
}

.footer-section > * {
    position: relative;
    z-index: 1;
}

/* ========================================
   BREADCRUMBS
   ======================================== */
.breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.breadcrumb-item a:hover {
    color: var(--accent);
}

.breadcrumb-item.active {
    color: var(--gray);
    font-weight: 500;
}

/* ========================================
   CONTENT TEXT
   ======================================== */
.content-text {
    line-height: 1.85;
    color: #334155;
    white-space: pre-wrap;
}

/* ========================================
   HISTORY LINKS
   ======================================== */
.history-link {
    font-size: 0.8rem;
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
    font-weight: 500;
    transition: all 0.3s ease;
}

.history-link:hover {
    color: var(--accent);
}

/* ========================================
   EMPTY STATE
   ======================================== */
.empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
    background: rgba(255,255,255,0.7);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    animation: fadeInScale 0.6s ease-out;
}

.empty-state i {
    font-size: 4.5rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

/* ========================================
   ALERTS - Slide In
   ======================================== */
.alert {
    border: none;
    border-radius: 14px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    animation: slideInRight 0.5s ease-out;
}

.alert-dismissible .btn-close {
    transition: all 0.3s ease;
}

.alert-dismissible .btn-close:hover {
    transform: rotate(90deg);
}

/* ========================================
   LOGIN & REGISTER CARDS
   ======================================== */
.auth-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(24px);
    border-radius: 24px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.12);
    padding: 2.75rem;
    width: 100%;
    max-width: 440px;
    border: 1px solid rgba(255,255,255,0.6);
    position: relative;
    overflow: hidden;
    animation: fadeInScale 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gradient-1);
}

.auth-card::after {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 160px;
    height: 160px;
    background: var(--gradient-1);
    border-radius: 50%;
    opacity: 0.08;
    filter: blur(40px);
}

.auth-header i {
    font-size: 4rem;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: float-slow 4s ease-in-out infinite;
}

/* ========================================
   ADMIN SIDEBAR
   ======================================== */
.sidebar {
    background: var(--gradient-admin);
    min-height: 100vh;
    color: white;
    padding: 1.75rem;
    position: relative;
    overflow: hidden;
    animation: slideInLeft 0.5s ease-out;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="2"/></svg>');
    background-size: 80px;
    animation: float-slow 12s ease-in-out infinite;
}

.sidebar .nav-link {
    color: rgba(255,255,255,0.85);
    padding: 0.85rem 1.15rem;
    border-radius: 12px;
    margin-bottom: 0.35rem;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    z-index: 1;
}

.sidebar .nav-link:hover, .sidebar .nav-link.active {
    background: rgba(255,255,255,0.15);
    color: white;
    transform: translateX(8px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* ========================================
   STAT CARDS
   ======================================== */
.stat-card {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255,255,255,0.6);
    animation: fadeInUp 0.5s ease-out backwards;
}

.stat-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    transition: all 0.4s ease;
}

.stat-card:hover .stat-icon {
    transform: scale(1.15) rotate(-8deg);
}

/* ========================================
   TABLES
   ======================================== */
.table {
    border-radius: 16px;
    overflow: hidden;
}

.table thead th {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    font-weight: 600;
    color: var(--dark);
    border-bottom: 2px solid #cbd5e1;
    padding: 1rem;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: rgba(99,102,241,0.04);
    transform: scale(1.005);
}

.table tbody td {
    padding: 0.85rem 1rem;
}

/* ========================================
   LOADING SPINNER
   ======================================== */
.spinner-custom {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(99,102,241,0.15);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========================================
   WAVE SEPARATOR
   ======================================== */
.wave-separator {
    position: relative;
    height: 50px;
    overflow: hidden;
}

.wave-separator svg {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 100%;
}

/* ========================================
   HOVER IMAGE ZOOM
   ======================================== */
.img-hover-zoom {
    overflow: hidden;
    border-radius: 16px;
}

.img-hover-zoom img {
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.img-hover-zoom:hover img {
    transform: scale(1.1);
}

/* ========================================
   TOOLTIP STYLE
   ======================================== */
.custom-tooltip {
    position: relative;
}

.custom-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: var(--dark);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.custom-tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px);
}

/* ========================================
   SCROLLBAR
   ======================================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-2);
    border-radius: 5px;
    border: 2px solid #f1f5f9;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-dark), var(--primary));
}

/* ========================================
   DARK THEME (MIDNIGHT) OVERRIDES
   ======================================== */
body[data-theme="midnight"] {
    color: #e2e8f0;
}

body[data-theme="midnight"] .topic-item,
body[data-theme="midnight"] .reply-box,
body[data-theme="midnight"] .topic-box {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(99,102,241,0.2);
    color: #e2e8f0;
}

body[data-theme="midnight"] .category-card,
body[data-theme="midnight"] .stat-card,
body[data-theme="midnight"] .auth-card {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(99,102,241,0.15);
    color: #e2e8f0;
}

body[data-theme="midnight"] .content-text {
    color: #cbd5e1;
}

body[data-theme="midnight"] .topic-title {
    color: #818cf8;
}

body[data-theme="midnight"] .breadcrumb-item.active {
    color: #94a3b8;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    :root {
        --radius: 14px;
    }
    
    .category-card:hover {
        transform: translateY(-6px) scale(1.01);
    }
    
    .topic-item:hover {
        transform: translateX(5px);
    }
    
    .auth-card {
        padding: 2rem;
        margin: 1rem;
    }
    
    .sidebar {
        min-height: auto;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
