/* ============================================
   AncientEgypt.blog - Main Stylesheet
   Academic, Museum-Grade Design with 3D Pharaonic Effects
   ============================================ */

/* 3D Perspective Container */
body {
    perspective: 1000px;
    transform-style: preserve-3d;
}

/* CSS Variables - Authentic Pharaonic Color Palette */
:root {
    /* Egyptian Gold & Bronze */
    --color-pharaoh-gold: #D4AF37;
    --color-royal-gold: #FFD700;
    --color-bronze: #CD7F32;
    --color-copper: #B87333;

    /* Egyptian Blue (Lapis Lazuli) */
    --color-egyptian-blue: #1034A6;
    --color-turquoise: #40E0D0;
    --color-nile-blue: #0E4C92;

    /* Desert & Stone Colors */
    --color-sandstone: #D4C5A9;
    --color-sandstone-light: #E8DDC8;
    --color-sandstone-dark: #B8A082;
    --color-desert-sand: #EDC9AF;
    --color-limestone: #F5F5DC;

    /* Papyrus & Natural */
    --color-papyrus: #F4E4C1;
    --color-papyrus-dark: #D4C4A1;

    /* Base Colors */
    --color-black: #1A1A1A;
    --color-black-deep: #0A0A0A;
    --color-gold: #D4AF37;
    --color-gold-light: #FFD700;
    --color-gold-dark: #B8860B;
    --color-white: #FFFFFF;
    --color-text: #2C2C2C;
    --color-text-light: #666666;

    /* Spacing & Layout */
    --spacing-unit: 1rem;
    --max-width: 1200px;
    --border-radius: 12px;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Pharaonic Shadows */
    --shadow-sm: 0 2px 8px rgba(212, 175, 55, 0.15);
    --shadow-md: 0 4px 20px rgba(212, 175, 55, 0.25);
    --shadow-lg: 0 8px 40px rgba(212, 175, 55, 0.35);
    --shadow-xl: 0 12px 60px rgba(212, 175, 55, 0.45);
    --shadow-pharaoh: 0 15px 70px rgba(212, 175, 55, 0.6), 0 5px 20px rgba(0, 0, 0, 0.3);
}

