/* News category page styles */
/* ===========================================================================
    SKY BLUE & WHITE THEME - Compact Sidebar Version
   =========================================================================== */

:root {
    --primary: #0ea5e9;
    --primary-light: #38bdf8;
    --primary-dark: #0284c7;
    --accent: #06b6d4;
    --accent-light: #22d3ee;
    --success: #14b8a6;
    --success-light: rgba(20, 184, 166, 0.1);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --bg-body: #f0f9ff;
    --bg-card: #ffffff;
    --bg-hover: #e0f2fe;
    --bg-section: #f0f9ff;
    --bg-light-blue: #e0f2fe;
    --border: #bae6fd;
    --border-light: #e0f2fe;
    --shadow-sm: 0 1px 3px rgba(14, 165, 233, 0.08);
    --shadow-md: 0 4px 15px rgba(14, 165, 233, 0.12);
    --shadow-lg: 0 15px 40px rgba(14, 165, 233, 0.15);
    --shadow-blue: 0 8px 30px rgba(14, 165, 233, 0.2);
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 14px;
    --radius-full: 9999px;
    --transition-base: 0.26s cubic-bezier(0.4, 0, 0.2, 1);
    --transition: color var(--transition-base), background-color var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base), opacity var(--transition-base), transform var(--transition-base);
}

[data-theme="dark"],
html.dark-mode,
body.dark-mode {
    --primary: #38bdf8;
    --primary-light: #7dd3fc;
    --primary-dark: #0ea5e9;
    --accent: #22d3ee;
    --text-primary: #edf6ff;
    --text-secondary: #c8d7e8;
    --text-muted: #9aa9bd;
    --text-light: #8ea0b5;
    --bg-body: #0b1220;
    --bg-card: #111c2e;
    --bg-hover: #1b2d46;
    --bg-section: #16243a;
    --bg-light-blue: rgba(56, 189, 248, 0.12);
    --border: rgba(96, 165, 250, 0.24);
    --border-light: rgba(148, 163, 184, 0.16);
    --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 18px 44px rgba(0, 0, 0, 0.28);
    --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.36);
    --shadow-blue: 0 18px 48px rgba(14, 165, 233, 0.22);
}

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

body {
    font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) {
    background:
        radial-gradient(circle at 15% 5%, rgba(56, 189, 248, 0.16), transparent 32rem),
        radial-gradient(circle at 85% 18%, rgba(37, 99, 235, 0.12), transparent 30rem),
        linear-gradient(180deg, #0b1220 0%, #0e1728 48%, #0b1220 100%);
}

/* ===========================================================================
   HERO SECTION - Animated
   =========================================================================== */
.hero {
    background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 50%, #7dd3fc 100%);
    padding: 2.5rem 1.5rem 6rem;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .hero,
html.dark-mode .hero,
body.dark-mode .hero {
    background:
        linear-gradient(135deg, rgba(8, 47, 73, 0.98) 0%, rgba(14, 116, 144, 0.96) 52%, rgba(29, 78, 216, 0.94) 100%);
    box-shadow: inset 0 -1px 0 rgba(125, 211, 252, 0.2);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    animation: patternMove 40s linear infinite;
    opacity: 0.5;
}

@keyframes patternMove {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 60px 60px;
    }
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-body);
    clip-path: ellipse(75% 100% at 50% 100%);
}

.hero-circles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.hero-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 20s infinite ease-in-out;
}

:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .hero-circle {
    background: rgba(186, 230, 253, 0.08);
    border: 1px solid rgba(186, 230, 253, 0.08);
}

.hero-circle:nth-child(1) {
    width: 80px;
    height: 80px;
    left: 10%;
    top: 20%;
    animation-delay: 0s;
    animation-duration: 15s;
}

.hero-circle:nth-child(2) {
    width: 120px;
    height: 120px;
    right: 15%;
    top: 30%;
    animation-delay: 2s;
    animation-duration: 20s;
}

.hero-circle:nth-child(3) {
    width: 60px;
    height: 60px;
    left: 70%;
    top: 10%;
    animation-delay: 4s;
    animation-duration: 18s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.3;
    }

    50% {
        transform: translateY(-30px) rotate(180deg);
        opacity: 0.6;
    }
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    color: white;
    font-size: 0.75rem;
    font-weight: 400;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    letter-spacing: 0;
    animation: fadeInDown 0.8s ease-out;
}

