/* ==========================================================================
   test.my79.com 3-Column Modern & Legacy Hybrid Portal CSS
   (High-Legibility, Enhanced Contrast & Scaled Fonts for Light & Dark Modes)
   ========================================================================== */

:root {
    --font-primary: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    --font-display: 'Outfit', sans-serif;

    /* Dark Mode Defaults */
    --bg-main: #0B0F19;
    --bg-card: rgba(17, 24, 39, 0.92);
    --bg-card-hover: rgba(30, 41, 59, 0.98);
    --bg-header: rgba(11, 15, 25, 0.94);
    --border-color: rgba(255, 255, 255, 0.12);
    --border-hover: rgba(99, 102, 241, 0.6);
    
    --text-primary: #F9FAFB;
    --text-secondary: #D1D5DB;
    --text-muted: #9CA3AF;

    --accent-primary: #6366F1;
    --accent-gradient: linear-gradient(135deg, #6366F1 0%, #A855F7 50%, #EC4899 100%);
    --accent-glow: rgba(99, 102, 241, 0.3);

    --box-border: rgba(99, 102, 241, 0.3);
    --box-header-bg: rgba(99, 102, 241, 0.16);
    --box-header-text: #EEF2FF;

    --naver-green: #03C75A;
    --google-blue: #4285F4;
    --youtube-red: #FF0000;
    --daum-yellow: #FFB700;

    --tag-hot-bg: rgba(239, 68, 68, 0.2);
    --tag-hot-text: #F87171;
    --tag-new-bg: rgba(16, 185, 129, 0.2);
    --tag-new-text: #34D399;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;
}

/* ==========================================================================
   Light Mode (주간 모드 - 고대비 & 선명한 가독성 테마)
   ========================================================================== */
[data-theme="light"] {
    --bg-main: #F1F5F9;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F8FAFC;
    --bg-header: rgba(255, 255, 255, 0.98);
    --border-color: #CBD5E1;
    --border-hover: #4F46E5;

    --text-primary: #0F172A;
    --text-secondary: #1E293B;
    --text-muted: #475569;

    --box-border: #CBD5E1;
    --box-header-bg: #EEF2FF;
    --box-header-text: #1E1B4B;

    --accent-primary: #4F46E5;
    --accent-glow: rgba(79, 70, 229, 0.25);
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.55;
    transition: background-color 0.2s, color 0.2s;
    overflow-x: hidden;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    max-width: 1620px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ==========================================================================
   Top Header
   ========================================================================== */
.top-nav-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 0;
}

.top-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 24px;
    letter-spacing: -0.5px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.test-badge {
    font-size: 12px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: var(--radius-sm);
    background: #EC4899;
    color: #FFF;
    -webkit-text-fill-color: initial;
    vertical-align: middle;
}

.logo-sub {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 700;
}

.top-info-box {
    display: flex;
    align-items: center;
    gap: 16px;
}

.live-clock {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

[data-theme="light"] .live-clock {
    background: #FFFFFF;
    color: #0F172A;
    font-weight: 700;
}

.quick-status-badge {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

[data-theme="light"] .quick-status-badge {
    color: #1E293B;
    font-weight: 600;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
    box-shadow: 0 0 8px #10B981;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-toggle-btn, .login-link-btn, .register-link-btn, .logout-link-btn, .admin-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.theme-toggle-btn:hover, .login-link-btn:hover {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    color: #FFF;
}

.register-link-btn {
    background: rgba(99, 102, 241, 0.18);
    border-color: rgba(99, 102, 241, 0.4);
    color: #A5B4FC;
}

.register-link-btn:hover {
    background: var(--accent-gradient);
    border-color: transparent;
    color: #FFF;
}

.logout-link-btn {
    color: var(--text-muted);
}

.logout-link-btn:hover {
    border-color: #EF4444;
    background: #EF4444;
    color: #FFF;
}

.admin-link-btn {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.4);
    color: #818CF8;
}

.admin-link-btn:hover {
    background: #6366F1;
    border-color: #6366F1;
    color: #FFF;
}

.user-info-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34D399;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.user-info-chip:hover {
    background: rgba(16, 185, 129, 0.22);
    border-color: #34D399;
}

.user-lvl-badge {
    color: #F59E0B;
    font-weight: 800;
}

/* Alert Messages Banner */
.messages-container {
    margin-top: 10px;
}

.site-alert-msg {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    animation: fadeInSlide 0.3s ease-out;
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #34D399;
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #60A5FA;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #F87171;
}

.btn-close-alert {
    background: none;
    border: none;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
}

.btn-close-alert:hover {
    opacity: 1;
}

[data-theme="light"] .register-link-btn {
    background: #EEF2FF;
    border-color: #C7D2FE;
    color: #4F46E5;
}

[data-theme="light"] .register-link-btn:hover {
    background: #4F46E5;
    border-color: #4F46E5;
    color: #FFFFFF;
}

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

[data-theme="light"] .alert-info {
    background: #EFF6FF;
    border-color: #BFDBFE;
    color: #1D4ED8;
}

[data-theme="light"] .alert-error {
    background: #FEF2F2;
    border-color: #FECACA;
    color: #DC2626;
}

[data-theme="light"] .user-info-chip {
    background: #ECFDF5;
    border-color: #A7F3D0;
    color: #047857;
}

[data-theme="light"] .login-link-btn {
    background: #FFFFFF;
    border-color: #CBD5E1;
    color: #0F172A;
}

[data-theme="light"] .login-link-btn:hover {
    background: #4F46E5;
    border-color: #4F46E5;
    color: #FFFFFF;
}

[data-theme="light"] .admin-link-btn {
    background: #EEF2FF;
    border-color: #C7D2FE;
    color: #4338CA;
}

[data-theme="light"] .admin-link-btn:hover {
    background: #4F46E5;
    border-color: #4F46E5;
    color: #FFFFFF;
}

.theme-icon-light { display: none; }
.theme-icon-dark { display: inline-block; }

[data-theme="light"] .theme-icon-light { display: inline-block; color: #F59E0B; }
[data-theme="light"] .theme-icon-dark { display: none; }

/* Top Quick Nav */
.top-quick-nav {
    background: rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid var(--border-color);
    padding: 9px 0;
}

[data-theme="light"] .top-quick-nav {
    background: #FFFFFF;
    border-bottom: 1px solid #E2E8F0;
}

.top-quick-inner {
    display: flex;
    align-items: center;
    gap: 14px;
}

.quick-label {
    font-size: 13.5px;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
}

.quick-links-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 2px;
}

.quick-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s;
}

[data-theme="light"] .quick-chip {
    background: #F8FAFC;
    color: #0F172A;
    border-color: #CBD5E1;
}

.quick-chip:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

[data-theme="light"] .quick-chip:hover {
    background: #EEF2FF;
    color: #4338CA;
    border-color: #4338CA;
}

.chip-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    background: #EF4444;
    color: #FFF;
}