/* Dark Mode Variables - Pharaonic Night Theme */
[data-theme="dark"] {
    /* Inverted Desert Colors for Dark Mode */
    --color-sandstone: #3a3429;
    --color-sandstone-light: #2a241f;
    --color-sandstone-dark: #4a3f32;

    /* Dark Mode Gold - Brighter for visibility */
    --color-pharaoh-gold: #FFD700;
    --color-royal-gold: #FFA500;
    --color-bronze: #E5A642;
    --color-copper: #D4A574;

    /* Dark Mode Egyptian Blue */
    --color-egyptian-blue: #4A90E2;
    --color-turquoise: #5FE0D0;
    --color-nile-blue: #3E7CB1;

    /* Dark Mode Text Colors - High Contrast */
    --color-black: #FFD700;
    --color-black-deep: #FFA500;
    --color-gold: #FFD700;
    --color-gold-light: #FFEB3B;
    --color-gold-dark: #FFA500;

    /* Dark Backgrounds */
    --color-white: #1a1a1a;
    --color-papyrus: #2a2520;
    --color-papyrus-dark: #1f1b17;
    --color-limestone: #252525;

    /* Text Colors - Bright for Dark Mode */
    --color-text: #f5f5f5;
    --color-text-light: #d0d0d0;

    /* Dark Mode Shadows - Golden Glow */
    --shadow-sm: 0 2px 8px rgba(255, 215, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(255, 215, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(255, 215, 0, 0.4);
    --shadow-xl: 0 12px 60px rgba(255, 215, 0, 0.5);
    --shadow-pharaoh: 0 15px 70px rgba(255, 215, 0, 0.6), 0 5px 20px rgba(0, 0, 0, 0.5);
}

/* Dark Mode Text Contrast Fixes */
[data-theme="dark"] body {
    background-color: #0a0a0a;
    color: var(--color-text);
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: var(--color-gold);
}

/* Dark Mode Hero Section - Night Sky */
[data-theme="dark"] .hero {
    background:
        linear-gradient(180deg,
            #0a0a1a 0%,
            #1a1a2e 20%,
            #16213e 40%,
            #0f3460 60%,
            #1a1a2e 80%,
            #0a0a0a 100%);
    border-bottom: 8px solid var(--color-pharaoh-gold);
    box-shadow:
        inset 0 -20px 60px rgba(255, 215, 0, 0.3),
        0 15px 50px rgba(0, 0, 0, 0.8),
        inset 0 0 150px rgba(255, 215, 0, 0.1);
}

[data-theme="dark"] .hero-title {
    color: var(--color-royal-gold);
    text-shadow:
        3px 3px 6px rgba(0, 0, 0, 1),
        6px 6px 12px rgba(0, 0, 0, 0.8),
        0 0 40px rgba(255, 215, 0, 1),
        0 0 20px rgba(255, 165, 0, 1),
        -2px -2px 0 var(--color-bronze),
        2px 2px 0 var(--color-copper);
}

[data-theme="dark"] .hero-subtitle {
    color: var(--color-papyrus);
    text-shadow:
        2px 2px 4px rgba(0, 0, 0, 1),
        0 0 15px rgba(255, 215, 0, 0.8),
        0 0 8px rgba(255, 165, 0, 0.8);
}

[data-theme="dark"] .section-title {
    color: var(--color-gold);
}

[data-theme="dark"] .page-title {
    color: var(--color-gold);
}

[data-theme="dark"] .article-title,
[data-theme="dark"] .article-full h1,
[data-theme="dark"] .article-full h2 {
    color: var(--color-black);
}

[data-theme="dark"] .article-excerpt,
[data-theme="dark"] .article-body,
[data-theme="dark"] .article-full .article-body {
    color: var(--color-text);
}

[data-theme="dark"] .article-meta {
    color: var(--color-text-light);
}

[data-theme="dark"] .category-card h3 {
    color: var(--color-black);
}

[data-theme="dark"] .category-card p {
    color: var(--color-text-light);
}

/* Dark mode nav links - updated for better visibility */
[data-theme="dark"] .nav-link {
    color: #e8e8e8 !important;
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
    color: var(--color-gold) !important;
    border-bottom-color: var(--color-gold) !important;
}

/* Dark Mode - Footer */
[data-theme="dark"] .footer {
    background: var(--color-black-deep);
    color: var(--color-text);
    border-top: 1px solid var(--color-sandstone-dark);
}

[data-theme="dark"] .footer-section h3,
[data-theme="dark"] .footer-section h4 {
    color: var(--color-gold);
}

[data-theme="dark"] .footer-section p {
    color: var(--color-text-light);
}

[data-theme="dark"] .footer-section a {
    color: var(--color-text-light);
}

[data-theme="dark"] .footer-section a:hover {
    color: var(--color-gold);
}

[data-theme="dark"] .footer-bottom {
    color: var(--color-text-light);
    border-top-color: var(--color-sandstone-dark);
}

[data-theme="dark"] .form-group label {
    color: var(--color-black);
}

[data-theme="dark"] .form-group small {
    color: var(--color-text-light);
}

[data-theme="dark"] .comment-text,
[data-theme="dark"] .comment-author {
    color: var(--color-text);
}

[data-theme="dark"] .comment-date {
    color: var(--color-text-light);
}

[data-theme="dark"] .stat-info h3 {
    color: var(--color-black);
}

[data-theme="dark"] .stat-info p {
    color: var(--color-text);
}

[data-theme="dark"] .post-item-info h3 {
    color: var(--color-black);
}

[data-theme="dark"] .post-item-info p {
    color: var(--color-text-light);
}

[data-theme="dark"] .user-item-info h3 {
    color: var(--color-black);
}

[data-theme="dark"] .user-item-info p {
    color: var(--color-text-light);
}

[data-theme="dark"] .recent-item-info h4 {
    color: var(--color-black);
}

[data-theme="dark"] .recent-item-info p {
    color: var(--color-text-light);
}

[data-theme="dark"] .admin-card h2,
[data-theme="dark"] .dashboard-card h2 {
    color: var(--color-black);
    border-bottom-color: var(--color-gold);
}

[data-theme="dark"] .profile-info-item strong {
    color: var(--color-black);
}

[data-theme="dark"] .profile-info-item span {
    color: var(--color-text);
}

[data-theme="dark"] .interest-tag {
    background: var(--color-gold-light);
    color: var(--color-black);
}

[data-theme="dark"] .user-badge.admin {
    background: var(--color-gold);
    color: var(--color-black);
}

[data-theme="dark"] .user-badge.user {
    background: var(--color-sandstone-dark);
    color: var(--color-black);
}

[data-theme="dark"] .filter-btn {
    background: var(--color-white);
    color: var(--color-text);
    border-color: var(--color-sandstone-dark);
}

[data-theme="dark"] .filter-btn:hover,
[data-theme="dark"] .filter-btn.active {
    background: var(--color-gold);
    color: var(--color-black);
    border-color: var(--color-gold);
}

[data-theme="dark"] .search-input,
[data-theme="dark"] .filter-select {
    background: var(--color-white);
    color: var(--color-text);
    border-color: var(--color-sandstone-dark);
}

[data-theme="dark"] .text-editor {
    background: var(--color-white);
    color: var(--color-text);
    border-color: var(--color-sandstone-dark);
}

[data-theme="dark"] .text-editor:focus {
    border-color: var(--color-gold);
}

[data-theme="dark"] .text-editor:empty:before {
    color: var(--color-text-light);
}

[data-theme="dark"] .loading {
    color: var(--color-text-light);
}

/* Dark Mode - Additional Text Contrast Improvements */
[data-theme="dark"] .hero {
    background: linear-gradient(135deg, #2a241f 0%, #3a3429 100%);
}

[data-theme="dark"] .categories {
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a1a 100%);
}

[data-theme="dark"] .featured-articles {
    background: #0f0f0f;
}

[data-theme="dark"] .blog-main {
    background: #0a0a0a;
}

[data-theme="dark"] .dashboard-main,
[data-theme="dark"] .admin-main {
    background: #121212;
}

[data-theme="dark"] .auth-container {
    background: linear-gradient(135deg, #2a241f 0%, #3a3429 100%);
}

[data-theme="dark"] .auth-card {
    background: var(--color-white);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .auth-header h1 {
    color: var(--color-black);
}

[data-theme="dark"] .auth-header p {
    color: var(--color-text-light);
}

/* Ensure all text is readable in dark mode */
[data-theme="dark"] * {
    transition: color 0.3s ease, background-color 0.3s ease;
}

/* Fix any white text on dark backgrounds */
[data-theme="dark"] .article-full h1,
[data-theme="dark"] .article-full h2,
[data-theme="dark"] .article-full h3 {
    color: var(--color-black);
}

[data-theme="dark"] .article-full .article-body {
    color: var(--color-text);
    line-height: 1.8;
}

[data-theme="dark"] .article-full .article-body p {
    color: var(--color-text);
    margin-bottom: 1rem;
}

[data-theme="dark"] .article-full .article-meta {
    color: var(--color-text-light);
}

/* Fix modal text in dark mode */
[data-theme="dark"] .modal-content h2 {
    color: var(--color-black);
}

/* Fix form labels and text */
[data-theme="dark"] .form-group label {
    color: var(--color-black);
    font-weight: 600;
}

[data-theme="dark"] .form-group input::placeholder,
[data-theme="dark"] .form-group textarea::placeholder {
    color: var(--color-text-light);
    opacity: 0.7;
}

/* Fix checkbox labels */
[data-theme="dark"] .checkbox-label {
    color: var(--color-text);
}

[data-theme="dark"] .checkbox-label span {
    color: var(--color-text);
}

/* Fix admin tabs */
[data-theme="dark"] .admin-tab {
    color: var(--color-text-light);
}

[data-theme="dark"] .admin-tab:hover {
    color: var(--color-black);
}

[data-theme="dark"] .admin-tab.active {
    color: var(--color-gold);
}

/* Fix stat cards */
[data-theme="dark"] .stat-card {
    background: linear-gradient(135deg, var(--color-gold-dark) 0%, var(--color-gold) 100%);
}

[data-theme="dark"] .stat-card .stat-info h3 {
    color: #1a1a1a;
}

[data-theme="dark"] .stat-card .stat-info p {
    color: #2a2a2a;
}

/* Fix post items */
[data-theme="dark"] .post-item {
    background: var(--color-white);
    border-color: var(--color-sandstone-dark);
}

[data-theme="dark"] .post-item:hover {
    border-color: var(--color-gold);
    background: linear-gradient(135deg, #2a241f 0%, #3a3429 100%);
}

/* Fix user items */
[data-theme="dark"] .user-item {
    background: var(--color-white);
    border-color: var(--color-sandstone-dark);
}

[data-theme="dark"] .user-item:hover {
    border-color: var(--color-gold);
    background: linear-gradient(135deg, #2a241f 0%, #3a3429 100%);
}

/* Fix recent items */
[data-theme="dark"] .recent-item {
    background: var(--color-white);
    border-right-color: var(--color-gold);
}

/* Ensure good contrast for all interactive elements */
[data-theme="dark"] a {
    color: var(--color-gold);
}

[data-theme="dark"] a:hover {
    color: var(--color-gold-light);
}

/* Fix article links */
[data-theme="dark"] .article-full .article-body a {
    color: var(--color-gold);
    text-decoration: underline;
}

[data-theme="dark"] .article-full .article-body a:hover {
    color: var(--color-gold-light);
}

/* Dark Mode - Comments Section */
[data-theme="dark"] .comments-section {
    border-top-color: var(--color-sandstone-dark);
}

[data-theme="dark"] .comments-container h3 {
    color: var(--color-black);
}

[data-theme="dark"] .comment-item {
    background: var(--color-white);
    border-right-color: var(--color-gold);
}

[data-theme="dark"] .comment-form-container {
    background: var(--color-white);
    border-color: var(--color-sandstone-dark);
}

[data-theme="dark"] .comment-form-container h4 {
    color: var(--color-black);
}

[data-theme="dark"] .comment-form input,
[data-theme="dark"] .comment-form textarea {
    background: var(--color-white);
    color: var(--color-text);
    border-color: var(--color-sandstone-dark);
}

[data-theme="dark"] .comment-form input:focus,
[data-theme="dark"] .comment-form textarea:focus {
    border-color: var(--color-gold);
    background: var(--color-white);
}

/* Dark Mode - Ensure minimum contrast ratio */
[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] div {
    color: inherit;
}

/* Dark Mode - Fix any remaining text visibility issues */
[data-theme="dark"] .article-body,
[data-theme="dark"] .article-full .article-body {
    color: #e8e8e8 !important;
}

[data-theme="dark"] .article-body p,
[data-theme="dark"] .article-full .article-body p {
    color: #e8e8e8 !important;
}

[data-theme="dark"] .article-body h2,
[data-theme="dark"] .article-body h3,
[data-theme="dark"] .article-full .article-body h2,
[data-theme="dark"] .article-full .article-body h3 {
    color: #f5f5f5 !important;
}

/* Dark Mode - Fix list items */
[data-theme="dark"] .article-body ul,
[data-theme="dark"] .article-body ol,
[data-theme="dark"] .article-full .article-body ul,
[data-theme="dark"] .article-full .article-body ol {
    color: #e8e8e8;
}

[data-theme="dark"] .article-body li,
[data-theme="dark"] .article-full .article-body li {
    color: #e8e8e8;
}

/* Dark Mode - Fix blockquotes if any */
[data-theme="dark"] blockquote {
    border-right-color: var(--color-gold);
    color: var(--color-text);
    background: rgba(229, 201, 138, 0.1);
}

/* Dark Mode - Fix code blocks if any */
[data-theme="dark"] code,
[data-theme="dark"] pre {
    background: var(--color-white);
    color: var(--color-text);
    border: 1px solid var(--color-sandstone-dark);
}

/* Dark Mode - Fix table if any */
[data-theme="dark"] table {
    color: var(--color-text);
}

[data-theme="dark"] table th {
    background: var(--color-sandstone-dark);
    color: var(--color-black);
}

[data-theme="dark"] table td {
    background: var(--color-white);
}

/* Alert Warning (Myths Disclaimer) */
.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
    padding: 1rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.alert-warning .alert-icon {
    font-size: 1.5rem;
}

[data-theme="dark"] .alert-warning {
    background-color: #2c2518;
    color: #ffd970;
    border-color: #4a3e23;
}

/* Article Images and Videos */
.article-body img,
.article-full .article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 1.5rem auto;
    /* Centered */
    box-shadow: var(--shadow-md);
    display: block;
}

/* Desktop Image Limits */
@media (min-width: 992px) {

    .article-body img,
    .article-full .article-body img {
        max-width: 700px;
        /* Limit width on large screens */
        max-height: 500px;
        /* Limit height to prevent vertical scrolling */
        object-fit: cover;
        /* Maintain aspect ratio */
    }
}

.article-body iframe,
.article-full .article-body iframe {
    max-width: 100%;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
    box-shadow: var(--shadow-md);
    display: block;
}

.article-body video,
.article-full .article-body video {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
    box-shadow: var(--shadow-md);
    display: block;
}

[data-theme="dark"] .article-body img,
[data-theme="dark"] .article-full .article-body img {
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .article-body iframe,
[data-theme="dark"] .article-full .article-body iframe {
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .article-body video,
[data-theme="dark"] .article-full .article-body video {
    box-shadow: var(--shadow-lg);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-white);
    direction: rtl;
    transition: background-color 0.3s ease, color 0.3s ease;
}

[dir="ltr"] body {
    direction: ltr;
}

/* Container */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
}

/* Header - Enhanced Egyptian Theme with 3D */
.header {
    background: linear-gradient(135deg, #0A0A0A 0%, #1A1A1A 50%, #2A241F 100%);
    padding: 1.5rem 0;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 4px 16px rgba(212, 175, 55, 0.3),
        inset 0 -2px 0 var(--color-gold),
        inset 0 0 30px rgba(212, 175, 55, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    border-bottom: 4px solid var(--color-gold);
    position: relative;
    transform-style: preserve-3d;
}

.header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: repeating-linear-gradient(90deg, var(--color-gold) 0px, var(--color-gold) 10px, transparent 10px, transparent 20px);
    opacity: 0.5;
}

[data-theme="dark"] .header {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%) !important;
    border-bottom: 1px solid rgba(229, 201, 138, 0.2) !important;
}

/* Fix header text visibility in dark mode */
[data-theme="dark"] .nav-link {
    color: #e8e8e8 !important;
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
    color: var(--color-gold) !important;
    border-bottom-color: var(--color-gold) !important;
}

[data-theme="dark"] .header-btn {
    background: linear-gradient(135deg, rgba(229, 201, 138, 0.2) 0%, rgba(229, 201, 138, 0.3) 100%) !important;
    border-color: var(--color-gold) !important;
    color: var(--color-gold) !important;
    box-shadow: 0 2px 8px rgba(229, 201, 138, 0.3) !important;
}

[data-theme="dark"] .header-btn:hover {
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-light) 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(229, 201, 138, 0.5) !important;
    border-color: var(--color-gold-light) !important;
}

[data-theme="dark"] .logo-text {
    color: var(--color-gold) !important;
}

[data-theme="dark"] .logo {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.1) 0%, rgba(201, 169, 97, 0.15) 100%);
    box-shadow: 0 2px 8px rgba(201, 169, 97, 0.25);
}

[data-theme="dark"] .logo:hover {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.2) 0%, rgba(201, 169, 97, 0.3) 100%);
    box-shadow:
        0 4px 15px rgba(201, 169, 97, 0.4),
        inset 0 0 20px rgba(201, 169, 97, 0.15);
}

[data-theme="dark"] .logo-img {
    filter: drop-shadow(0 2px 4px rgba(201, 169, 97, 0.4)) brightness(1.1);
}

[data-theme="dark"] .logo:hover .logo-img {
    filter: drop-shadow(0 4px 8px rgba(201, 169, 97, 0.6)) brightness(1.15);
}

[data-theme="dark"] .logo::before,
[data-theme="dark"] .logo::after {
    opacity: 0.8;
    filter: drop-shadow(0 0 5px rgba(201, 169, 97, 0.5));
}

[data-theme="dark"] .logo:hover::before,
[data-theme="dark"] .logo:hover::after {
    filter: drop-shadow(0 0 10px rgba(201, 169, 97, 0.8));
}

/* Ensure all header text is visible in dark mode */
[data-theme="dark"] .header * {
    color: inherit;
}

[data-theme="dark"] .header .nav {
    color: #e8e8e8;
}

[data-theme="dark"] .header-content {
    color: #e8e8e8;
}

/* Fix any text that might be hard to see */
[data-theme="dark"] .header a:not(.nav-link):not(.logo) {
    color: #e8e8e8 !important;
}

[data-theme="dark"] .header h1,
[data-theme="dark"] .header h2,
[data-theme="dark"] .header h3 {
    color: var(--color-gold) !important;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.header-toggle-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    order: 2;
    flex-shrink: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    order: 3;
    flex-shrink: 0;
}

.logo {
    order: 1;
    flex-shrink: 0;
}

/* RTL Support */
[dir="rtl"] .header-content {
    flex-direction: row;
}

[dir="ltr"] .header-content {
    flex-direction: row;
}

.header-btn {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.15) 0%, rgba(201, 169, 97, 0.25) 100%);
    border: 2px solid var(--color-gold);
    color: var(--color-gold);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(201, 169, 97, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 45px;
    will-change: transform;
}