.hero h1 {
    font-family: 'Noto Serif Thai', Georgia, serif;
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 600;
    color: white;
    margin-bottom: 0.75rem;
    letter-spacing: 0;
    line-height: 1.3;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    font-weight: 400;
    margin-bottom: 1.5rem;
    letter-spacing: 0;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* Search Box */
.search-container {
    max-width: 600px;
    margin: 2rem auto 1.5rem;
    position: relative;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.search-box {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem 3.5rem 1rem 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    color: white;
    font-size: 0.9375rem;
    font-weight: 400;
    transition: var(--transition);
    font-family: inherit;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .search-input,
html.dark-mode .search-input,
body.dark-mode .search-input {
    background: rgba(15, 23, 42, 0.38);
    border-color: rgba(125, 211, 252, 0.36);
    color: white;
}

[data-theme="dark"] .search-input::placeholder,
html.dark-mode .search-input::placeholder,
body.dark-mode .search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-icon {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.125rem;
    pointer-events: none;
}

.search-loading {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    display: none;
}

.search-loading.active {
    display: block;
}

.search-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.search-clear {
    position: absolute;
    right: 3.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 0.875rem;
}

.search-clear.active {
    display: flex;
}

.search-clear:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.hero-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.hero-stat {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-lg);
    padding: 1rem 1.75rem;
    text-align: center;
    min-width: 100px;
    transition: var(--transition);
    animation: fadeInUp 0.8s ease-out both;
}

.hero-stat:nth-child(1) {
    animation-delay: 0.8s;
}

.hero-stat:nth-child(2) {
    animation-delay: 1s;
}

.hero-stat:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .hero-stat,
html.dark-mode .hero-stat,
body.dark-mode .hero-stat {
    background: rgba(14, 165, 233, 0.15);
    border-color: rgba(56, 189, 248, 0.3);
}

.stat-value {
    font-size: 2rem;
    font-weight: 500;
    color: #ffffff;
    display: block;
    line-height: 1;
    letter-spacing: 0;
}

.stat-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 0.4rem;
    font-weight: 400;
    letter-spacing: 0;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================================================================
   MAIN LAYOUT
   =========================================================================== */
.main-container {
    max-width: 1400px;
    margin: -3rem auto 3rem;
    padding: 0 1.25rem;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    position: relative;
    z-index: 10;
    align-items: start;
}

:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .main-container {
    color: var(--text-primary);
}

.search-info {
    background: var(--bg-card);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    display: none;
    align-items: center;
    justify-content: space-between;
    animation: fadeInDown 0.4s ease-out;
}

.search-info.active {
    display: flex;
}

.search-info-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.search-info-text strong {
    color: var(--primary);
    font-weight: 400;
}

.search-close {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 400;
    font-family: inherit;
}

.search-close:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* ===========================================================================
   NEWS GRID
   =========================================================================== */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.news-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    animation: fadeUp 0.5s ease-out both;
}

.news-card:nth-child(1) {
    animation-delay: 0.05s;
}

.news-card:nth-child(2) {
    animation-delay: 0.1s;
}

.news-card:nth-child(3) {
    animation-delay: 0.15s;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-blue);
    border-color: var(--primary);
}

.card-image {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.news-card:hover .card-image img {
    transform: scale(1.08);
}

.card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 3rem;
}

.card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: 0;
}

.card-title a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-base);
}

.card-title a:hover {
    color: var(--primary);
}

.highlight {
    background: rgba(14, 165, 233, 0.2);
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
    font-weight: 400;
}

.card-excerpt {
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
    flex: 1;
    font-weight: 400;
    letter-spacing: 0;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.card-date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-light);
    font-weight: 400;
}

.card-date i {
    font-size: 0.7rem;
    color: var(--primary);
}

.admin-btns {
    display: flex;
    gap: 0.4rem;
}

.btn-admin-sm {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 0.75rem;
}

