:root {
    --primary-color: #2d6a4f;
    --primary-light: #52b788;
    --secondary-color: #1b4332;
    --accent-color: #ff9f1c; /* A warm highlight color */
    --text-color: #333d29;
    --text-muted: #6b705c;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

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

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
.main-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.container-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo-pulse {
    width: 12px;
    height: 12px;
    background-color: var(--primary-light);
    border-radius: 50%;
    position: relative;
    display: inline-block;
}

.logo-pulse::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: var(--primary-light);
    border-radius: 50%;
    animation: pulse 2s infinite ease-out;
    opacity: 0.5;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(3); opacity: 0; }
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
}

.logo p {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.desktop-nav ul {
    display: flex;
    gap: 25px;
    align-items: center;
}

.desktop-nav a {
    font-weight: 700;
    font-size: 0.95rem;
}

.desktop-nav a.active {
    color: var(--primary-color);
}

.desktop-nav a:hover {
    color: var(--primary-light);
}

.btn-submit {
    background-color: #25d366; /* WhatsApp green */
    color: white !important;
    padding: 8px 18px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

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

/* Page Hero */
.hero {
    padding: 60px 0;
    text-align: center;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    color: white;
    margin-bottom: 40px;
    border-bottom-left-radius: 50% 10%;
    border-bottom-right-radius: 50% 10%;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    font-weight: 900;
}

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

/* Category Slider */
.categories-container {
    margin-bottom: 50px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-title h3 {
    font-size: 1.6rem;
    font-weight: 800;
    position: relative;
    padding-bottom: 10px;
}

.section-title h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 4px;
    background-color: var(--primary-light);
    border-radius: 2px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 20px;
}

.category-card {
    background: white;
    padding: 20px;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    border-bottom: 4px solid transparent;
}

.category-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-md);
}

.category-card .icon {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.category-card h4 {
    font-size: 0.9rem;
    font-weight: 700;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.article-card {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

.article-img {
    height: 220px;
    overflow: hidden;
    position: relative;
}

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

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

.category-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--primary-color);
}

.article-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.article-content h3 {
    margin-bottom: 12px;
    font-weight: 800;
    line-height: 1.4;
    font-size: 1.3rem;
}

.article-content p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-footer {
    padding: 20px 25px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.author-info i {
    color: var(--primary-light);
}

.read-more {
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 5px;
}

.read-more i {
    transition: transform 0.3s ease;
}

.article-card:hover .read-more i {
    transform: translateX(-5px);
}

/* Footer */
footer {
    background: white;
    padding: 60px 0 30px;
    border-top: 1px solid #eee;
}

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

.footer-widget h4 {
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 800;
}

.footer-widget p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a:hover {
    color: var(--primary-color);
    padding-right: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #eee;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Mobile Side Nav */
.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: white;
    z-index: 2000;
    padding: 30px;
    box-shadow: -10px 0 20px rgba(0,0,0,0.1);
    transition: 0.4s ease;
}

.mobile-sidebar.open {
    right: 0;
}

.sidebar-header {
    margin-bottom: 30px;
    text-align: left;
}

#closeMenu {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.mobile-sidebar ul li {
    margin-bottom: 20px;
}

.mobile-sidebar ul li a {
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Responsiveness */
@media (max-width: 992px) {
    .hero h2 { font-size: 2rem; }
    .articles-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}

@media (max-width: 768px) {
    .desktop-nav { display: none; }
    .mobile-menu-btn { display: block; }
    .hero { padding: 40px 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
    .hero h2 { font-size: 1.8rem; }
    .section-title h3 { font-size: 1.4rem; }
    .articles-grid { gap: 20px; }
}

/* Modern Search Button - Pill Design */
.search-trigger-btn {
    background: rgba(45, 106, 79, 0.08);
    border: 1.5px solid rgba(45, 106, 79, 0.15);
    padding: 8px 20px;
    border-radius: 100px;
    color: var(--primary-color);
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(5px);
}

.search-trigger-btn::after {
    content: 'بحث ذكي';
    font-size: 0.85rem;
}

.search-trigger-btn i {
    font-size: 1.1rem;
    transition: transform 0.4s;
}

.search-trigger-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 20px rgba(45, 106, 79, 0.2);
}

.search-trigger-btn:hover i {
    transform: rotate(15deg) scale(1.2);
}

.mobile-search-btn {
    display: none; /* Hide on desktop by default */
    width: 45px;
    height: 45px;
    background: rgba(45, 106, 79, 0.08);
    border: 1.5px solid rgba(45, 106, 79, 0.15);
    border-radius: 14px;
    color: var(--primary-color);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

@media (max-width: 768px) {
    .search-trigger-btn { display: none !important; } /* Hide pill button on mobile */
    .mobile-search-btn { display: flex !important; } /* Show small button on mobile */
}

.mobile-search-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: rotate(10deg);
}

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(14, 28, 22, 0.95); /* Deep dark forest green */
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 80px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

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

.search-container {
    width: 100%;
    max-width: 1400px;
    padding: 0 25px;
    text-align: center;
}

.search-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    padding: 10px 10px 10px 40px;
    display: flex;
    align-items: center;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3), 0 0 20px rgba(82, 183, 136, 0.1);
    transition: all 0.3s;
    margin: 0 auto 40px auto;
    max-width: 800px;
}

.search-box:focus-within {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-light);
    box-shadow: 0 0 40px rgba(82, 183, 136, 0.2);
    transform: scale(1.02);
}

.search-icon {
    font-size: 1.8rem;
    color: var(--primary-light);
    margin-left: 20px;
    margin-right: 20px;
}

.search-box input {
    flex: 1;
    border: none;
    background: none;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    outline: none;
    padding: 15px 0;
}

.search-box input::placeholder {
    color: rgba(255,255,255,0.4);
    font-weight: 400;
}

.search-close-btn {
    width: 55px;
    height: 55px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: white;
    font-size: 1.4rem;
    transition: 0.4s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-close-btn:hover {
    background: var(--accent-color);
    transform: rotate(180deg) scale(1.1);
}

.search-results {
    width: 100%;
    display: block;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 10px 5px 60px;
    scrollbar-width: none;
}

.search-results::-webkit-scrollbar { display: none; }

.smart-result-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 25px;
    text-decoration: none;
    color: white;
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
    animation: slideUpFade 0.6s ease forwards;
    opacity: 0;
}

.smart-result-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-10px);
    border-color: var(--primary-light);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.smart-result-item::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-light), var(--primary-color));
    opacity: 0.5;
}

.result-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(82, 183, 136, 0.2), rgba(45, 106, 79, 0.2));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-light);
    margin-bottom: 5px;
}

.result-details h4 {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.4;
    margin-bottom: 8px;
    color: #fff;
}

.result-details p {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.result-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 15px;
}

.result-badge {
    font-size: 0.75rem;
    font-weight: 800;
    background: rgba(255,255,255,0.1);
    padding: 4px 12px;
    border-radius: 50px;
    color: var(--primary-light);
}

.read-arrow {
    font-size: 1.1rem;
    color: var(--primary-light);
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .search-overlay { padding-top: 40px; }
    .search-box { padding: 5px 20px; border-radius: 30px; }
    .search-box input { font-size: 1.1rem; }
    .search-results { grid-template-columns: 1fr; gap: 15px; }
}