.header-btn:hover {
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
    color: var(--color-white);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 4px 12px rgba(201, 169, 97, 0.4);
    border-color: var(--color-gold-dark);
}

.header-btn:active {
    transform: translateY(-1px) scale(1.02);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.05) 0%, rgba(201, 169, 97, 0.1) 100%);
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(201, 169, 97, 0.15);
    will-change: transform;
}

.logo::before {
    content: '𓂀';
    position: absolute;
    left: -15px;
    font-size: 1.2rem;
    color: var(--color-gold);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.logo::after {
    content: '𓂀';
    position: absolute;
    right: -15px;
    font-size: 1.2rem;
    color: var(--color-gold);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.logo:hover {
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.15) 0%, rgba(201, 169, 97, 0.25) 100%);
    border-color: var(--color-gold);
    box-shadow:
        0 4px 15px rgba(201, 169, 97, 0.3),
        inset 0 0 20px rgba(201, 169, 97, 0.1);
    transform: translateY(-2px);
}

.logo:hover::before,
.logo:hover::after {
    opacity: 1;
    transform: scale(1.2);
    color: var(--color-gold-dark);
}

.logo-img {
    height: auto;
    max-height: 65px;
    width: auto;
    max-width: 220px;
    flex-shrink: 0;
    object-fit: contain;
    display: block;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(201, 169, 97, 0.3));
    border-radius: 8px;
    padding: 0.25rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(201, 169, 97, 0.05) 100%);
}

.logo:hover .logo-img {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(201, 169, 97, 0.5));
}

.logo-text {
    color: var(--color-gold);
    font-size: 1.5rem;
    font-weight: bold;
    margin: 0;
    display: none;
    /* إخفاء النص لأن اللوجو يحتوي على النص */
}

/* في صفحات Auth، إخفاء اللوجو النصي إذا كان اللوجو يحتوي على النص */
.auth-header .logo-text {
    display: none;
}

.nav {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--color-sandstone-light);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-gold);
    border-bottom-color: var(--color-gold);
}

/* Hero Section - Authentic Pharaonic Egyptian Theme */
.hero {
    background:
        linear-gradient(180deg,
            var(--color-egyptian-blue) 0%,
            var(--color-nile-blue) 30%,
            var(--color-pharaoh-gold) 70%,
            var(--color-royal-gold) 85%,
            var(--color-desert-sand) 100%);
    padding: 8rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 8px solid var(--color-pharaoh-gold);
    box-shadow:
        inset 0 -20px 60px rgba(212, 175, 55, 0.5),
        0 15px 50px rgba(0, 0, 0, 0.3),
        inset 0 0 150px rgba(255, 215, 0, 0.2);
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        repeating-linear-gradient(0deg,
            transparent,
            transparent 50px,
            rgba(212, 175, 55, 0.1) 50px,
            rgba(212, 175, 55, 0.1) 51px),
        repeating-linear-gradient(90deg,
            transparent,
            transparent 50px,
            rgba(212, 175, 55, 0.1) 50px,
            rgba(212, 175, 55, 0.1) 51px),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400"><text x="50" y="100" font-size="60" opacity="0.15" fill="%23D4AF37">𓀀</text><text x="200" y="100" font-size="60" opacity="0.15" fill="%23FFD700">𓁛</text><text x="350" y="100" font-size="60" opacity="0.15" fill="%23D4AF37">𓂀</text><text x="50" y="200" font-size="60" opacity="0.15" fill="%23FFD700">𓃭</text><text x="200" y="200" font-size="60" opacity="0.15" fill="%23D4AF37">𓅃</text><text x="350" y="200" font-size="60" opacity="0.15" fill="%23FFD700">𓆣</text><text x="50" y="300" font-size="60" opacity="0.15" fill="%23D4AF37">𓇳</text><text x="200" y="300" font-size="60" opacity="0.15" fill="%23FFD700">𓈖</text><text x="350" y="300" font-size="60" opacity="0.15" fill="%23D4AF37">�</text></svg>'),
        radial-gradient(circle at 50% 20%, rgba(255, 215, 0, 0.3) 0%, transparent 40%),
        radial-gradient(circle at 30% 50%, rgba(212, 175, 55, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 70% 50%, rgba(255, 215, 0, 0.2) 0%, transparent 50%);
    background-size:
        100% 100%,
        100% 100%,
        400px 400px,
        800px 800px,
        600px 600px,
        600px 600px;
    background-position: 0 0, 0 0, center, 50% 20%, 30% 50%, 70% 50%;
    opacity: 1;
    animation: hieroglyphFloat 30s infinite linear;
}

@keyframes hieroglyphFloat {
    0% {
        background-position: 0 0, 0 0, 0 0, 50% 20%, 30% 50%, 70% 50%;
    }

    100% {
        background-position: 0 0, 0 0, 400px 400px, 50% 20%, 30% 50%, 70% 50%;
    }
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background:
        repeating-linear-gradient(90deg,
            var(--color-pharaoh-gold) 0px,
            var(--color-pharaoh-gold) 15px,
            var(--color-royal-gold) 15px,
            var(--color-royal-gold) 30px,
            var(--color-bronze) 30px,
            var(--color-bronze) 45px),
        linear-gradient(to bottom, transparent, rgba(212, 175, 55, 0.3));
    clip-path: polygon(0 0,
            5% 40%,
            10% 0,
            15% 40%,
            20% 0,
            25% 40%,
            30% 0,
            35% 40%,
            40% 0,
            45% 40%,
            50% 0,
            55% 40%,
            60% 0,
            65% 40%,
            70% 0,
            75% 40%,
            80% 0,
            85% 40%,
            90% 0,
            95% 40%,
            100% 0,
            100% 100%,
            0 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 4.5rem;
    color: var(--color-royal-gold);
    margin-bottom: 2rem;
    font-weight: 900;
    text-shadow:
        3px 3px 6px rgba(0, 0, 0, 0.8),
        6px 6px 12px rgba(0, 0, 0, 0.6),
        0 0 40px rgba(255, 215, 0, 0.8),
        0 0 20px rgba(212, 175, 55, 0.9),
        -2px -2px 0 var(--color-bronze),
        2px 2px 0 var(--color-copper);
    position: relative;
    display: inline-block;
    padding: 1rem 4rem;
    letter-spacing: 3px;
    line-height: 1.3;
    background: linear-gradient(180deg,
            rgba(255, 215, 0, 0.2) 0%,
            rgba(212, 175, 55, 0.3) 50%,
            rgba(205, 127, 50, 0.2) 100%);
    border-top: 3px solid var(--color-royal-gold);
    border-bottom: 3px solid var(--color-pharaoh-gold);
    clip-path: polygon(0 0,
            calc(100% - 20px) 0,
            100% 20px,
            100% calc(100% - 20px),
            calc(100% - 20px) 100%,
            20px 100%,
            0 calc(100% - 20px),
            0 20px);
}

.hero-title::before,
.hero-title::after {
    content: '�';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3.5rem;
    color: var(--color-royal-gold);
    opacity: 1;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 15px rgba(255, 215, 0, 1));
    animation: sunGlow 3s ease-in-out infinite;
}

@keyframes sunGlow {

    0%,
    100% {
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 15px rgba(255, 215, 0, 1));
    }

    50% {
        filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 30px rgba(255, 215, 0, 1)) drop-shadow(0 0 40px rgba(212, 175, 55, 0.8));
    }
}

.hero-title::before {
    left: -2rem;
}

.hero-title::after {
    right: -2rem;
}