/* ==========================================================================
   3-Column Main Layout
   ========================================================================== */
.main-3col-wrapper {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    margin-bottom: 40px;
    align-items: flex-start;
}

/* ==========================================================================
   1. Left Sidebar (PHP Style Board & Chatroom Links)
   ========================================================================== */
.col-left-sidebar {
    width: 200px;
    flex-shrink: 0;
}

.left-nav-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

[data-theme="light"] .left-nav-box {
    background: #FFFFFF;
    border-color: #CBD5E1;
}

.left-group-header {
    margin-top: 14px;
    margin-bottom: 6px;
    text-align: center;
}

.left-group-header:first-child {
    margin-top: 2px;
}

.left-title-img {
    max-width: 100%;
    height: auto;
    display: inline-block;
}

.fallback-title {
    font-size: 14px;
    font-weight: 800;
    padding: 5px 8px;
    background: var(--box-header-bg);
    color: var(--box-header-text);
    border-radius: var(--radius-sm);
    text-align: left;
}

[data-theme="light"] .fallback-title {
    background: #E2E8F0;
    color: #0F172A;
}

.left-menu-list {
    list-style: none;
    margin-bottom: 8px;
}

.left-menu-list li {
    margin-bottom: 3px;
}

.left-menu-list li a {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="light"] .left-menu-list li a {
    color: #1E293B;
}

.left-menu-list li a:hover {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-primary);
    font-weight: 700;
    padding-left: 11px;
}

[data-theme="light"] .left-menu-list li a:hover {
    background: #EEF2FF;
    color: #4338CA;
}

.arrow-icon {
    color: var(--accent-primary);
    font-weight: 800;
    font-size: 15px;
}