.btn-edit-sm {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.btn-edit-sm:hover {
    background: var(--warning);
    color: white;
    transform: scale(1.1);
}

.btn-delete-sm {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.btn-delete-sm:hover {
    background: var(--danger);
    color: white;
    transform: scale(1.1);
}

.news-grid.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ===========================================================================
   SIDEBAR - COMPACT VERSION
   =========================================================================== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.sidebar-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    animation: fadeUp 0.5s ease-out 0.2s both;
}

.sidebar-card:hover {
    box-shadow: var(--shadow-md);
}

.sidebar-header {
    padding: 0.875rem 1.125rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
}

[data-theme="dark"] .sidebar-header,
html.dark-mode .sidebar-header,
body.dark-mode .sidebar-header {
    background: linear-gradient(135deg, #0284c7 0%, #06b6d4 100%);
}

.sidebar-header h3 {
    font-size: 0.8125rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    letter-spacing: 0;
}

.sidebar-header i {
    font-size: 0.875rem;
}

/* Category List - Compact */
.category-list {
    list-style: none;
    padding: 0.25rem 0;
}

.category-item {
    border-bottom: 1px solid var(--border-light);
}

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

.category-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.8125rem;
    font-weight: 400;
    position: relative;
}

.category-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary);
    transform: scaleY(0);
    transition: transform var(--transition-base);
}

.category-link:hover::before,
.category-link.active::before {
    transform: scaleY(1);
}

.category-link:hover {
    background: var(--bg-light-blue);
    padding-left: 1.25rem;
}

.category-link.active {
    background: var(--bg-light-blue);
    padding-left: 1.25rem;
}

.category-link.active .category-name {
    color: var(--primary);
    font-weight: 400;
}

.category-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    flex-shrink: 0;
    transition: var(--transition);
}

.category-link:hover .category-icon {
    transform: scale(1.1);
}

.category-icon.all {
    background: rgba(14, 165, 233, 0.1);
    color: var(--primary);
}

.category-icon.featured {
    background: rgba(234, 179, 8, 0.1);
    color: #eab308;
}

.category-icon.pr {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.category-icon.admission {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.category-icon.results {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.category-icon.student {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

.category-icon.teacher {
    background: rgba(20, 184, 166, 0.1);
    color: #14b8a6;
}

.category-icon.award {
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
}

.category-icon.budget {
    background: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
}

.category-icon.history {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.category-icon.location {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.category-icon.default {
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
}

.category-icon.home {
    background: rgba(14, 165, 233, 0.1);
    color: var(--primary);
}

.category-icon.education {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.category-icon.users {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

.category-icon.calendar {
    background: rgba(249, 115, 22, 0.1);
    color: #f97316;
}

[data-theme="dark"] .category-icon.all,
html.dark-mode .category-icon.all,
body.dark-mode .category-icon.all {
    background: rgba(56, 189, 248, 0.15);
}

.category-name {
    flex: 1;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: 0;
}

.category-link:hover .category-name {
    color: var(--primary);
}

.category-badge {
    background: var(--primary);
    color: white;
    font-size: 0.6875rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-weight: 400;
    min-width: 24px;
    text-align: center;
}

/* ===========================================================================
   QUICK LINKS - ICON GRID VERSION
   =========================================================================== */
.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 1rem;
}

.quick-link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.75rem;
    border-radius: var(--radius-md);
    background: var(--bg-section);
    border: 1px solid var(--border-light);
    text-decoration: none;
    transition: var(--transition);
    text-align: center;
}

.quick-link-item:hover {
    background: var(--bg-light-blue);
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.quick-link-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.quick-link-item:hover .quick-link-icon {
    transform: scale(1.1);
}

.quick-link-icon.home {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(14, 165, 233, 0.25));
    color: var(--primary);
}

.quick-link-icon.education {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.25));
    color: #8b5cf6;
}

.quick-link-icon.users {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(236, 72, 153, 0.25));
    color: #ec4899;
}

.quick-link-icon.calendar {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.15), rgba(249, 115, 22, 0.25));
    color: #f97316;
}

[data-theme="dark"] .quick-link-icon.home,
html.dark-mode .quick-link-icon.home,
body.dark-mode .quick-link-icon.home {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(56, 189, 248, 0.3));
}

[data-theme="dark"] .quick-link-icon.education,
html.dark-mode .quick-link-icon.education,
body.dark-mode .quick-link-icon.education {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(139, 92, 246, 0.3));
}

[data-theme="dark"] .quick-link-icon.users,
html.dark-mode .quick-link-icon.users,
body.dark-mode .quick-link-icon.users {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(236, 72, 153, 0.3));
}

[data-theme="dark"] .quick-link-icon.calendar,
html.dark-mode .quick-link-icon.calendar,
body.dark-mode .quick-link-icon.calendar {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2), rgba(249, 115, 22, 0.3));
}