.hero-subtitle {
    font-size: 1.6rem;
    color: var(--color-papyrus);
    margin-bottom: 3rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.9;
    text-shadow:
        2px 2px 4px rgba(0, 0, 0, 0.9),
        0 0 15px rgba(255, 215, 0, 0.6),
        0 0 8px rgba(212, 175, 55, 0.8);
    font-weight: 600;
    padding: 1rem 2rem;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(212, 175, 55, 0.2) 20%,
            rgba(212, 175, 55, 0.3) 50%,
            rgba(212, 175, 55, 0.2) 80%,
            transparent 100%);
    border-left: 3px solid var(--color-pharaoh-gold);
    border-right: 3px solid var(--color-pharaoh-gold);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg,
            var(--color-royal-gold) 0%,
            var(--color-pharaoh-gold) 50%,
            var(--color-bronze) 100%);
    color: var(--color-black-deep);
    box-shadow:
        0 8px 25px rgba(212, 175, 55, 0.6),
        inset 0 2px 0 rgba(255, 255, 255, 0.3),
        0 3px 6px rgba(0, 0, 0, 0.3),
        inset 0 -2px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    border: 3px solid var(--color-pharaoh-gold);
    border-radius: 0;
    clip-path: polygon(0 0,
            calc(100% - 10px) 0,
            100% 10px,
            100% calc(100% - 10px),
            calc(100% - 10px) 100%,
            10px 100%,
            0 calc(100% - 10px),
            0 10px);
    will-change: transform;
}

.btn-primary::before {
    content: '𓋹';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    opacity: 0.7;
    transition: all 0.4s ease;
}

.btn-primary::after {
    content: '𓋹';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%) scaleX(-1);
    font-size: 1.2rem;
    opacity: 0.7;
    transition: all 0.4s ease;
}

.btn-primary:hover::before {
    left: 5px;
    opacity: 1;
    transform: translateY(-50%) scale(1.2);
}

.btn-primary:hover::after {
    right: 5px;
    opacity: 1;
    transform: translateY(-50%) scaleX(-1) scale(1.2);
}

.btn-primary {
    transform-style: preserve-3d;
    position: relative;
}

.btn-primary::before,
.btn-primary::after {
    transform-style: preserve-3d;
}

.btn-primary:hover {
    transform: translateY(-8px) translateZ(20px) rotateX(-5deg) scale(1.1);
    box-shadow:
        0 20px 50px rgba(212, 175, 55, 0.9),
        0 10px 25px rgba(255, 215, 0, 0.7),
        0 0 60px rgba(255, 215, 0, 0.5),
        inset 0 0 30px rgba(255, 215, 0, 0.4),
        inset 0 -8px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg,
            var(--color-royal-gold) 0%,
            var(--color-pharaoh-gold) 30%,
            var(--color-royal-gold) 70%,
            var(--color-pharaoh-gold) 100%);
    border-color: var(--color-royal-gold);
}

.btn-primary:active {
    transform: translateY(-3px) translateZ(10px) rotateX(-2deg) scale(1.05);
    box-shadow:
        0 10px 25px rgba(212, 175, 55, 0.6),
        inset 0 5px 15px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg,
            var(--color-royal-gold) 0%,
            var(--color-pharaoh-gold) 50%,
            var(--color-bronze) 100%);
    color: #0a0a0a;
    border-color: var(--color-pharaoh-gold);
}

[data-theme="dark"] .btn-primary:hover {
    background: linear-gradient(135deg,
            var(--color-royal-gold) 0%,
            var(--color-pharaoh-gold) 30%,
            var(--color-royal-gold) 70%,
            var(--color-pharaoh-gold) 100%);
    border-color: var(--color-royal-gold);
}

/* Dark Mode Additional Styles */
[data-theme="dark"] {
    background-color: var(--color-white);
}

[data-theme="dark"] .admin-card,
[data-theme="dark"] .dashboard-card {
    background: var(--color-white);
    border-color: var(--color-sandstone-dark);
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-group textarea {
    background: var(--color-white);
    border-color: var(--color-sandstone-dark);
    color: var(--color-text);
}

[data-theme="dark"] .modal-content {
    background: var(--color-white);
    color: var(--color-text);
}

/* Dark Mode - Footer (removed duplicate, see below) */

.btn-secondary {
    background: var(--color-sandstone-dark);
    color: var(--color-white);
    will-change: transform;
}

.btn-secondary:hover {
    background: var(--color-sandstone);
    color: var(--color-black);
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

.btn-danger {
    background: #dc3545;
    color: var(--color-white);
}

.btn-danger:hover {
    background: #c82333;
}

/* Categories Section - Enhanced Egyptian Theme */
.categories {
    padding: 5rem 0;
    background: linear-gradient(180deg, var(--color-white) 0%, #F5F0E8 100%);
    position: relative;
}

/* Dark Mode Categories Section */
[data-theme="dark"] .categories {
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a1a 100%);
}

.categories::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: repeating-linear-gradient(90deg, var(--color-gold) 0px, var(--color-gold) 20px, var(--color-gold-dark) 20px, var(--color-gold-dark) 40px);
}

.section-title {
    font-size: 2.5rem;
    color: var(--color-black);
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 4px;
    background: linear-gradient(90deg, transparent 0%, var(--color-gold) 20%, var(--color-gold-dark) 50%, var(--color-gold) 80%, transparent 100%);
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(201, 169, 97, 0.3);
}

.section-title::before {
    content: '𓏏';
    position: absolute;
    bottom: -8px;
    left: calc(50% - 100px);
    font-size: 1.2rem;
    color: var(--color-gold-dark);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.category-card {
    background: linear-gradient(135deg,
            var(--color-papyrus) 0%,
            var(--color-limestone) 50%,
            var(--color-papyrus-dark) 100%);
    border: 4px solid var(--color-pharaoh-gold);
    border-radius: 0;
    padding: 2.5rem 2rem;
    text-align: center;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 
        0 20px 60px rgba(212, 175, 55, 0.4),
        0 10px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: visible;
    clip-path: polygon(0 0,
            calc(100% - 15px) 0,
            100% 15px,
            100% 100%,
            15px 100%,
            0 calc(100% - 15px));
    transform-style: preserve-3d;
    transform: translateZ(0) rotateX(0deg) rotateY(0deg);
    will-change: transform;
}

/* Pharaonic Corner Decorations */
.category-card::before {
    content: '𓀀';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 2rem;
    color: var(--color-pharaoh-gold);
    opacity: 0.3;
    transform: rotate(0deg);
    transition: all 0.4s ease;
}

.category-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: repeating-linear-gradient(90deg,
            var(--color-pharaoh-gold) 0px,
            var(--color-pharaoh-gold) 10px,
            var(--color-royal-gold) 10px,
            var(--color-royal-gold) 20px,
            var(--color-bronze) 20px,
            var(--color-bronze) 30px);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.category-card:hover::before {
    opacity: 1;
    transform: rotate(360deg) scale(1.2);
}

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

/* Dark Mode Pharaonic Decorations */
[data-theme="dark"] .category-card::before {
    color: var(--color-royal-gold);
    opacity: 0.5;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
}

[data-theme="dark"] .category-card:hover::before {
    opacity: 1;
    text-shadow: 0 0 20px rgba(255, 215, 0, 1),
        0 0 30px rgba(255, 165, 0, 0.8);
}

.category-card:hover {
    transform: translateY(-15px) scale(1.05);
    border-color: var(--color-royal-gold);
    box-shadow:
        0 20px 80px rgba(212, 175, 55, 0.7),
        0 10px 40px rgba(255, 215, 0, 0.5),
        inset 0 0 30px rgba(212, 175, 55, 0.2);
    background: linear-gradient(135deg,
            var(--color-royal-gold) 0%,
            var(--color-pharaoh-gold) 50%,
            var(--color-bronze) 100%);
}

[data-theme="dark"] .category-card {
    background: linear-gradient(135deg,
            #1a1a1a 0%,
            #252525 50%,
            #1f1b17 100%);
    border-color: var(--color-pharaoh-gold);
    box-shadow: var(--shadow-pharaoh);
}

[data-theme="dark"] .category-card h3 {
    color: var(--color-royal-gold);
}

[data-theme="dark"] .category-card p {
    color: var(--color-text-light);
}

[data-theme="dark"] .category-card:hover {
    background: linear-gradient(135deg,
            var(--color-royal-gold) 0%,
            var(--color-pharaoh-gold) 50%,
            var(--color-bronze) 100%);
    border-color: var(--color-royal-gold);
}

[data-theme="dark"] .category-card:hover h3 {
    color: #0a0a0a;
}

[data-theme="dark"] .category-card:hover p {
    color: #1a1a1a;
}

.category-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
    display: inline-block;
    filter: drop-shadow(0 2px 4px rgba(201, 169, 97, 0.2));
    will-change: transform;
}

.category-card:hover .category-icon {
    transform: scale(1.2) rotate(5deg);
    filter: drop-shadow(0 4px 8px rgba(201, 169, 97, 0.4));
}

/* Dark Mode Category Icons */
[data-theme="dark"] .category-icon {
    filter: drop-shadow(0 2px 4px rgba(255, 215, 0, 0.4));
}

[data-theme="dark"] .category-card:hover .category-icon {
    filter: drop-shadow(0 4px 8px rgba(255, 215, 0, 0.8)) drop-shadow(0 0 15px rgba(255, 165, 0, 0.6));
}

.category-card h3 {
    color: var(--color-black);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.category-card p {
    color: var(--color-text-light);
    margin-bottom: 1rem;
}

.category-link {
    color: var(--color-gold-dark);
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.5rem 1.5rem;
    border: 2px solid var(--color-gold);
    border-radius: 25px;
    background: linear-gradient(135deg, transparent 0%, rgba(201, 169, 97, 0.1) 100%);
}

.category-link:hover {
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
    color: var(--color-white);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(201, 169, 97, 0.4);
}

/* Arrow removed from category link */

.category-link:hover {
    color: var(--color-gold-dark);
}

[data-theme="dark"] .category-link {
    color: var(--color-royal-gold);
    border-color: var(--color-pharaoh-gold);
    background: linear-gradient(135deg, transparent 0%, rgba(255, 215, 0, 0.15) 100%);
}

[data-theme="dark"] .category-link:hover {
    background: linear-gradient(135deg, var(--color-royal-gold) 0%, var(--color-pharaoh-gold) 100%);
    color: #0a0a0a;
    border-color: var(--color-royal-gold);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.6);
}

/* Articles Grid */
.articles-grid,
.articles-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Load More Button Container - Centered regardless of language */
.load-more-container {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    margin: 3rem 0 !important;
    padding: 2rem 0 !important;
    grid-column: 1 / -1; /* Span all columns */
    text-align: center !important;
}

.load-more-btn {
    display: block !important;
    margin: 0 auto !important;
    min-width: 200px !important;
    padding: 1rem 2rem !important;
    font-size: 1.1rem !important;
    text-align: center !important;
}

.article-card {
    background: var(--color-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid transparent;
    position: relative;
    will-change: transform;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.05) 0%, rgba(201, 169, 97, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.article-card:hover::before {
    opacity: 1;
}

.article-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: var(--shadow-xl);
    border-color: var(--color-gold);
}

[data-theme="dark"] .article-card {
    background: #1a1a1a;
    border-color: var(--color-pharaoh-gold);
}

[data-theme="dark"] .article-card:hover {
    background: linear-gradient(135deg, #252525 0%, #2a2520 100%);
    border-color: var(--color-royal-gold);
}

[data-theme="dark"] .article-title {
    color: var(--color-gold);
}

[data-theme="dark"] .article-excerpt {
    color: var(--color-text-light);
}

[data-theme="dark"] .article-category {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(255, 165, 0, 0.3) 100%);
    color: var(--color-royal-gold);
    border-color: var(--color-pharaoh-gold);
}

.article-image {
    width: 100%;
    height: 240px;
    background: var(--color-sandstone-light);
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    will-change: transform;
}

.article-card:hover .article-image img {
    transform: scale(1.1);
}

.article-content {
    padding: 1.5rem;
}

.article-category {
    display: inline-block;
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.15) 0%, rgba(201, 169, 97, 0.25) 100%);
    color: #8B6914;
    /* Darker Gold/Bronze for better contrast */
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    border: 1px solid var(--color-gold);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.article-title {
    color: #000000;
    /* Pure black for max contrast */
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    line-height: 1.4;
}

.article-excerpt {
    color: #444444;
    /* Darker grey for better readability */
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.article-date {
    color: var(--color-text-light);
    font-size: 0.85rem;
}

/* Featured Articles */
.featured-articles {
    padding: 4rem 0;
    background: var(--color-sandstone-light);
}

/* Blog Main */
.blog-main {
    padding: 3rem 0;
    min-height: 60vh;
}

/* When viewing a single article, make it full width */
.articles-container:has(.article-full) {
    max-width: 100%;
    padding: 0;
    margin: 0;
    grid-template-columns: 1fr;
    display: block;
}

.articles-container .article-full {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 2rem 3rem;
    grid-column: 1 / -1;
}

/* Override container when showing full article */
.blog-main .container:has(.article-full) {
    max-width: 100%;
    padding: 0;
}

.blog-header {
    margin-bottom: 3rem;
}

.page-title {
    font-size: 2.5rem;
    color: var(--color-black);
    margin-bottom: 2rem;
    text-align: center;
}

.category-filters {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    border: 2px solid var(--color-sandstone-dark);
    background: var(--color-white);
    color: var(--color-text);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--color-gold);
    color: var(--color-white);
    border-color: var(--color-gold);
}

/* Article Full View - Full Width */
.article-full {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 2rem 3rem;
    background: var(--color-white);
    border-radius: 0;
    box-sizing: border-box;
}

/* Make container full width when article is displayed */
.articles-container:has(.article-full),
.blog-main .container:has(.article-full) {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Ensure article content has proper max-width for readability */
.article-full .article-body {
    max-width: 100%;
}

.article-full h1 {
    max-width: 100%;
}

.article-full .article-meta {
    max-width: 100%;
}

[data-theme="dark"] .article-full {
    background: var(--color-white);
    border: 1px solid var(--color-sandstone-dark);
}

.article-full h1 {
    color: var(--color-black);
    font-size: 2.8rem;
    margin-bottom: 1.5rem;
    font-weight: 800;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.05);
    position: relative;
    padding-bottom: 1rem;
    border-bottom: 3px solid var(--color-gold);
}

.article-full h1::before {
    content: '𓂀';
    position: absolute;
    right: 0;
    bottom: -15px;
    font-size: 1.5rem;
    color: var(--color-gold);
    opacity: 0.6;
}

.article-full .article-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.article-full .article-featured-image {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    background: rgba(0, 0, 0, 0.02);
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.article-full .article-body {
    line-height: 1.8;
    color: var(--color-text);
    font-size: 1.1rem;
}

.article-full .article-body h2 {
    color: var(--color-black);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.article-full .article-body p {
    margin-bottom: 1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    overflow-y: auto;
    padding: 2rem;
}

.modal-content {
    background-color: var(--color-white);
    margin: 2rem auto;
    padding: 2rem;
    border-radius: var(--border-radius);
    max-width: 900px;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--color-text-light);
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--color-black);
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-sandstone) 0%, var(--color-sandstone-light) 100%);
    padding: 2rem;
}

