/* Google Fonts - Cairo & Amiri */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700;900&family=Amiri:wght@700&display=swap');

/* ... (root variables stay same) ... */

/* Hero Section */
/* ... */
.hero h1 {
    font-family: 'Amiri', serif;
    /* Changed to Amiri for distinct look */
    font-size: 3.5rem;
    /* Slightly larger */
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

:root {
    --primary-color: #3e1f35;
    /* Deep Wine/Plum (from top circle) */
    --secondary-color: #d65a48;
    /* Terracotta Red (from second circle) */
    --accent-color: #c49f67;
    /* Antique Gold (from third circle) */
    --text-color: #2e1c1c;
    /* Soft dark brown-black for text */
    --text-light: #7a6e6e;
    --bg-color: #fcf6f0;
    /* Warm Cream background (matching palette bg) */
    --card-bg: #ffffff;
    --border-color: #e6dcd3;
    /* Warmer border color */
    --success: #27ae60;
    --error: #c0392b;

    --shadow-sm: 0 1px 3px rgba(62, 31, 53, 0.1), 0 1px 2px rgba(62, 31, 53, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(62, 31, 53, 0.1), 0 2px 4px -1px rgba(62, 31, 53, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(62, 31, 53, 0.1), 0 4px 6px -2px rgba(62, 31, 53, 0.05);

    --radius: 12px;
    --container-width: 1200px;
}

/* ... existing styles ... */

/* Hero Section Update */
.hero {
    background: linear-gradient(135deg, var(--primary-color), #5e2d4d);
    /* Richer gradient */
    color: white;
    padding: 80px 0;
    text-align: center;
    margin-bottom: 40px;
}

/* ... existing styles ... */

/* Button Hover Update */
.btn-outline {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.btn-outline:hover {
    background: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* Nav Links Active Update */
.nav-links a:hover,
.nav-links a.active {
    color: var(--secondary-color);
}

.nav-links a::after {
    background: var(--secondary-color);
}

.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-color);
}


/* ===========================
   RESPONSIVENESS (MOBILE)
=========================== */

@media (max-width: 768px) {

    /* Header & Navigation Fixes */
    nav {
        flex-direction: row;
        /* Keep logo and burger side by side */
        padding: 15px 0;
        height: auto;
        position: relative;
        /* For absolute dropdown positioning */
    }

    .logo {
        margin-bottom: 0;
        /* Reset */
    }

    .mobile-toggle {
        display: block;
        /* Show hamburger */
    }

    /* Hidden Menu State */
    .nav-links {
        display: none !important;
        /* Forces hidden until JS removes this or adds display flex via active class */
        flex-direction: column;
        width: 100%;
        background: white;
        position: absolute;
        top: 100%;
        /* Below header */
        left: 0;
        right: 0;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
        border-top: 1px solid var(--border-color);
        padding: 0;
        z-index: 999;
    }

    /* Visible Menu State (Active) */
    .nav-links.active {
        display: flex !important;
    }

    .nav-links a {
        padding: 15px 20px;
        font-size: 1rem;
        background: transparent;
        border-radius: 0;
        text-align: right;
        border-bottom: 1px solid #eee;
        width: 100%;
    }

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

    /* Hero Section */
    .hero {
        padding: 50px 0;
    }

    .hero h1 {
        font-size: 2.2rem;
        /* Smaller font for mobile */
    }

    .hero p {
        font-size: 1rem;
        padding: 0 15px;
    }

    /* Grid Stacking */
    .grid-3 {
        grid-template-columns: 1fr !important;
        /* Force single column */
    }

    .grid-sidebar {
        grid-template-columns: 1fr !important;
        gap: 30px;
    }

    /* Sidebar Order */
    aside {
        order: 2;
        /* Put sidebar below content on mobile, or 1 for above */
    }

    /* Card Adjustments */
    .card-img {
        height: 220px;
        /* Slightly taller for better focus on mobile */
    }

    .overlay-title {
        font-size: 1.2rem;
    }

    /* PDF Box */
    .pdf-download-box {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .pdf-download-box .btn {
        width: 100%;
    }
}

/* Admin Mobile Responsiveness (Already existed, just refreshing) */
@media (max-width: 992px) {
    .admin-sidebar {
        flex-direction: column;
        align-items: center;
        padding: 15px;
    }

    .admin-nav {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .admin-nav a {
        padding: 8px 10px;
        font-size: 0.9rem;
        flex-grow: 1;
        text-align: center;
        margin-bottom: 5px;
    }

    .admin-content {
        padding: 20px;
    }
}

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

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    direction: rtl;
    /* Right to Left */
    text-align: right;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

/* Public Header (Front-end) */
header {
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1rem;
    position: relative;
    padding: 5px 0;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--secondary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 80px 0;
    text-align: center;
    margin-bottom: 40px;
}

.hero h1 {
    font-family: 'Amiri', serif;
    font-size: 3.5rem;
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.hero p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 25px;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Grid Layouts */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.grid-sidebar {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
}

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

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-img {
    height: 200px;
    background: #e2e8f0;
    overflow: hidden;
    position: relative;
}

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

.card:hover .card-img img {
    transform: scale(1.05);
}

.card {
    position: relative;
    /* Ensure card is relative for absolute children */
}

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 10%, rgba(0, 0, 0, 0.6) 50%, transparent 100%);
    color: white !important;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    /* Higher z-index */
}

.category-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--secondary-color);
    color: white !important;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
    z-index: 20;
    /* Highest z-index */
}

.overlay-title {
    color: white !important;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
    text-align: right;
    position: relative;
    z-index: 11;
}

.card-body {
    padding: 20px;
}

.card-meta {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-color);
    line-height: 1.4;
}

.card-excerpt {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

/* Single Post */
.post-header {
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.post-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.post-content h2,
.post-content h3 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.post-content p {
    margin-bottom: 20px;
}

/* PDF Download Box */
.pdf-download-box {
    background: #f1f8ff;
    border: 1px solid #cce5ff;
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 30px 0;
}

.pdf-info h4 {
    margin-bottom: 5px;
    color: var(--primary-color);
}

/* Sidebar */
.sidebar-widget {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.widget-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color);
    display: inline-block;
}

.categories-list li {
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color);
}

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

.categories-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.categories-list span {
    background: var(--bg-color);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* Footer */
footer {
    background: var(--primary-color);
    color: white;
    padding: 50px 0 20px;
    margin-top: 60px;
    text-align: center;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
    text-align: right;
}

.footer-col h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(21, 152, 149, 0.1);
}


/* =================================================================
   ADMIN PANEL STYLES - NEW HORIZONTAL LAYOUT
================================================================= */

.admin-container {
    display: block;
    /* Standard block layout */
    min-height: 100vh;
}

/* Make "Sidebar" behave like a "Header Menu Bar" */
.admin-sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    /* Stick to top */
    top: 0;
    background: var(--primary-color);
    color: white;
    padding: 10px 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    box-shadow: var(--shadow-md);
}

/* The Title part */
.admin-sidebar>div {
    font-size: 1.2rem;
    padding: 0;
    border: none !important;
    /* Remove old border-bottom */
    margin-bottom: 0;
}

/* Navigation Links Container */
.admin-nav {
    display: flex;
    flex-direction: row;
    /* Horizontal */
    gap: 5px;
    align-items: center;
}

/* The links */
.admin-nav a {
    display: inline-block;
    padding: 8px 15px;
    color: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    font-size: 0.95rem;
    margin: 0;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-right: none;
    /* Remove sidebar style border */
}

/* Admin Content Area */
.admin-content {
    margin-right: 0;
    /* Remove sidebar offset */
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Dashboard Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

th,
td {
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: #f8f9fa;
    font-weight: 700;
}

.badge {
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}


/* ===========================
   RESPONSIVENESS
=========================== */

@media (max-width: 992px) {

    /* Stack elements on smaller screens */
    .admin-sidebar {
        flex-direction: column;
        align-items: center;
        padding: 15px;
    }

    .admin-sidebar>div {
        margin-bottom: 15px;
    }

    .admin-nav {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .admin-nav a {
        padding: 8px 12px;
        font-size: 0.9rem;
        flex-grow: 1;
        /* Make touch targets larger */
        text-align: center;
    }
}