[data-theme="light"] .arrow-icon {
    color: #4F46E5;
}

.left-extra-banners {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-banner-item img {
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

/* ==========================================================================
   2. Center Main
   ========================================================================== */
.col-center-main {
    flex: 1;
    min-width: 0;
}

/* ==========================================================================
   Top Center Split Row: (Left) Favorites/Recent Visits + (Right) Hero Banner
   ========================================================================== */
.top-center-split-row {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
    align-items: stretch;
}

/* 1. Left Card: User Favorites & Recent Visited Sites */
.user-favorites-recent-card {
    flex: 1.25;
    min-width: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

[data-theme="light"] .user-favorites-recent-card {
    background: #FFFFFF;
    border-color: #CBD5E1;
}

.fav-recent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

.fav-tabs {
    display: flex;
    gap: 6px;
}

.fav-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

[data-theme="light"] .fav-tab-btn {
    background: #F8FAFC;
    color: #334155;
    border-color: #CBD5E1;
}

.fav-tab-btn.active {
    background: var(--accent-primary);
    color: #FFF;
    border-color: var(--accent-primary);
}

[data-theme="light"] .fav-tab-btn.active {
    background: #4F46E5;
    color: #FFF;
    border-color: #4F46E5;
}

.fav-mini-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 600;
    padding: 3px 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}

.fav-mini-btn:hover {
    color: #EF4444;
    border-color: #EF4444;
    background: rgba(239, 68, 68, 0.1);
}

.fav-tab-content {
    display: none;
    flex: 1;
    max-height: 85px;
    overflow-y: auto;
    padding-right: 4px;
}

.fav-tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

/* Custom Sleek Scrollbar */
.fav-tab-content::-webkit-scrollbar {
    width: 5px;
}

.fav-tab-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.fav-tab-content::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.35);
    border-radius: 4px;
}

.fav-tab-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Favorites Grid */
.fav-chips-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.fav-chip-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="light"] .fav-chip-item {
    background: #F8FAFC;
    border-color: #E2E8F0;
    color: #0F172A;
    font-weight: 700;
}

.fav-chip-item:hover {
    background: var(--accent-primary);
    color: #FFF;
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

[data-theme="light"] .fav-chip-item:hover {
    background: #4F46E5;
    color: #FFFFFF;
    border-color: #4F46E5;
}

.chip-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    border-radius: 3px;
    font-size: 10.5px;
    font-weight: 800;
    flex-shrink: 0;
}

