/* 
 * TechyNoob - Premium Stylesheet
 * Custom CSS with glassmorphism, smooth animations, and automatic Dark Mode support.
 */

/* Custom Font Import fallback or direct config */
:root {
    /* Color Palette - Logo-inspired (Techy: Yellow, Noob: Red/Pink, Dark circuit: Navy) */
    --color-bg-light: #f8fafc;
    --color-surface-light: #ffffff;
    --color-text-light: #0f172a;
    --color-text-muted-light: #475569;
    --color-border-light: #e2e8f0;
    
    --color-bg-dark: #0a0f1d;
    --color-surface-dark: #121829;
    --color-text-dark: #f8fafc;
    --color-text-muted-dark: #94a3b8;
    --color-border-dark: #1e293b;
    
    /* Global Brand Colors */
    --color-primary: #3b82f6; /* Tech blue */
    --color-tech-yellow: #facc15; /* Yellow from Logo */
    --color-noob-pink: #f43f5e; /* Pink/Red from Logo */
    --color-accent: var(--color-noob-pink);
    
    /* Fonts */
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    /* Layout Constants */
    --header-height: 70px;
    --border-radius: 12px;
    --border-radius-sm: 6px;
    --transition-speed: 0.3s;
    --max-width: 1200px;
    
    /* Active variables set dynamically by body class */
    --bg-color: var(--color-bg-dark);
    --surface-color: var(--color-surface-dark);
    --text-color: var(--color-text-dark);
    --text-muted: var(--color-text-muted-dark);
    --border-color: var(--color-border-dark);
}

body.light-theme {
    --bg-color: var(--color-bg-light);
    --surface-color: var(--color-surface-light);
    --text-color: var(--color-text-light);
    --text-muted: var(--color-text-muted-light);
    --border-color: var(--color-border-light);
}

/* Global Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color var(--transition-speed), color var(--transition-speed);
    overflow-x: hidden;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--color-accent);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.5em;
    color: var(--text-color);
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.4rem; }

/* Main layout grid */
.site-main {
    min-height: calc(100vh - var(--header-height) - 300px);
    padding: 2rem 1rem;
    max-width: var(--max-width);
    margin: 0 auto;
}

.main-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 992px) {
    .main-container {
        grid-template-columns: 2fr 1fr;
    }
}

/* Header Styles */
.site-header {
    height: var(--header-height);
    background-color: rgba(18, 24, 41, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color var(--transition-speed);
}

body.light-theme .site-header {
    background-color: rgba(255, 255, 255, 0.85);
}

.header-container {
    max-width: var(--max-width);
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    gap: 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.logo img {
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.logo-text {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-color);
    letter-spacing: -0.5px;
}

.logo-accent {
    color: var(--color-noob-pink);
    position: relative;
}

body.light-theme .logo-accent {
    color: var(--color-noob-pink);
}

/* Main Nav */
.main-nav {
    display: none;
}

@media (min-width: 1024px) {
    .main-nav {
        display: block;
    }
}

.nav-list {
    display: flex;
    gap: 0.6rem;
    flex-wrap: nowrap;
}

@media (min-width: 1200px) {
    .nav-list {
        gap: 0.85rem;
    }
}

.nav-link {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
    white-space: nowrap;
}

.nav-icon {
    font-size: 0.9rem;
}

.nav-link:hover, .nav-link.active {
    color: var(--text-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-tech-yellow);
    transition: width var(--transition-speed);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.header-actions button {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.1rem;
    cursor: pointer;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-speed);
}

.header-actions button:hover {
    background-color: var(--border-color);
}

/* Theme Toggle Customizations */
#theme-toggle i {
    transition: transform 0.5s ease;
}

body.light-theme #theme-toggle i {
    transform: rotate(180deg);
}

/* Search Overlay */
.search-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--surface-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1010;
}

.search-overlay.active {
    transform: translateY(0);
}

.search-form {
    display: flex;
    width: 100%;
    max-width: 600px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.8rem 3rem 0.8rem 1.2rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-color);
    font-size: 1rem;
    font-family: var(--font-sans);
    outline: none;
}