.auth-card {
    background: var(--color-white);
    border-radius: var(--border-radius);
    padding: 3rem;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    color: var(--color-black);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--color-text-light);
}

.auth-form {
    margin-top: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

/* Bilingual Form Styles */
.section-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-gold-dark);
    margin-bottom: 1rem;
    display: block;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-gold-light);
}

.bilingual-input-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.5rem;
}

.lang-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.lang-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-gold);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.1) 0%, rgba(201, 169, 97, 0.05) 100%);
    border-radius: 8px;
    border-right: 3px solid var(--color-gold);
}

.content-editor-wrapper {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(201, 169, 97, 0.05) 0%, rgba(201, 169, 97, 0.02) 100%);
    border-radius: var(--border-radius);
    border: 2px solid var(--color-gold-light);
    box-shadow: 0 2px 8px rgba(201, 169, 97, 0.1);
}

.content-editor-wrapper .lang-label {
    margin-bottom: 1rem;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .bilingual-input-group {
        grid-template-columns: 1fr;
    }
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--color-black);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--color-sandstone-light);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-gold);
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--color-gold-light);
    border-radius: var(--border-radius);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.checkbox-label:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: var(--color-gold);
    transform: translateX(5px);
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

/* Custom Checkbox Design */
.checkbox-label span {
    position: relative;
    padding-left: 35px;
    /* Space for custom checkbox */
    font-weight: 500;
    color: var(--color-text);
    transition: var(--transition);
    z-index: 1;
}

/* The Box */
.checkbox-label span::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 22px;
    width: 22px;
    background-color: var(--color-white);
    border: 2px solid var(--color-gold);
    border-radius: 6px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* The Checkmark (Hidden by default) */
.checkbox-label span::after {
    content: '𓋹';
    /* Ankh symbol */
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    font-size: 16px;
    color: var(--color-white);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    line-height: 1;
}

/* Checked State */
.checkbox-label input[type="checkbox"]:checked~span::before {
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
    border-color: var(--color-gold-dark);
    box-shadow: 0 0 10px rgba(218, 165, 32, 0.4);
}

.checkbox-label input[type="checkbox"]:checked~span::after {
    transform: translateY(-50%) scale(1);
}

.checkbox-label input[type="checkbox"]:checked~span {
    color: var(--color-gold-dark);
    font-weight: 700;
}

/* Dark Mode Support */
[data-theme="dark"] .checkbox-label {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--color-gold-dark);
}

[data-theme="dark"] .checkbox-label:hover {
    background: rgba(255, 215, 0, 0.15);
    border-color: var(--color-gold);
}

[data-theme="dark"] .checkbox-label span {
    color: var(--color-text-light);
}

[data-theme="dark"] .checkbox-label span::before {
    background-color: rgba(0, 0, 0, 0.3);
    border-color: var(--color-gold);
}

[data-theme="dark"] .checkbox-label input[type="checkbox"]:checked~span {
    color: var(--color-gold);
}

[data-theme="dark"] .checkbox-label input[type="checkbox"]:checked~span::before {
    background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-pharaoh-gold) 100%);
    border-color: var(--color-gold);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

[data-theme="dark"] .checkbox-label input[type="checkbox"]:checked~span::after {
    color: #000;
    text-shadow: none;
}

/* RTL Support (Arabic) */
[dir="rtl"] .checkbox-label span {
    padding-left: 0;
    padding-right: 35px;
}

[dir="rtl"] .checkbox-label span::before {
    left: auto;
    right: 0;
}

[dir="rtl"] .checkbox-label span::after {
    left: auto;
    right: 4px;
}

[dir="rtl"] .checkbox-label:hover {
    transform: translateX(-5px);
}

.auth-error {
    color: #dc3545;
    margin-top: 1rem;
    padding: 0.75rem;
    background: #f8d7da;
    border-radius: var(--border-radius);
    display: none;
}

.auth-error.show {
    display: block;
}

[data-theme="dark"] .auth-error {
    background: rgba(220, 53, 69, 0.2);
    color: #ffdae0;
    border: 1px solid rgba(220, 53, 69, 0.4);
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    color: var(--color-text-light);
}

.auth-footer a {
    color: var(--color-gold);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Dashboard */
.dashboard-main,
.admin-main {
    padding: 3rem 0;
    min-height: 60vh;
}

.dashboard-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.dashboard-card,
.admin-card {
    background: var(--color-white);
    border: 2px solid var(--color-sandstone-light);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.dashboard-card h2,
.admin-card h2 {
    color: var(--color-black);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 2px solid var(--color-gold);
    padding-bottom: 0.5rem;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profile-info-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--color-sandstone-light);
}

.profile-info-item strong {
    color: var(--color-black);
}

.interests-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.interest-tag {
    background: var(--color-gold-light);
    color: var(--color-black);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Admin Form */
.admin-form {
    margin-top: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--color-sandstone-light);
    border-radius: var(--border-radius);
    border: 2px solid transparent;
    transition: var(--transition);
}

.post-item:hover {
    border-color: var(--color-gold);
}

.post-item-info h3 {
    color: var(--color-black);
    margin-bottom: 0.25rem;
}

.post-item-info p {
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.post-item-actions {
    display: flex;
    gap: 0.5rem;
}

.image-preview {
    margin-top: 1rem;
}

.image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: var(--border-radius);
    border: 2px solid var(--color-sandstone-light);
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--color-sandstone-light);
    flex-wrap: wrap;
}