.quick-link-name {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: 0;
}

.quick-link-item:hover .quick-link-name {
    color: var(--primary);
}

/* ===========================================================================
   PAGINATION
   =========================================================================== */
.pagination-wrap {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    list-style: none;
}

.page-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.875rem;
    border-radius: var(--radius-full);
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 400;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    font-size: 0.8125rem;
    border: 1px solid var(--border);
}

.page-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
    color: var(--primary);
    background: var(--bg-light-blue);
}

.page-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: var(--shadow-blue);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border);
}

.empty-state i {
    font-size: 4rem;
    color: var(--primary);
    opacity: 0.2;
    margin-bottom: 1.5rem;
}

.empty-state h4 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 400;
}

/* ===========================================================================
   DARK MODE SURFACES
   =========================================================================== */
:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .search-info,
:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .news-card,
:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .sidebar-card,
:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .empty-state,
:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .page-btn {
    border-color: var(--border);
    background: linear-gradient(180deg, rgba(17, 28, 46, 0.96), rgba(15, 23, 42, 0.94));
    box-shadow: var(--shadow-sm);
}

:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .news-card:hover,
:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .sidebar-card:hover {
    border-color: rgba(125, 211, 252, 0.46);
    box-shadow: var(--shadow-blue);
}

:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .card-image {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.38), rgba(29, 78, 216, 0.48));
}

:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .card-image img {
    filter: saturate(1.02) contrast(1.02);
}

:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .card-footer,
:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .category-item {
    border-color: var(--border-light);
}

:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .highlight {
    background: rgba(56, 189, 248, 0.22);
    color: #e0f2fe;
}

:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .sidebar-header {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.95) 0%, rgba(6, 182, 212, 0.92) 100%);
}

:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .category-link:hover,
:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .category-link.active,
:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .quick-link-item:hover,
:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .page-btn:hover {
    background: rgba(30, 41, 59, 0.68);
    border-color: rgba(125, 211, 252, 0.36);
}

:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .category-name,
:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .quick-link-name {
    color: var(--text-primary);
}

:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .category-link:hover .category-name,
:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .category-link.active .category-name,
:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .quick-link-item:hover .quick-link-name,
:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .card-title a:hover {
    color: var(--primary-light);
}

:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .category-icon,
:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .quick-link-icon {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .quick-link-item {
    background: rgba(22, 36, 58, 0.74);
    border-color: var(--border-light);
}

:is(body.dark-mode, html.dark-mode body, html.dark body, [data-theme="dark"] body) .page-btn.active {
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    border-color: rgba(125, 211, 252, 0.6);
    color: #ffffff;
}

/* ===========================================================================
   RESPONSIVE
   =========================================================================== */
@media (max-width: 1200px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 2rem 1rem 5rem;
    }

    .main-container {
        padding: 0 1rem;
        margin-top: -2.5rem;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        grid-template-columns: 1fr;
    }

    .search-input {
        font-size: 0.875rem;
        padding: 0.875rem 3.25rem 0.875rem 1rem;
    }

    .quick-links-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 640px) {
    .hero h1 {
        font-size: clamp(1.35rem, 7vw, 1.75rem);
    }

    .hero-subtitle {
        font-size: 0.8125rem;
    }

    .main-container {
        gap: 1.25rem;
        padding: 0 0.875rem;
    }

    .card-body {
        padding: 1.125rem;
    }

    .sidebar {
        gap: 1rem;
    }

    .category-link {
        min-height: 52px;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-stats {
        flex-direction: row;
        gap: 0.75rem;
        flex-wrap: nowrap;
    }

    .hero-stat {
        flex: 1;
        min-width: 0;
        padding: 0.85rem 0.65rem;
    }

    .stat-value {
        font-size: 1.6rem;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .search-info {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }

    .quick-links-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (hover: none) {
    .news-card:hover,
    .quick-link-item:hover,
    .hero-stat:hover,
    .category-link:hover .category-icon,
    .quick-link-item:hover .quick-link-icon,
    .page-btn:hover,
    .search-close:hover {
        transform: none;
    }

    .news-card:hover .card-image img {
        transform: none;
    }
}

@media print {

    .sidebar,
    .admin-btns,
    .pagination-wrap,
    .search-container,
    .search-info {
        display: none !important;
    }

    .main-container {
        grid-template-columns: 1fr;
        margin-top: 0;
    }
}