.search-input:focus {
    border-color: var(--color-primary);
}

.search-submit, .search-close {
    position: absolute;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-submit {
    right: 3.5rem;
}

.search-close {
    right: 1.2rem;
}

.search-submit:hover, .search-close:hover {
    color: var(--text-color);
}

/* Mobile Nav Styles */
.hamburger {
    width: 20px;
    height: 2px;
    background-color: var(--text-color);
    display: block;
    position: relative;
}

.hamburger::before, .hamburger::after {
    content: '';
    width: 20px;
    height: 2px;
    background-color: var(--text-color);
    position: absolute;
    left: 0;
    transition: transform var(--transition-speed);
}

.hamburger::before { top: -6px; }
.hamburger::after { top: 6px; }

.mobile-menu-toggle {
    display: flex;
}

@media (min-width: 1024px) {
    .mobile-menu-toggle {
        display: none;
    }
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed);
}

.mobile-nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100%;
    background-color: var(--surface-color);
    z-index: 10001;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
}

.mobile-nav.active {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.mobile-nav-close {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.3rem;
    cursor: pointer;
}

.mobile-nav-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.mobile-nav-list a {
    color: var(--text-color);
    font-weight: 500;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-nav-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 1rem 0;
}

.mobile-nav-social {
    margin-top: auto;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    padding-top: 2rem;
}

.mobile-nav-social a {
    font-size: 1.3rem;
    color: var(--text-muted);
}

.mobile-nav-social a:hover {
    color: var(--color-accent);
}

/* Cookie Consent Banner */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    max-width: 500px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    animation: slideUp 0.5s ease;
}

@media (min-width: 768px) {
    .cookie-banner {
        left: auto;
        right: 30px;
    }
}

.cookie-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cookie-icon {
    font-size: 1.8rem;
    color: var(--color-tech-yellow);
}

.cookie-text p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.cookie-link {
    font-size: 0.85rem;
    font-weight: 600;
}

.cookie-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.cookie-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
}

.cookie-btn:hover {
    opacity: 0.9;
}

.cookie-btn.accept {
    background-color: var(--color-primary);
    color: #ffffff;
}

.cookie-btn.decline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

@keyframes slideUp {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Cards & Content Grid */
.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 600px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.post-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.card-image-link {
    display: block;
    position: relative;
    aspect-ratio: 16/9;
    background-color: #1a2236;
    overflow: hidden;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed);
}

.post-card:hover .card-img {
    transform: scale(1.05);
}

.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background-color: rgba(18, 24, 41, 0.85);
    color: var(--color-tech-yellow);
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--border-radius-sm);
    text-transform: uppercase;
}

.card-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-meta {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.card-title {
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.card-title a {
    color: var(--text-color);
}

.card-title a:hover {
    color: var(--color-accent);
}

.card-excerpt {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 0.8rem;
}

.card-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

.card-author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.card-read-more {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-primary);
}

/* Sidebar Widgets */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-widget {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.widget-title {
    font-size: 1.1rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.6rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-title i {
    color: var(--color-accent);
}

/* Popular Posts Widget */
.popular-posts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.popular-post-item {
    display: flex;
    gap: 12px;
    align-items: center;
}

.popular-rank {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--border-color);
    min-width: 24px;
    text-align: center;
}

.popular-post-item:hover .popular-rank {
    color: var(--color-tech-yellow);
}

.popular-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-post-item:hover h4 {
    color: var(--color-primary);
}

.popular-date {
    font-size: 0.72rem;
    color: var(--text-muted);
}

/* Category Widget */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.category-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.8rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 500;
    transition: transform var(--transition-speed), border-color var(--transition-speed);
}

.category-item:hover {
    transform: translateX(4px);
    border-color: var(--color-primary);
    color: var(--text-color);
}

.category-icon {
    margin-right: 8px;
}

.category-count {
    margin-left: auto;
    background-color: var(--border-color);
    padding: 0.1rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 10px;
    font-weight: 600;
}

/* Sidebar Custom Cards */
.subscribe-card, .telegram-card, .instagram-card {
    text-align: center;
    padding: 1rem 0.5rem;
}

.subscribe-icon {
    font-size: 2.5rem;
    color: #ef4444;
    margin-bottom: 0.5rem;
}

.telegram-icon {
    font-size: 2.5rem;
    color: #0088cc;
    margin-bottom: 0.5rem;
}

.instagram-icon {
    font-size: 2.5rem;
    color: #e1306c;
    margin-bottom: 0.5rem;
}

.subscribe-card h3, .telegram-card h3, .instagram-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.4rem;
}