.admin-tab {
    padding: 1rem 2rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--color-text-light);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.admin-tab:hover {
    color: var(--color-black);
}

.admin-tab.active {
    color: var(--color-gold);
    border-bottom-color: var(--color-gold);
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--color-gold-light) 0%, var(--color-gold) 100%);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 10px rgba(201, 169, 97, 0.2);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(201, 169, 97, 0.3);
}

.stat-icon {
    font-size: 3rem;
    line-height: 1;
}

.stat-info h3 {
    font-size: 2rem;
    color: var(--color-black);
    margin: 0;
    font-weight: 700;
}

.stat-info p {
    color: var(--color-text);
    margin: 0.25rem 0 0 0;
    font-size: 0.9rem;
}

/* Recent Posts/Users Lists */
.recent-posts-list,
.recent-users-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--color-sandstone-light);
    border-radius: var(--border-radius);
    border-right: 3px solid var(--color-gold);
}

.recent-item-info h4 {
    color: var(--color-black);
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
}

.recent-item-info p {
    color: var(--color-text-light);
    margin: 0;
    font-size: 0.85rem;
}

/* Users List */
.users-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--color-sandstone-light);
    border-radius: var(--border-radius);
    border: 2px solid transparent;
    transition: var(--transition);
}

.user-item:hover {
    border-color: var(--color-gold);
}

.user-item-info {
    flex: 1;
}

.user-item-info h3 {
    color: var(--color-black);
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
}

.user-item-info p {
    color: var(--color-text-light);
    margin: 0;
    font-size: 0.9rem;
}

.user-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.user-badge.admin {
    background: var(--color-gold);
    color: var(--color-black);
}

.user-badge.user {
    background: var(--color-sandstone-dark);
    color: var(--color-white);
}

.user-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-direction: column;
    min-width: 180px;
}

.user-item-actions .btn {
    white-space: nowrap;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

.user-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.user-details {
    margin-top: 1rem;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0;
    padding: 0.5rem;
    background: var(--color-sandstone-light);
    border-radius: var(--border-radius);
    flex-wrap: wrap;
}

.detail-label {
    font-weight: 600;
    color: var(--color-gold);
    min-width: 150px;
}

.detail-value {
    flex: 1;
    color: var(--color-text);
    word-break: break-word;
}

.user-uid {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    background: var(--color-sandstone-dark);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.btn-copy {
    background: var(--color-gold);
    color: var(--color-black);
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.btn-copy:hover {
    background: var(--color-gold-dark);
    transform: scale(1.05);
}

.modal-large {
    max-width: 700px;
    width: 90%;
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-sandstone-light);
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h3 {
    color: var(--color-gold);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.readonly-input {
    background: var(--color-sandstone-light);
    cursor: not-allowed;
    opacity: 0.7;
}

.interests-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

/* Old label styles removed in favor of global .checkbox-label */

[data-theme="dark"] .detail-row {
    background: var(--color-sandstone-dark);
}

[data-theme="dark"] .user-uid {
    background: var(--color-sandstone);
}

/* Filters */
.posts-filters,
.users-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem;
    border: 2px solid var(--color-sandstone-light);
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.filter-select {
    padding: 0.75rem;
    border: 2px solid var(--color-sandstone-light);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: var(--color-white);
}

/* Security Settings */
.security-settings {
    margin-top: 1rem;
}

.security-settings p {
    color: var(--color-text-light);
    margin-top: 0.5rem;
}

/* Form Group Small */
.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--color-text-light);
    font-size: 0.85rem;
}

/* Text Editor */
.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--color-sandstone-light);
    border: 2px solid var(--color-sandstone-dark);
    border-radius: var(--border-radius);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-bottom: 0;
}

.toolbar-group {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    padding: 0 0.5rem;
    border-right: 1px solid var(--color-sandstone-dark);
}

.toolbar-group:last-child {
    border-right: none;
}

.toolbar-btn {
    padding: 0.5rem 0.75rem;
    background: var(--color-white);
    border: 1px solid var(--color-sandstone-dark);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
    font-family: inherit;
    min-width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toolbar-btn:hover {
    background: var(--color-gold-light);
    border-color: var(--color-gold);
}

.toolbar-btn.active {
    background: var(--color-gold);
    color: var(--color-white);
    border-color: var(--color-gold-dark);
}

.toolbar-btn select {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0;
    min-width: 120px;
}

.toolbar-btn.color-picker {
    padding: 0;
    width: 35px;
    height: 35px;
    border: 1px solid var(--color-sandstone-dark);
    cursor: pointer;
}

.text-editor {
    min-height: 300px;
    padding: 1rem;
    border: 2px solid var(--color-sandstone-dark);
    border-top: none;
    border-radius: var(--border-radius);
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    background: var(--color-white);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    overflow-y: auto;
    outline: none;
}

.text-editor:focus {
    border-color: var(--color-gold);
}

.text-editor:empty:before {
    content: "ابدأ الكتابة هنا...";
    color: var(--color-text-light);
}

.text-editor p {
    margin: 0.5rem 0;
}

.text-editor ul,
.text-editor ol {
    margin: 0.5rem 0;
    padding-right: 2rem;
}

.text-editor a {
    color: var(--color-gold);
    text-decoration: underline;
}

.text-editor img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 1rem 0;
}

/* Footer - Enhanced Egyptian Theme */
.footer {
    background: linear-gradient(135deg, #0A0A0A 0%, #1A1A1A 50%, #2A241F 100%);
    color: var(--color-sandstone-light);
    padding: 4rem 0 2rem;
    margin-top: 5rem;
    position: relative;
    border-top: 4px solid var(--color-gold);
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: repeating-linear-gradient(90deg, var(--color-gold) 0px, var(--color-gold) 10px, transparent 10px, transparent 20px);
    opacity: 0.5;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
    color: var(--color-gold);
    margin-bottom: 1rem;
}

.footer-section p {
    color: var(--color-sandstone-light);
    line-height: 1.8;
}

.footer-section a {
    display: block;
    color: var(--color-sandstone-light);
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--color-gold);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(212, 197, 169, 0.2);
    color: var(--color-sandstone);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-light);
    font-size: 1.1rem;
}

[data-theme="dark"] .loading {
    color: var(--color-text-light);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

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

    .section-title {
        font-size: 2rem;
    }

    .nav {
        flex-direction: column;
        gap: 0.5rem;
    }

    .header-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }

    .header-toggle-buttons {
        order: 2;
    }

    .header-actions {
        order: 3;
    }

    .logo {
        order: 1;
    }

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

    .articles-grid,
    .articles-container {
        grid-template-columns: 1fr;
    }

    .article-full {
        padding: 1.5rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
    }

    .dashboard-content {
        grid-template-columns: 1fr;
    }

    .post-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .hero {
        padding: 3rem 0;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .page-title {
        font-size: 1.8rem;
    }

    .article-full {
        padding: 1rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 2rem;
    }

    .footer-section {
        text-align: center;
    }

    .category-card {
        padding: 1.5rem;
    }

    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Additional Mobile Optimizations */
@media (max-width: 768px) {
    .article-body {
        font-size: 1rem;
        line-height: 1.7;
    }

    .article-body h2 {
        font-size: 1.5rem;
    }

    .article-body h3 {
        font-size: 1.3rem;
    }

    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .contact-container {
        padding: 2rem 1rem;
        margin: 2rem auto;
    }
}

/* Comments Section */
.comments-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--color-sandstone-light);
}

.comments-container h3 {
    color: var(--color-black);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.comment-item {
    background: var(--color-sandstone-light);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    border-right: 3px solid var(--color-gold);
}

.comment-author {
    font-weight: 600;
    color: var(--color-black);
    margin-bottom: 0.25rem;
}

.comment-date {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 0.5rem;
}

.comment-text {
    color: var(--color-text);
    line-height: 1.6;
}

.comment-form-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--color-white);
    border: 2px solid var(--color-sandstone-light);
    border-radius: var(--border-radius);
}

.comment-form-container h4 {
    color: var(--color-black);
    margin-bottom: 1rem;
}

.comment-form .form-group {
    margin-bottom: 1rem;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--color-sandstone-light);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--color-gold);
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 1rem;
}

.mt-2 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

/* Advertisement Banners - Google AdSense Compatible */
.ad-banner {
    width: 100%;
    margin: 2rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

/* Ensure ads are centered within article */
.article-full .ad-banner {
    width: 100%;
    margin: 2rem auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.article-full .ad-banner .ad-placeholder,
.article-full .ad-banner .adsense-placeholder {
    margin: 0 auto;
    display: block;
    width: 100%;
    max-width: 728px;
}

/* Ad Above Articles List */
.ad-top-articles {
    margin: 2rem 0;
    min-height: 100px;
}

/* Ad Above Article Content - Centered */
.ad-above-article {
    margin: 2rem auto;
    min-height: 90px;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Ad Mid Article - Centered */
.ad-mid-article {
    margin: 2rem auto;
    max-width: 100%;
    min-height: 250px;
    padding: 1.5rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border-top: 1px solid var(--color-sandstone-light);
    border-bottom: 1px solid var(--color-sandstone-light);
}

/* Ad Below Article - Centered */
.ad-below-article {
    margin: 2rem auto 1rem auto;
    min-height: 100px;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* AdSense Placeholder - Centered */
.adsense-placeholder {
    width: 100%;
    max-width: 728px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-sandstone-light);
    border-radius: var(--border-radius);
    padding: 1rem;
    border: 2px dashed var(--color-sandstone-dark);
    margin: 0 auto;
}

.adsense-placeholder ins {
    display: block;
    width: 100%;
    max-width: 728px;
    min-height: 100px;
    margin: 0 auto;
}

/* AdSense Responsive Styles */
.adsbygoogle {
    display: block;
    width: 100%;
    min-height: 100px;
}

/* Ad Placeholder Text */
.ad-placeholder {
    color: var(--color-text-light);
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem;
    width: 100%;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--border-radius);
}

[data-theme="dark"] .ad-placeholder,
[data-theme="dark"] .adsense-placeholder {
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--color-sandstone);
    color: var(--color-text-light);
}

/* Sidebar Ads (Desktop Only) */
.ad-sidebar-left,
.ad-sidebar-right {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    /* Standard wide skyscraper width */
    height: 600px;
    /* Standard height */
    z-index: 1000;
    display: none;
    /* Hidden by default (mobile/tablet) */
}

.ad-sidebar-left {
    left: 10px;
}

.ad-sidebar-right {
    right: 10px;
}

/* Show only on desktop screens */
@media (min-width: 1200px) {

    .ad-sidebar-left,
    .ad-sidebar-right {
        display: block;
    }

    .ad-mid-article {
        min-height: 150px;
    }
}

.ad-blog-inline {
    grid-column: 1 / -1;
    width: 100%;
    margin: 2rem 0;
    text-align: center;
    background: var(--color-background-alt);
    padding: 1rem;
    border-radius: var(--border-radius);
    display: flex;
    /* Ensure content centers */
    justify-content: center;
    align-items: center;
    min-height: 100px;
}

/* Sidebar Placeholder */
.ad-sidebar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(240, 240, 240, 0.9) 100%);
    border: 2px dashed var(--color-gold);
    border-radius: var(--border-radius);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    color: var(--color-text);
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .ad-sidebar-placeholder {
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.9) 0%, rgba(20, 20, 20, 0.9) 100%);
    border-color: var(--color-gold-dark);
    color: var(--color-text-light);
}