.naver-dot { background: #03C75A; color: #FFF; }
.youtube-dot { background: #FF0000; color: #FFF; }
.google-dot { background: #4285F4; color: #FFF; }
.daum-dot { background: #FFB700; color: #000; }
.coupang-dot { background: #C8102E; color: #FFF; }
.melon-dot { background: #00CD3C; color: #FFF; }
.map-dot { background: #10B981; color: #FFF; }
.gov-dot { background: #6366F1; color: #FFF; }

/* Recent Visits List */
.recent-chips-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.recent-chip-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

[data-theme="light"] .recent-chip-item {
    background: #F8FAFC;
    border-color: #E2E8F0;
    color: #0F172A;
    font-weight: 700;
}

.recent-chip-item:hover {
    background: #10B981;
    color: #FFF;
    border-color: #10B981;
}

.recent-icon {
    color: #10B981;
    font-weight: 900;
}

.recent-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-badge {
    font-size: 9.5px;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 3px;
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
}

.fav-hint-tip {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

[data-theme="light"] .fav-hint-tip {
    color: #64748B;
}

.btn-del-chip {
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.6;
    font-size: 14px;
    font-weight: 800;
    padding: 0 3px;
    margin-left: 2px;
    cursor: pointer;
    border-radius: 3px;
    transition: opacity 0.15s, background 0.15s, color 0.15s;
    line-height: 1;
}

.recent-chip-item:hover .btn-del-chip {
    opacity: 1;
    color: #EF4444;
}

.btn-del-chip:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #EF4444;
}

.empty-recent-msg {
    grid-column: 1 / -1;
    padding: 18px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* Global Floating Toast Notification */
.portal-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(17, 24, 39, 0.95);
    color: #FFFFFF;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    font-size: 13.5px;
    font-weight: 700;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
    backdrop-filter: blur(8px);
}

.portal-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

[data-theme="light"] .portal-toast {
    background: rgba(15, 23, 42, 0.95);
    color: #FFFFFF;
    border-color: rgba(0, 0, 0, 0.3);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

/* 2. "친구야! 놀자" Hero Visual Banner (좌측/우측 배치 지원) */
.main-banner-hero-left,
.main-banner-hero-right {
    flex: 1;
    min-width: 260px;
    height: 130px;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: linear-gradient(135deg, #1E1B4B 0%, #312E81 100%);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.hero-bg-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
}

.hero-overlay-content {
    position: relative;
    z-index: 2;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.hero-main-title {
    font-size: 26px;
    font-weight: 900;
    color: #FFF;
    margin-bottom: 2px;
    letter-spacing: -0.5px;
}

.hero-main-sub {
    font-size: 13.5px;
    color: #E0E7FF;
    font-weight: 600;
}

/* Search Card */
.center-search-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

[data-theme="light"] .center-search-card {
    background: #FFFFFF;
    border-color: #CBD5E1;
}

.search-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.search-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

[data-theme="light"] .search-tab {
    background: #F8FAFC;
    color: #334155;
    border-color: #CBD5E1;
}

.search-tab.active {
    background: var(--accent-primary);
    color: #FFF;
    border-color: var(--accent-primary);
}

[data-theme="light"] .search-tab.active {
    background: #4F46E5;
    color: #FFF;
    border-color: #4F46E5;
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
}

.naver-badge { background: var(--naver-green); color: #FFF; }
.google-badge { background: var(--google-blue); color: #FFF; }
.youtube-badge { background: var(--youtube-red); color: #FFF; }
.daum-badge { background: var(--daum-yellow); color: #000; }

.search-input-form {
    display: flex;
    gap: 8px;
}

.input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 16px;
}

.search-input-form input {
    width: 100%;
    padding: 11px 40px 11px 40px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 15.5px;
    font-weight: 500;
    outline: none;
    transition: all 0.2s;
}

[data-theme="light"] .search-input-form input {
    background: #F8FAFC;
    border-color: #CBD5E1;
    color: #0F172A;
}

.search-input-form input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 24px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    border: none;
    color: #FFF;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.search-submit-btn:hover {
    opacity: 0.9;
}

/* ==========================================================================
   Category Boxes Grid (PHP Style Clean 1-Line Items with Scaled Fonts)
   ========================================================================== */
.main-category-boxes-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.php-portal-box {
    background: var(--bg-card);
    border: 1px solid var(--box-border);
    border-radius: var(--radius-md);
    overflow: visible !important;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.php-portal-box:hover {
    border-color: var(--accent-primary);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.php-portal-box.has-open-dropdown {
    z-index: 1000 !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

.box-header {
    background: var(--box-header-bg);
    color: var(--box-header-text);
    padding: 9px 12px;
    font-size: 15px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 6px;
    border-bottom: 1px solid var(--border-color);
}

.box-symbol {
    font-size: 15px;
    font-weight: 900;
}

.box-title {
    letter-spacing: -0.3px;
    text-align: center;
}

.box-count {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

.box-link-list {
    list-style: none;
    padding: 6px 0;
    flex: 1;
}

.box-link-row {
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

.box-link-row:last-child {
    border-bottom: none;
}

.link-line {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bullet-dot {
    font-size: 15px;
    font-weight: 800;
}

.link-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-tag {
    font-size: 10px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    margin-left: 4px;
}

.tag-hot { background: var(--tag-hot-bg); color: var(--tag-hot-text); }
.tag-new { background: var(--tag-new-bg); color: var(--tag-new-text); }

.empty-row {
    padding: 14px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

/* ==========================================================================
   Central Category Box - 8 Cycling Soft Pastel Toned Themes (연한 파스텔 배경색)
   ========================================================================== */

/* 1. Warm Amber / Gold (오렌지/호박색) */
.php-portal-box:nth-child(8n + 1) {
    background: rgba(245, 158, 11, 0.07);
    border-color: rgba(245, 158, 11, 0.35);
}
.php-portal-box:nth-child(8n + 1) .box-header {
    background: rgba(245, 158, 11, 0.18);
    color: #FDE68A;
    border-bottom-color: rgba(245, 158, 11, 0.28);
}
.php-portal-box:nth-child(8n + 1) .box-symbol { color: #F59E0B; }
.php-portal-box:nth-child(8n + 1) .bullet-dot,
.php-portal-box:nth-child(8n + 1) .btn-more-toggle { color: #F59E0B; }
.php-portal-box:nth-child(8n + 1) .link-line:hover { background: rgba(245, 158, 11, 0.14); color: #FBBF24; }
.php-portal-box:nth-child(8n + 1):hover {
    border-color: #F59E0B;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.22);
}

/* 2. Sky / Ocean Blue (하늘/스카이블루) */
.php-portal-box:nth-child(8n + 2) {
    background: rgba(14, 165, 233, 0.07);
    border-color: rgba(14, 165, 233, 0.35);
}
.php-portal-box:nth-child(8n + 2) .box-header {
    background: rgba(14, 165, 233, 0.18);
    color: #BAE6FD;
    border-bottom-color: rgba(14, 165, 233, 0.28);
}
.php-portal-box:nth-child(8n + 2) .box-symbol { color: #0EA5E9; }
.php-portal-box:nth-child(8n + 2) .bullet-dot,
.php-portal-box:nth-child(8n + 2) .btn-more-toggle { color: #0EA5E9; }
.php-portal-box:nth-child(8n + 2) .link-line:hover { background: rgba(14, 165, 233, 0.14); color: #38BDF8; }
.php-portal-box:nth-child(8n + 2):hover {
    border-color: #0EA5E9;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.22);
}

/* 3. Mint / Sage Green (민트/초록) */
.php-portal-box:nth-child(8n + 3) {
    background: rgba(16, 185, 129, 0.07);
    border-color: rgba(16, 185, 129, 0.35);
}
.php-portal-box:nth-child(8n + 3) .box-header {
    background: rgba(16, 185, 129, 0.18);
    color: #A7F3D0;
    border-bottom-color: rgba(16, 185, 129, 0.28);
}
.php-portal-box:nth-child(8n + 3) .box-symbol { color: #10B981; }
.php-portal-box:nth-child(8n + 3) .bullet-dot,
.php-portal-box:nth-child(8n + 3) .btn-more-toggle { color: #10B981; }
.php-portal-box:nth-child(8n + 3) .link-line:hover { background: rgba(16, 185, 129, 0.14); color: #34D399; }
.php-portal-box:nth-child(8n + 3):hover {
    border-color: #10B981;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.22);
}

/* 4. Indigo / Royal Violet (인디고/블루) */
.php-portal-box:nth-child(8n + 4) {
    background: rgba(99, 102, 241, 0.07);
    border-color: rgba(99, 102, 241, 0.35);
}
.php-portal-box:nth-child(8n + 4) .box-header {
    background: rgba(99, 102, 241, 0.18);
    color: #C7D2FE;
    border-bottom-color: rgba(99, 102, 241, 0.28);
}
.php-portal-box:nth-child(8n + 4) .box-symbol { color: #6366F1; }
.php-portal-box:nth-child(8n + 4) .bullet-dot,
.php-portal-box:nth-child(8n + 4) .btn-more-toggle { color: #6366F1; }
.php-portal-box:nth-child(8n + 4) .link-line:hover { background: rgba(99, 102, 241, 0.14); color: #818CF8; }
.php-portal-box:nth-child(8n + 4):hover {
    border-color: #6366F1;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.22);
}

/* 5. Rose / Coral Pink (로즈/핑크) */
.php-portal-box:nth-child(8n + 5) {
    background: rgba(244, 63, 94, 0.07);
    border-color: rgba(244, 63, 94, 0.35);
}
.php-portal-box:nth-child(8n + 5) .box-header {
    background: rgba(244, 63, 94, 0.18);
    color: #FECDD3;
    border-bottom-color: rgba(244, 63, 94, 0.28);
}
.php-portal-box:nth-child(8n + 5) .box-symbol { color: #F43F5E; }
.php-portal-box:nth-child(8n + 5) .bullet-dot,
.php-portal-box:nth-child(8n + 5) .btn-more-toggle { color: #F43F5E; }
.php-portal-box:nth-child(8n + 5) .link-line:hover { background: rgba(244, 63, 94, 0.14); color: #FB7185; }
.php-portal-box:nth-child(8n + 5):hover {
    border-color: #F43F5E;
    box-shadow: 0 4px 16px rgba(244, 63, 94, 0.22);
}

/* 6. Purple / Lavender (보라/라벤더) */
.php-portal-box:nth-child(8n + 6) {
    background: rgba(168, 85, 247, 0.07);
    border-color: rgba(168, 85, 247, 0.35);
}
.php-portal-box:nth-child(8n + 6) .box-header {
    background: rgba(168, 85, 247, 0.18);
    color: #E9D5FF;
    border-bottom-color: rgba(168, 85, 247, 0.28);
}
.php-portal-box:nth-child(8n + 6) .box-symbol { color: #A855F7; }
.php-portal-box:nth-child(8n + 6) .bullet-dot,
.php-portal-box:nth-child(8n + 6) .btn-more-toggle { color: #A855F7; }
.php-portal-box:nth-child(8n + 6) .link-line:hover { background: rgba(168, 85, 247, 0.14); color: #C084FC; }
.php-portal-box:nth-child(8n + 6):hover {
    border-color: #A855F7;
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.22);
}

/* 7. Teal / Aqua (청록/아쿠아) */
.php-portal-box:nth-child(8n + 7) {
    background: rgba(20, 184, 166, 0.07);
    border-color: rgba(20, 184, 166, 0.35);
}
.php-portal-box:nth-child(8n + 7) .box-header {
    background: rgba(20, 184, 166, 0.18);
    color: #99F6E4;
    border-bottom-color: rgba(20, 184, 166, 0.28);
}
.php-portal-box:nth-child(8n + 7) .box-symbol { color: #14B8A6; }
.php-portal-box:nth-child(8n + 7) .bullet-dot,
.php-portal-box:nth-child(8n + 7) .btn-more-toggle { color: #14B8A6; }
.php-portal-box:nth-child(8n + 7) .link-line:hover { background: rgba(20, 184, 166, 0.14); color: #2DD4BF; }
.php-portal-box:nth-child(8n + 7):hover {
    border-color: #14B8A6;
    box-shadow: 0 4px 16px rgba(20, 184, 166, 0.22);
}

/* 8. Sunset Orange / Peach (복숭아/주황) */
.php-portal-box:nth-child(8n + 8) {
    background: rgba(249, 115, 22, 0.07);
    border-color: rgba(249, 115, 22, 0.35);
}
.php-portal-box:nth-child(8n + 8) .box-header {
    background: rgba(249, 115, 22, 0.18);
    color: #FED7AA;
    border-bottom-color: rgba(249, 115, 22, 0.28);
}
.php-portal-box:nth-child(8n + 8) .box-symbol { color: #F97316; }
.php-portal-box:nth-child(8n + 8) .bullet-dot,
.php-portal-box:nth-child(8n + 8) .btn-more-toggle { color: #F97316; }
.php-portal-box:nth-child(8n + 8) .link-line:hover { background: rgba(249, 115, 22, 0.14); color: #FB923C; }
.php-portal-box:nth-child(8n + 8):hover {
    border-color: #F97316;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.22);
}

/* ==========================================================================
   Light Mode (주간 모드) - High Contrast Dark Header & Rich Pastel Box Overrides
   ========================================================================== */
[data-theme="light"] .php-portal-box {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-width: 2px;
}

/* 주간모드 중앙 박스 이름: 검은 바탕에 흰색 글자 */
[data-theme="light"] .php-portal-box .box-header {
    background: #111827 !important;
    color: #FFFFFF !important;
    border-bottom: 2px solid #000000 !important;
    padding: 10px 12px;
}

[data-theme="light"] .php-portal-box .box-title {
    color: #FFFFFF !important;
    font-weight: 800 !important;
}

[data-theme="light"] .php-portal-box .box-symbol {
    color: #FBBF24 !important;
}

[data-theme="light"] .php-portal-box .box-count {
    color: #E2E8F0 !important;
    font-weight: 700 !important;
}

[data-theme="light"] .box-link-row {
    border-bottom: 1px dashed rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .link-line {
    color: #000000 !important;
    font-weight: 700;
}

[data-theme="light"] .link-line:hover {
    color: #000000 !important;
    font-weight: 900;
    background: rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .bullet-dot {
    color: #000000 !important;
    font-weight: 900;
}

[data-theme="light"] .box-more-footer {
    background: rgba(0, 0, 0, 0.08) !important;
    border-top: 1px solid rgba(0, 0, 0, 0.15) !important;
}

[data-theme="light"] .btn-more-toggle {
    color: #000000 !important;
    font-weight: 900 !important;
}

[data-theme="light"] .btn-more-toggle:hover {
    background: rgba(0, 0, 0, 0.14) !important;
}

/* 1. Rich Amber/Yellow (진한 호박/노랑) */
[data-theme="light"] .php-portal-box:nth-child(8n + 1) { background: #FEF08A !important; border-color: #D97706 !important; }

/* 2. Rich Sky Blue (진한 하늘색) */
[data-theme="light"] .php-portal-box:nth-child(8n + 2) { background: #BAE6FD !important; border-color: #0284C7 !important; }

/* 3. Rich Mint Green (진한 민트/연두) */
[data-theme="light"] .php-portal-box:nth-child(8n + 3) { background: #BBF7D0 !important; border-color: #16A34A !important; }

/* 4. Rich Indigo/Lavender (진한 인디고/연보라) */
[data-theme="light"] .php-portal-box:nth-child(8n + 4) { background: #DDD6FE !important; border-color: #4F46E5 !important; }

/* 5. Rich Rose Pink (진한 로즈/핑크) */
[data-theme="light"] .php-portal-box:nth-child(8n + 5) { background: #FECDD3 !important; border-color: #E11D48 !important; }

/* 6. Rich Purple (진한 자주/퍼플) */
[data-theme="light"] .php-portal-box:nth-child(8n + 6) { background: #E9D5FF !important; border-color: #9333EA !important; }

/* 7. Rich Teal/Aqua (진한 청록/아쿠아) */
[data-theme="light"] .php-portal-box:nth-child(8n + 7) { background: #99F6E4 !important; border-color: #0D9488 !important; }

/* 8. Rich Sunset Peach/Orange (진한 살구/주황) */
[data-theme="light"] .php-portal-box:nth-child(8n + 8) { background: #FED7AA !important; border-color: #EA580C !important; }


/* ==========================================================================
   MORE Button & Floating Dropdown Overlay (페이지 늘어남 없는 팝업 드롭다운)
   ========================================================================== */
.php-portal-box {
    position: relative;
    overflow: visible !important;
}

.box-more-footer {
    position: relative;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .box-more-footer {
    background: rgba(0, 0, 0, 0.03);
    border-top-color: #E2E8F0;
}

.btn-more-dropdown-toggle {
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: none;
    color: var(--accent-primary);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.15s, color 0.15s;
}

.btn-more-dropdown-toggle:hover {
    background: rgba(99, 102, 241, 0.15);
}

[data-theme="light"] .btn-more-dropdown-toggle {
    color: #4F46E5 !important;
    font-weight: 800 !important;
}

[data-theme="light"] .btn-more-dropdown-toggle:hover {
    background: rgba(79, 70, 229, 0.1) !important;
}

.toggle-icon {
    font-size: 11px;
    transition: transform 0.2s;
}

/* Floating Dropdown Menu Container (떨림 및 깜빡임 없는 안정적 렌더링) */
.more-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: -1px;
    right: -1px;
    z-index: 1001;
    background: #0F172A;
    border: 2px solid var(--accent-primary);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.1);
    flex-direction: column;
    overflow: hidden;
    pointer-events: auto;
}

[data-theme="light"] .more-dropdown-menu {
    background: #FFFFFF;
    border-color: #4F46E5;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(79, 70, 229, 0.25);
}

.more-dropdown-menu.active {
    display: flex !important;
}

.dropdown-header {
    padding: 8px 12px;
    background: rgba(99, 102, 241, 0.25);
    font-size: 12.5px;
    font-weight: 800;
    color: #EEF2FF;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

[data-theme="light"] .dropdown-header {
    background: #EEF2FF;
    color: #1E1B4B;
    border-bottom-color: #CBD5E1;
}

.btn-close-dropdown {
    background: transparent;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.15s;
}

.btn-close-dropdown:hover {
    color: #EF4444;
}

.dropdown-link-list {
    list-style: none;
    padding: 4px 0;
    max-height: 240px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.dropdown-link-item {
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .dropdown-link-item {
    border-bottom: 1px dashed rgba(0, 0, 0, 0.1);
}

.dropdown-link-item:last-child {
    border-bottom: none;
}

.dropdown-link-line {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    transition: background 0.1s, color 0.1s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-link-line:hover {
    background: rgba(99, 102, 241, 0.25);
    color: #A5B4FC;
}

[data-theme="light"] .dropdown-link-line {
    color: #0F172A;
}

[data-theme="light"] .dropdown-link-line:hover {
    background: #EEF2FF;
    color: #4F46E5;
}

/* ==========================================================================
   3. Right Sidebar (Moved Widgets + Banner Ads)
   ========================================================================== */
.col-right-sidebar {
    width: 230px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.side-widget-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

[data-theme="light"] .side-widget-card {
    background: #FFFFFF;
    border-color: #CBD5E1;
}

.widget-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="light"] .widget-head {
    background: #F8FAFC;
    border-bottom-color: #E2E8F0;
}

.widget-head h3 {
    font-size: 14.5px;
    font-weight: 800;
    letter-spacing: -0.3px;
}

[data-theme="light"] .widget-head h3 {
    color: #0F172A;
}

.text-accent {
    color: var(--accent-primary);
}

.widget-content {
    padding: 10px;
}

/* Tool Grid */
.tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.tool-btn-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.15s;
    white-space: nowrap;
}

[data-theme="light"] .tool-btn-item {
    background: #F8FAFC;
    border-color: #CBD5E1;
    color: #0F172A;
    font-weight: 700;
}

.tool-btn-item:hover {
    background: var(--accent-primary);
    color: #FFF;
    border-color: var(--accent-primary);
}

[data-theme="light"] .tool-btn-item:hover {
    background: #4F46E5;
    color: #FFF;
    border-color: #4F46E5;
}

/* Ranking List */
.ranking-num-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ranking-num-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .ranking-num-list li {
    border-bottom: 1px dashed #E2E8F0;
}

.ranking-num-list li:last-child {
    border-bottom: none;
}

.rank-badge {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

[data-theme="light"] .rank-badge {
    background: #E2E8F0;
    color: #0F172A;
}

.rank-1 { background: #EF4444; color: #FFF; }
.rank-2 { background: #F97316; color: #FFF; }
.rank-3 { background: #F59E0B; color: #FFF; }

.ranking-link-title {
    flex: 1;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}

[data-theme="light"] .ranking-link-title {
    color: #0F172A;
}

.ranking-link-title:hover {
    color: var(--accent-primary);
    font-weight: 700;
}

.views-count {
    font-size: 11.5px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Banner Ads */
.ad-banners-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
}

.ad-banner-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

[data-theme="light"] .ad-banner-item {
    border-color: #CBD5E1;
}

.ad-img {
    width: 100%;
    display: block;
    transition: transform 0.2s;
}

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

/* ==========================================================================
   Footer
   ========================================================================== */
.portal-footer {
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    margin-top: 50px;
}

[data-theme="light"] .portal-footer {
    background: #FFFFFF;
    border-top: 1px solid #E2E8F0;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-logo {
    font-size: 16px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.footer-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.copyright {
    font-size: 12px;
    color: var(--text-muted);
}

.back-to-top-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s;
}

.back-to-top-btn:hover {
    background: var(--accent-primary);
    color: #FFF;
    border-color: var(--accent-primary);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1480px) {
    .main-category-boxes-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 8px;
    }
}

@media (max-width: 1250px) {
    .main-category-boxes-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 10px;
    }
}

@media (max-width: 1024px) {
    .main-3col-wrapper {
        flex-direction: column;
    }
    .col-left-sidebar, .col-right-sidebar {
        width: 100%;
    }
    .main-category-boxes-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .tool-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 680px) {
    .main-category-boxes-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .main-category-boxes-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Left Sidebar Write Action Buttons
   ========================================================================== */
.btn-sidebar-write, .btn-portal-left-write {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 14px;
    background: var(--accent-gradient);
    color: #FFFFFF !important;
    border-radius: var(--radius-md);
    font-size: 14.5px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 4px 14px var(--accent-glow);
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
    margin-bottom: 16px;
    border: none;
    cursor: pointer;
}

.btn-sidebar-write:hover, .btn-portal-left-write:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px var(--accent-glow);
    opacity: 0.95;
    color: #FFFFFF !important;
}

.btn-sidebar-write i, .btn-portal-left-write i {
    font-size: 15px;
}