.subscribe-card p, .telegram-card p, .instagram-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.2rem;
}

.btn-subscribe-sidebar, .btn-telegram-sidebar, .btn-instagram-sidebar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 0.7rem;
    border-radius: var(--border-radius-sm);
    font-weight: 700;
    color: #ffffff;
}

.btn-subscribe-sidebar {
    background-color: #ef4444;
}

.btn-telegram-sidebar {
    background-color: #0088cc;
}

.btn-instagram-sidebar {
    background-color: #e1306c;
}

.btn-subscribe-sidebar:hover, .btn-telegram-sidebar:hover, .btn-instagram-sidebar:hover {
    opacity: 0.9;
    color: #ffffff;
}

/* Post Page Specific Styles */
.article-header {
    margin-bottom: 1.5rem;
}

.article-category {
    display: inline-block;
    color: var(--color-accent);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.article-title {
    font-size: 2rem;
    margin-bottom: 0.8rem;
}

@media (min-width: 768px) {
    .article-title {
        font-size: 2.5rem;
    }
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-featured-image {
    aspect-ratio: 16/9;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 2rem;
    background-color: #1a2236;
}

.article-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-content {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content h2, .article-content h3 {
    margin-top: 2rem;
}

.article-content code {
    background-color: var(--surface-color);
    padding: 0.2rem 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.9em;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.article-content pre {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 1.2rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.article-content pre code {
    background: none;
    padding: 0;
    border: none;
    font-size: 0.9rem;
}

.article-content blockquote {
    border-left: 4px solid var(--color-accent);
    padding-left: 1.25rem;
    font-style: italic;
    color: var(--text-muted);
    margin: 1.5rem 0;
}

.article-content img {
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
}

/* ==========================================================================
   Comprehensive List Styling (Native & Quill Editor Support)
   Prevents numbers and bullets from overflowing or cutting off on mobile/tablets
   ========================================================================== */
.article-content ol,
.article-content ul {
    margin: 1.25rem 0 1.5rem 0;
    padding-left: 0;
    list-style: none;
    counter-reset: custom-ol-counter;
}

/* Native Standard Unordered Lists */
.article-content ul > li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.6rem;
    line-height: 1.7;
}

.article-content ul > li::before {
    content: "•";
    position: absolute;
    left: 0.4rem;
    top: -0.1rem;
    color: var(--color-accent);
    font-size: 1.4rem;
    line-height: 1.6;
}

/* Native Standard Ordered Lists */
.article-content ol > li {
    position: relative;
    padding-left: 2.25rem;
    margin-bottom: 0.6rem;
    line-height: 1.7;
    counter-increment: custom-ol-counter;
}

.article-content ol > li::before {
    content: counter(custom-ol-counter) ".";
    position: absolute;
    left: 0.2rem;
    top: 0;
    width: 1.6rem;
    text-align: right;
    font-weight: 700;
    color: var(--color-primary);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Quill Editor Ordered Lists: <li data-list="ordered"> */
.article-content ol > li[data-list="ordered"],
.article-content ul > li[data-list="ordered"],
.article-content li[data-list="ordered"] {
    position: relative;
    padding-left: 2.25rem !important;
    margin-bottom: 0.6rem;
    line-height: 1.7;
    list-style: none !important;
    counter-increment: custom-ol-counter;
}

.article-content ol > li[data-list="ordered"]::before,
.article-content ul > li[data-list="ordered"]::before,
.article-content li[data-list="ordered"]::before {
    content: counter(custom-ol-counter) ".";
    position: absolute;
    left: 0.2rem;
    top: 0;
    width: 1.6rem;
    text-align: right;
    font-weight: 700;
    color: var(--color-primary);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Quill Editor Bullet Lists: <li data-list="bullet"> */
.article-content ol > li[data-list="bullet"],
.article-content ul > li[data-list="bullet"],
.article-content li[data-list="bullet"] {
    position: relative;
    padding-left: 1.75rem !important;
    margin-bottom: 0.6rem;
    line-height: 1.7;
    list-style: none !important;
}

.article-content ol > li[data-list="bullet"]::before,
.article-content ul > li[data-list="bullet"]::before,
.article-content li[data-list="bullet"]::before {
    content: "•";
    position: absolute;
    left: 0.4rem;
    top: -0.1rem;
    color: var(--color-accent);
    font-size: 1.4rem;
    line-height: 1.6;
}

/* Hide empty Quill UI spans that interfere with rendering */
.article-content .ql-ui {
    display: none !important;
}

/* Quill Indentation Classes */
.article-content .ql-indent-1 { padding-left: 3.5rem !important; }
.article-content .ql-indent-2 { padding-left: 5rem !important; }
.article-content .ql-indent-3 { padding-left: 6.5rem !important; }
.article-content .ql-indent-4 { padding-left: 8rem !important; }

/* Quill Alignment Classes */
.article-content .ql-align-center { text-align: center; }
.article-content .ql-align-right { text-align: right; }
.article-content .ql-align-justify { text-align: justify; }

/* Nested lists */
.article-content li > ul,
.article-content li > ol {
    margin-top: 0.4rem;
    margin-bottom: 0.4rem;
    padding-left: 1rem;
}

/* Premium Blog Table Styling */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
    color: var(--text-color);
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.article-content th,
.article-content td {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    text-align: left;
}

.article-content tr:nth-child(even) {
    background-color: rgba(148, 163, 184, 0.04);
}

.article-content tr:hover {
    background-color: rgba(148, 163, 184, 0.08);
    transition: background-color 0.2s ease;
}

.article-content th {
    background-color: rgba(148, 163, 184, 0.1);
    font-weight: 700;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
}

/* Responsive Table Wrapper */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    background-color: var(--surface-color);
}

.table-responsive table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-color);
    border: none;
    border-radius: 0;
}

.table-responsive th,
.table-responsive td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    text-align: left;
}

.table-responsive th:last-child,
.table-responsive td:last-child {
    border-right: none;
}

.table-responsive tr:last-child th,
.table-responsive tr:last-child td {
    border-bottom: none;
}

.table-responsive tr:nth-child(even) {
    background-color: rgba(148, 163, 184, 0.04);
}

.table-responsive tr:hover {
    background-color: rgba(148, 163, 184, 0.08);
    transition: background-color 0.2s ease;
}

.table-responsive th {
    background-color: rgba(148, 163, 184, 0.1);
    font-weight: 700;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
}

/* Comment Box Styles */
.comments-section {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
    margin-top: 3rem;
}

.comment-form-container {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 600px) {
    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-color);
    outline: none;
    font-family: var(--font-sans);
}

.form-group input:focus, .form-group textarea:focus {
    border-color: var(--color-primary);
}

.btn-submit-comment {
    background-color: var(--color-primary);
    color: #ffffff;
    border: none;
    padding: 0.8rem 1.5rem;
    font-weight: 700;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    align-self: flex-start;
    transition: opacity 0.2s;
}

.btn-submit-comment:hover {
    opacity: 0.9;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.comment-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.25rem;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.comment-author-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    background-color: var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
}

.comment-author {
    font-weight: 700;
    font-size: 0.9rem;
}

.comment-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.comment-body {
    font-size: 0.95rem;
    color: var(--text-color);
}

/* Back to Top button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: var(--color-primary);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-speed), transform var(--transition-speed);
    z-index: 99;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.back-to-top.active {
    opacity: 1;
    pointer-events: auto;
}

.back-to-top:hover {
    transform: translateY(-3px);
}

/* Footer Styles */
.site-footer {
    background-color: #0c1220;
    color: #94a3b8;
    padding-top: 4rem;
    border-top: 1px solid var(--color-border-dark);
    position: relative;
    overflow: hidden;
}

body.light-theme .site-footer {
    background-color: #0d1527;
}

.footer-wave {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    overflow: hidden;
    line-height: 0;
    transform: rotate(180deg);
}

.footer-wave svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 60px;
}