.ad-sidebar-placeholder:hover {
    transform: scale(1.02);
    border-style: solid;
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.3);
}

.ad-placeholder-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--color-gold);
}

.ad-placeholder-text {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.ad-placeholder-sub {
    font-size: 0.8rem;
    color: var(--color-text-light);
}

/* Responsive Ads */
@media (max-width: 768px) {
    .ad-banner {
        margin: 1.5rem 0;
        min-height: 80px;
    }

    .ad-mid-article {
        min-height: 200px;
        padding: 1rem 0;
    }

    .adsense-placeholder {
        min-height: 80px;
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .ad-banner {
        margin: 1rem 0;
        min-height: 50px;
    }

    .ad-mid-article {
        min-height: 150px;
    }
}

/* ============================================
   Additional Dark Mode Fixes - Comprehensive
   ============================================ */

[data-theme="dark"] .footer {
    background: #0a0a0a !important;
    color: #e8e8e8 !important;
    border-top: 1px solid rgba(229, 201, 138, 0.2) !important;
}

[data-theme="dark"] .footer h3,
[data-theme="dark"] .footer h4,
[data-theme="dark"] .footer-section h3,
[data-theme="dark"] .footer-section h4 {
    color: var(--color-gold) !important;
}

[data-theme="dark"] .footer p,
[data-theme="dark"] .footer-section p {
    color: #c0c0c0 !important;
}

[data-theme="dark"] .footer a,
[data-theme="dark"] .footer-section a {
    color: #c0c0c0 !important;
}

[data-theme="dark"] .footer a:hover,
[data-theme="dark"] .footer-section a:hover {
    color: var(--color-gold) !important;
}

[data-theme="dark"] .footer-bottom {
    color: #c0c0c0 !important;
    border-top-color: rgba(229, 201, 138, 0.2) !important;
}

/* ============================================
   Modern Enhancements - Premium Design
   ============================================ */

/* Smooth Page Load Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Apply animations to main sections */
.hero {
    animation: fadeIn 0.8s ease-out;
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* 3D Parallax Effect for Hero */
.hero-content {
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
}

.categories {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.featured-articles {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* Stagger animation for category cards */
.category-card {
    animation: fadeInUp 0.6s ease-out both;
}

.category-card:nth-child(1) {
    animation-delay: 0.1s;
}

.category-card:nth-child(2) {
    animation-delay: 0.2s;
}

.category-card:nth-child(3) {
    animation-delay: 0.3s;
}

.category-card:nth-child(4) {
    animation-delay: 0.4s;
}

.category-card:nth-child(5) {
    animation-delay: 0.5s;
}

/* Stagger animation for article cards */
.article-card {
    animation: fadeInUp 0.6s ease-out both;
}

.article-card:nth-child(1) {
    animation-delay: 0.1s;
}

.article-card:nth-child(2) {
    animation-delay: 0.2s;
}

.article-card:nth-child(3) {
    animation-delay: 0.3s;
}

.article-card:nth-child(4) {
    animation-delay: 0.4s;
}

.article-card:nth-child(5) {
    animation-delay: 0.5s;
}

.article-card:nth-child(6) {
    animation-delay: 0.6s;
}

/* Enhanced Scroll Behavior */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

/* Improved Focus States for Accessibility */
*:focus-visible {
    outline: 3px solid var(--color-gold);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Enhanced Button Ripple Effect */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

/* Improved Article Content Readability */
.article-content {
    position: relative;
    z-index: 1;
}

.article-image {
    transition: transform 0.4s ease;
}

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

/* Enhanced Category Icon Animation */
.category-icon {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.category-card:hover .category-icon {
    animation: none;
}

/* Improved Loading State */
.loading {
    position: relative;
    padding-left: 40px;
}

.loading::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: 3px solid var(--color-gold-light);
    border-top-color: var(--color-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Enhanced Glassmorphism Effects */
.header {
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
}

/* Improved Dark Mode Transitions */
[data-theme="dark"] * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Enhanced Shadow on Scroll */
.header.scrolled {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Improved Text Selection */
::selection {
    background-color: var(--color-gold);
    color: var(--color-white);
}

::-moz-selection {
    background-color: var(--color-gold);
    color: var(--color-white);
}

/* Enhanced Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--color-sandstone-light);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
    border-radius: 6px;
    border: 2px solid var(--color-sandstone-light);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--color-gold-light) 0%, var(--color-gold) 100%);
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #1a1a1a;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    border-color: #1a1a1a;
}

/* Improved Image Loading */
img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Enhanced Link Hover Effects */
a {
    position: relative;
    transition: color 0.3s ease;
}

/* Improved Accessibility - Reduced Motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark Mode for Builder / Generator */
[data-theme="dark"] .builder-card {
    background: #1a1a1a;
    border-color: var(--color-pharaoh-gold);
}

[data-theme="dark"] .builder-card h3 {
    color: var(--color-gold);
}

[data-theme="dark"] .form-control {
    background-color: #2a2520;
    color: var(--color-white);
    border-color: #443c30;
}

[data-theme="dark"] .form-control:focus {
    background-color: #332d26;
    border-color: var(--color-gold);
}

[data-theme="dark"] .rich-editor-toolbar {
    background-color: #2a2520;
    border-color: #443c30;
}

[data-theme="dark"] .rich-editor-content {
    background-color: #1a1a1a;
    color: var(--color-white);
    border-color: #443c30;
}

[data-theme="dark"] .toolbar-btn {
    color: var(--color-gold);
    background: transparent;
}

[data-theme="dark"] .toolbar-btn:hover {
    background-color: #332d26;
    color: var(--color-royal-gold);
}

[data-theme="dark"] .source-view {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

/* Admin LTR Support */
body.lang-en {
    direction: ltr;
}

body.lang-en .admin-tabs {
    flex-direction: row;
    justify-content: flex-start;
}

body.lang-en .stat-icon {
    margin-left: 0;
    margin-right: 1.5rem;
}

body.lang-en .form-group {
    text-align: left;
}

body.lang-en input,
body.lang-en textarea,
body.lang-en select {
    text-align: left;
    direction: ltr;
}

body.lang-en .admin-tab {
    margin-left: 0;
    margin-right: 0.5rem;
}

body.lang-en h1,
body.lang-en h2,
body.lang-en h3,
body.lang-en p {
    text-align: left;
}

body.lang-en .nav-link {
    text-align: left;
}

/* Article Page Enhancements */
.article-full {
    background: var(--color-white);
    padding: 3rem 4rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.article-title-main {
    font-size: 2.5rem;
    color: var(--color-black);
    margin-bottom: 1rem;
    line-height: 1.3;
    font-weight: 800;
}

[data-theme="dark"] .article-title-main {
    color: var(--color-gold);
}

.article-body {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #2c2c2c;
    max-width: 900px;
    /* Better line length for reading */
    margin: 0 auto;
}

[data-theme="dark"] .article-body {
    color: #e0e0e0;
}

.article-body p {
    margin-bottom: 1.8rem;
}

.article-body h2 {
    font-size: 1.8rem;
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
    color: var(--color-royal-gold);
    border-bottom: 2px solid var(--color-gold-light);
    padding-bottom: 0.5rem;
}

.article-body h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--color-pharaoh-gold);
}

.article-body ul,
.article-body ol {
    margin-bottom: 1.5rem;
    padding-right: 2rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

.article-meta {
    font-size: 0.95rem;
    color: var(--color-text-light);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    gap: 1.5rem;
}

/* ============================================
   Mobile Responsive Navigation
   ============================================ */
.mobile-only {
    display: none;
}

@media (max-width: 768px) {
    .mobile-only {
        display: inline-flex;
        /* Show hamburger on mobile */
        align-items: center;
        justify-content: center;
        font-size: 1.5rem;
        margin-inline-start: 10px;
        z-index: 1001;
        /* Above everything */
        background: transparent;
        border: none;
        cursor: pointer;
        color: var(--color-text);
        transition: color 0.3s;
    }

    .mobile-only:hover {
        color: var(--color-gold);
    }

    /* Adjust Header Layout */
    .header-content {
        position: relative;
        flex-wrap: wrap;
    }

    /* Hide Desktop Nav by Default */
    .header-actions {
        display: none;
        /* Hidden by default on mobile */
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        /* Improved Colors for Light Mode */
        background: #FAF5E6;
        /* Warm Papyrus tint */
        color: #333;
        box-shadow: var(--shadow-md);
        padding: 1.5rem;
        border-radius: 0 0 12px 12px;
        border-top: 2px solid var(--color-gold);
        z-index: 1000;
        animation: slideDown 0.3s ease-out;
    }

    /* Keep Logo and Toggles Visible */
    .header-toggle-buttons {
        margin-left: auto;
        /* Push to right/left */
        margin-right: 0;
    }

    /* Show Nav when Open */
    body.nav-open .header-actions {
        display: flex;
        /* SHOW ON CLICK */
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .nav {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }

    .nav-link {
        width: 100%;
        text-align: center;
        padding: 1rem;
        border-bottom: 1px solid rgba(212, 175, 55, 0.2);
        /* Subtle Gold divider */
        color: var(--color-black);
        /* Strong text color */
        font-weight: bold;
        transition: background 0.3s, color 0.3s;
        border-radius: 8px;
    }

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

    .nav-link:hover {
        background: rgba(212, 175, 55, 0.1);
        color: var(--color-gold-dark);
    }

    /* RTL Mobile Header Layout (Arabic) */
    html[dir="rtl"] .header-content {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    html[dir="rtl"] .mobile-only {
        order: 1;
        /* Right side in RTL */
        margin-left: 0;
        margin-right: 10px;
    }

    html[dir="rtl"] .logo {
        order: 2;
        /* Center */
        flex-grow: 1;
        text-align: center;
        display: flex;
        justify-content: center;
    }

    html[dir="rtl"] .header-toggle-buttons {
        order: 3;
        /* Left side in RTL */
        margin-right: 0;
        margin-left: 0;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

/* Dark Mode Adjustments for Mobile Menu */
[data-theme="dark"] .header-actions {
    background: #1A1A1A;
    /* Deep Dark Grey */
    border-color: var(--color-gold);
}

[data-theme="dark"] .nav-link {
    color: #f0f0f0;
    /* Bright text */
    border-bottom-color: rgba(255, 215, 0, 0.2);
}

[data-theme="dark"] .nav-link:hover {
    background: rgba(255, 215, 0, 0.1);
    color: var(--color-gold);
}

/* Dark Mode Fix for Blog Filter Buttons */
[data-theme="dark"] .filter-btn.active {
    background-color: var(--color-gold) !important;
    color: #ffffff !important;
    border-color: var(--color-gold) !important;
}

[data-theme="dark"] .filter-btn:not(.active) {
    color: #e8e8e8;
    border-color: var(--color-sandstone-dark);
    background: transparent;
}

[data-theme="dark"] .filter-btn:hover {
    background-color: var(--color-gold) !important;
    color: #ffffff !important;
}

/* Remove underline from Related Articles links */
.related-articles-section a {
    text-decoration: none !important;
}

.related-articles-section a:hover {
    text-decoration: none !important;
}

/* Did You Know? Box Styling (Fixed) */
.did-you-know-box {
    background: linear-gradient(135deg, #fffcf5 0%, #fff7e6 100%);
    border: 2px solid var(--color-gold);
    border-radius: 12px;
    padding: 2rem;
    margin: 3rem auto;
    max-width: 800px;
    position: relative;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.15);
    text-align: center;
    transition: transform 0.3s ease;
}

.did-you-know-box:hover {
    transform: translateY(-5px);
}

.did-you-know-box::before {
    content: "💡";
    font-size: 2.5rem;
    display: block;
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

.did-you-know-box h3 {
    color: var(--color-royal-gold);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.did-you-know-box p {
    color: #444;
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.6;
    margin: 0;
}

[data-theme="dark"] .did-you-know-box {
    background: linear-gradient(135deg, #2a2520 0%, #1a1a1a 100%);
    border-color: var(--color-gold-dark);
}

[data-theme="dark"] .did-you-know-box p {
    color: #e0e0e0;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* ============================================
   Search Overlay Styles
   ============================================ */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 15vh;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-container {
    width: 90%;
    max-width: 700px;
    position: relative;
    text-align: center;
    animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }

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

#search-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--color-gold);
    color: var(--color-gold-light);
    font-size: 2rem;
    padding: 1rem 0.5rem;
    font-family: inherit;
    outline: none;
    text-align: center;
    transition: all 0.3s;
}

#search-input:focus {
    border-bottom-color: var(--color-royal-gold);
    box-shadow: 0 10px 30px -10px rgba(212, 175, 55, 0.2);
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-size: 1.5rem;
}

.close-search {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: var(--color-text-light);
    font-size: 3rem;
    cursor: pointer;
    line-height: 1;
    transition: all 0.3s;
    z-index: 10001;
}

.close-search:hover {
    color: var(--color-gold);
    transform: rotate(90deg);
}

.search-results {
    margin-top: 3rem;
    max-height: 60vh;
    overflow-y: auto;
    text-align: left;
    padding-right: 1rem;
}

[dir="rtl"] .search-results {
    text-align: right;
    padding-right: 0;
    padding-left: 1rem;
}

/* Scrollbar for results */
.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-thumb {
    background: var(--color-gold-dark);
    border-radius: 3px;
}

.search-result-item {
    display: block;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.1);
    border-left: 4px solid var(--color-gold);
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    color: var(--color-white);
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

[dir="rtl"] .search-result-item {
    border-left: 1px solid rgba(212, 175, 55, 0.1);
    border-right: 4px solid var(--color-gold);
}

.search-result-item:hover {
    background: rgba(212, 175, 55, 0.1);
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

[dir="rtl"] .search-result-item:hover {
    transform: translateX(-5px);
}

.search-result-item h4 {
    margin: 0;
    font-size: 1.3rem;
    color: var(--color-gold);
    margin-bottom: 0.5rem;
}

.search-loading,
.no-results,
.error {
    color: var(--color-text-light);
    font-size: 1.2rem;
    margin-top: 2rem;
    font-style: italic;
}

/* ============================================
   3D Pharaonic Effects - Premium Design
   ============================================ */

/* 3D Depth for Category Cards */
.category-card {
    transform-style: preserve-3d;
}

.category-card .category-icon {
    transform: translateZ(20px);
    transition: transform 0.5s ease;
}

.category-card:hover .category-icon {
    transform: translateZ(40px) rotateY(360deg) scale(1.2);
}

/* Article Image Effect (2D only) */
.article-image {
    transition: transform 0.4s ease;
}

.article-image img {
    transition: transform 0.5s ease;
}

.article-card:hover .article-image img {
    transform: scale(1.1);
}

/* 3D Button Press Effect */
.btn {
    transform-style: preserve-3d;
    position: relative;
}

.btn::before {
    transform-style: preserve-3d;
}

/* 3D Header Logo */
.logo {
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
}

.logo:hover {
    transform: translateZ(15px) rotateY(5deg);
}

.logo-img {
    transform: translateZ(0);
    transition: transform 0.5s ease;
}

.logo:hover .logo-img {
    transform: translateZ(20px) scale(1.1);
}

/* 3D Section Titles */
.section-title {
    transform-style: preserve-3d;
    position: relative;
}

.section-title::after {
    transform: translateZ(10px);
}

/* 3D Floating Animation for Cards */
@keyframes float3D {
    0%, 100% {
        transform: translateY(0) translateZ(0) rotateX(0deg);
    }
    50% {
        transform: translateY(-15px) translateZ(20px) rotateX(-2deg);
    }
}

.category-card:nth-child(odd) {
    animation: float3D 6s ease-in-out infinite;
    animation-delay: 0s;
}

.category-card:nth-child(even) {
    animation: float3D 6s ease-in-out infinite;
    animation-delay: 1s;
}

.category-card:hover {
    animation: none;
}

/* 3D Glow Effect */
@keyframes pharaonicGlow {
    0%, 100% {
        box-shadow: 
            0 20px 60px rgba(212, 175, 55, 0.4),
            0 0 30px rgba(255, 215, 0, 0.3);
    }
    50% {
        box-shadow: 
            0 25px 80px rgba(212, 175, 55, 0.6),
            0 0 50px rgba(255, 215, 0, 0.5),
            0 0 80px rgba(255, 215, 0, 0.3);
    }
}

.category-card:hover {
    animation: pharaonicGlow 2s ease-in-out infinite;
}

/* 3D Perspective for Container */
.categories-grid,
.articles-grid,
.articles-container {
    perspective: 1200px;
    transform-style: preserve-3d;
}

/* Article cards - simple 2D hover effect */
.article-card:hover {
    transform: translateY(-12px) scale(1.03) !important;
}

/* 3D Hero Title Effect */
.hero-title {
    transform-style: preserve-3d;
    transform: translateZ(0);
}

.hero-title::before,
.hero-title::after {
    transform: translateZ(30px);
}

/* 3D Navigation Links */
.nav-link {
    transform-style: preserve-3d;
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-gold) 0%, var(--color-royal-gold) 100%);
    transform: translateZ(10px);
    transition: width 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

/* 3D Footer Effect */
.footer {
    transform-style: preserve-3d;
    position: relative;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%,
        var(--color-gold) 20%,
        var(--color-royal-gold) 50%,
        var(--color-gold) 80%,
        transparent 100%);
    transform: translateZ(5px);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* 3D Scroll Effect */
@keyframes scroll3D {
    0% {
        transform: translateZ(0) rotateX(0deg);
    }
    100% {
        transform: translateZ(50px) rotateX(5deg);
    }
}

/* Enhanced 3D Shadows */
.category-card,
.article-card {
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
}

.category-card:hover,
.article-card:hover {
    filter: drop-shadow(0 20px 40px rgba(212, 175, 55, 0.4)) 
            drop-shadow(0 0 30px rgba(255, 215, 0, 0.3));
}

/* 3D Mobile Optimization */
@media (max-width: 768px) {
    .category-card:hover,
    .article-card:hover {
        transform: translateY(-10px) translateZ(15px) scale(1.03);
    }
    
    .btn-primary:hover {
        transform: translateY(-5px) translateZ(10px) scale(1.05);
    }
}