.footer-wave path {
    fill: var(--bg-color);
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding-bottom: 3rem;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 2fr;
    }
}

.footer-section {
    display: flex;
    flex-direction: column;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
}

.footer-logo img {
    border-radius: 8px;
}

.footer-logo .logo-text {
    color: #ffffff;
}

.footer-about {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.footer-social {
    display: flex;
    gap: 10px;
}

.social-link {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.1rem;
    transition: transform 0.2s, filter 0.2s;
}

.social-link:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
    color: #ffffff;
}

.social-link.youtube { background-color: #ef4444; }
.social-link.telegram { background-color: #0088cc; }
.social-link.instagram { background-color: #e1306c; }
.social-link.email { background-color: #10b981; }

.footer-title {
    color: #ffffff;
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: 8px;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--color-tech-yellow);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    color: #94a3b8;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-links a:hover {
    color: #ffffff;
    padding-left: 4px;
}

.footer-links a i {
    font-size: 0.7rem;
    color: var(--color-accent);
}

.footer-contact-text {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.footer-email {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-email:hover {
    color: var(--color-tech-yellow);
}

.footer-cta {
    margin-bottom: 0.75rem;
}

.btn-subscribe, .btn-telegram, .btn-instagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 0.6rem;
    border-radius: var(--border-radius-sm);
    font-weight: 700;
    color: #ffffff;
    font-size: 0.85rem;
}

.btn-subscribe { background-color: #ef4444; }
.btn-telegram { background-color: #0088cc; }
.btn-instagram { background-color: #e1306c; }

.btn-subscribe:hover, .btn-telegram:hover, .btn-instagram:hover {
    opacity: 0.9;
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid #1e293b;
    padding: 2rem 0;
    text-align: center;
    font-size: 0.8rem;
}

.footer-disclaimer {
    margin-top: 0.5rem;
    color: #64748b;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.page-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-weight: 600;
}

.page-num:hover, .page-num.active {
    background-color: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

/* Category Page Intro */
.category-header, .search-header {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2.5rem 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
}

.category-header h1, .search-header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
}

.category-header p, .search-header p {
    color: var(--text-muted);
}

/* Admin Dashboard CSS Additions */
.admin-card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
}

.admin-table-container {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.admin-table th, .admin-table td {
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    font-weight: 700;
    background-color: var(--bg-color);
}

.admin-badge {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
    font-weight: 700;
}

.admin-badge.published {
    background-color: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.admin-badge.draft {
    background-color: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.admin-badge.scheduled {
    background-color: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.admin-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-admin {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    color: #ffffff;
}

.btn-admin.edit { background-color: #3b82f6; }
.btn-admin.delete { background-color: #ef4444; }

.login-container {
    max-width: 400px;
    margin: 4rem auto;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Custom Rich Text (Quill) and Font Compatibility styles */
.article-content a {
    color: var(--color-primary);
    text-decoration: underline;
    font-weight: 500;
    transition: color var(--transition-speed);
}
.article-content a:hover {
    color: var(--color-accent);
}

/* Map inline font-family styles to Google Fonts loading */
[style*="font-family: inter"] { font-family: 'Inter', sans-serif !important; }
[style*="font-family: jetbrains-mono"] { font-family: 'JetBrains Mono', monospace !important; }
[style*="font-family: outfit"] { font-family: 'Outfit', sans-serif !important; }
[style*="font-family: roboto"] { font-family: 'Roboto', sans-serif !important; }
[style*="font-family: playfair-display"] { font-family: 'Playfair Display', serif !important; }
[style*="font-family: montserrat"] { font-family: 'Montserrat', sans-serif !important; }
[style*="font-family: ubuntu"] { font-family: 'Ubuntu', sans-serif !important; }

/* Comment Replies & Nested Comments Styling */
.comment-replies-container {
    margin-left: 3rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
    border-left: 2px solid var(--border-color);
    padding-left: 1.25rem;
}

.comment-card.comment-reply {
    background-color: rgba(148, 163, 184, 0.03);
    border: 1px dashed var(--border-color);
    padding: 1rem;
}

.comment-card.comment-reply .comment-avatar {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
}

.comment-card.comment-reply .comment-author {
    font-size: 0.85rem;
}

.comment-card.comment-reply .comment-body {
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .comment-replies-container {
        margin-left: 1.5rem;
        padding-left: 0.75rem;
    }
}

.comment-card .author-badge {
    background-color: var(--color-tech-yellow);
    color: #0f172a;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    vertical-align: middle;
}

/* ==========================================================================
   Comprehensive Mobile & Tablet Optimization Suite (iOS & Android Refinements)
   ========================================================================== */

/* 1. Global Touch & Tap Target Improvements */
@media (max-width: 1023px) {
    /* Prevent iOS text size adjust */
    html {
        -webkit-text-size-adjust: 100%;
        touch-action: manipulation;
    }
    
    /* Touch Feedback on buttons & interactive elements */
    button, .btn-submit-comment, .nav-link, .category-item, .popular-post-item, .social-link {
        -webkit-tap-highlight-color: transparent;
    }

    button:active, .btn-submit-comment:active, .social-link:active {
        transform: scale(0.96);
    }
    
    /* Header Bar Mobile Sizing & Glassmorphism */
    .site-header {
        height: 64px;
        background-color: rgba(10, 15, 29, 0.92);
        backdrop-filter: blur(16px) saturate(180%);
        -webkit-backdrop-filter: blur(16px) saturate(180%);
    }

    body.light-theme .site-header {
        background-color: rgba(255, 255, 255, 0.92);
    }
    
    .header-container {
        padding: 0 0.85rem;
        gap: 0.75rem;
    }
    
    /* Responsive Logo Text Scaling */
    .logo img {
        width: 34px;
        height: 34px;
    }

    .logo-text {
        font-size: 1.2rem;
    }

    /* Action Buttons (Search, Theme, Hamburger) Sizing */
    .header-actions {
        gap: 0.5rem;
    }

    .header-actions button {
        width: 42px;
        height: 42px;
        font-size: 1.15rem;
    }
}

/* Extra Small Phones (< 380px) */
@media (max-width: 380px) {
    .logo-text {
        font-size: 1.05rem;
    }
    .logo img {
        width: 30px;
        height: 30px;
    }
    .header-actions {
        gap: 0.35rem;
    }
    .header-actions button {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
}

/* 2. Glassmorphic Mobile Drawer Menu Navigation (< 1024px) */
@media (max-width: 1023px) {
    .mobile-nav {
        width: 85%;
        max-width: 320px;
        background-color: rgba(18, 24, 41, 0.96);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        padding: 1.5rem 1.25rem;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.light-theme .mobile-nav {
        background-color: rgba(255, 255, 255, 0.96);
        border-left: 1px solid rgba(0, 0, 0, 0.1);
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
    }

    .mobile-nav-header {
        margin-bottom: 1.5rem;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid var(--border-color);
    }

    .mobile-nav-close {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: var(--border-color);
        transition: background-color 0.2s;
    }

    .mobile-nav-list {
        gap: 0.75rem;
    }

    .mobile-nav-list a {
        padding: 0.7rem 0.9rem;
        border-radius: var(--border-radius-sm);
        font-size: 1rem;
        font-weight: 600;
        transition: background-color 0.2s, color 0.2s;
    }

    .mobile-nav-list a:active, .mobile-nav-list a:hover {
        background-color: rgba(59, 130, 246, 0.12);
        color: var(--color-primary);
    }

    .mobile-nav-social {
        padding-top: 1.5rem;
        gap: 1.2rem;
    }
}

/* 3. Article Reading & Typography Responsiveness (Mobile & Tablet) */
@media (max-width: 767px) {
    .site-main {
        padding: 1.25rem 1rem;
        max-width: 100%;
        overflow-x: hidden;
    }

    .article-header {
        margin-bottom: 1.25rem;
    }

    .article-title {
        font-size: 1.5rem;
        line-height: 1.35;
        margin-bottom: 0.75rem;
        letter-spacing: -0.3px;
    }

    .article-meta {
        gap: 10px;
        font-size: 0.8rem;
        padding-bottom: 0.75rem;
    }

    .article-featured-image {
        border-radius: 12px;
        margin-bottom: 1.5rem;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    }

    .article-content {
        font-size: 1rem;
        line-height: 1.7;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .article-content p {
        margin-bottom: 1.25rem;
    }

    .article-content h2 {
        font-size: 1.4rem;
        margin-top: 1.75rem;
        margin-bottom: 0.75rem;
    }

    .article-content h3 {
        font-size: 1.2rem;
        margin-top: 1.5rem;
        margin-bottom: 0.5rem;
    }

    /* Mobile Code Block Enhancements */
    .article-content pre {
        padding: 1rem;
        border-radius: 10px;
        font-size: 0.85rem;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border: 1px solid var(--border-color);
        background-color: var(--surface-color);
    }

    .article-content pre code {
        font-size: 0.82rem;
        white-space: pre;
    }

    /* Blockquote Touch Improvements */
    .article-content blockquote {
        padding: 0.85rem 1rem;
        margin: 1.25rem 0;
        border-left-width: 3px;
        border-radius: 0 8px 8px 0;
        background-color: rgba(59, 130, 246, 0.04);
        font-size: 0.95rem;
    }

    /* Share Box Mobile Flex */
    .share-box {
        padding: 1.25rem 1rem !important;
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.85rem !important;
    }

    .share-links {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 12px !important;
    }

    .share-links .social-link {
        width: 40px !important;
        height: 40px !important;
        font-size: 1rem !important;
    }
}

/* Tablet (768px - 1023px) Specific Optimizations */
@media (min-width: 768px) and (max-width: 1023px) {
    .site-main {
        padding: 1.75rem 1.25rem;
    }

    .main-container {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .article-title {
        font-size: 2.1rem;
    }

    /* Convert Sidebar into 2-Column Grid on Tablet */
    .sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .subscribe-widget, .telegram-card, .instagram-card {
        grid-column: span 2;
    }
}

/* 4. Form Controls & Inputs (Prevents iOS Zoom on Input Focus) */
@media (max-width: 767px) {
    .form-group input, 
    .form-group textarea, 
    .search-input {
        font-size: 16px !important; /* Critical to prevent iOS Safari auto-zoom */
        padding: 0.8rem;
        border-radius: 10px;
    }

    .btn-submit-comment {
        width: 100%;
        padding: 0.9rem 1.25rem;
        font-size: 0.95rem;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .form-row {
        gap: 0.85rem;
    }
}

/* 5. Comment Section Mobile Touch Layout */
@media (max-width: 599px) {
    .comments-section {
        margin-top: 2rem;
        padding-top: 1.5rem;
    }

    .comment-form-container {
        padding: 1rem;
        border-radius: 12px;
    }

    .comment-card {
        padding: 1rem;
        border-radius: 12px;
    }

    .comment-header {
        flex-direction: row;
        align-items: center;
        gap: 6px;
    }

    .comment-avatar {
        width: 34px;
        height: 34px;
        font-size: 0.85rem;
    }

    .comment-author {
        font-size: 0.88rem;
    }

    .comment-date {
