/* style.css - النسخة المنظمة الكاملة */

/* ============================================= */
/* 1. VARIABLES & ROOT SETTINGS                 */
/* ============================================= */
:root {
    /* الألوان الأساسية */
    --primary: #384999;
    --secondary: #1A1A1A;
    --accent: #384999;
    --background: #FFFFFF;
    --surface: #f6f6f6;
    --gray: #6C757D;
    --dark-gray: #495057;
    --light-gray: #E9ECEF;
    --white: #FFFFFF;
    --black: #000000;
    --breaking-red: #c22530;
    --breaking-dark: #a01d26;
    
    /* الأحجام */
    --header-height: 100px;
    --header-height-mobile: 110px;
    --bottom-nav-height: 70px;
    --hero-height: 500px;
}

/* ============================================= */
/* 2. GLOBAL RESETS & BASE STYLES               */
/* ============================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', 'Segoe UI', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--background);
    color: var(--secondary);
    direction: rtl;
    padding-bottom: var(--bottom-nav-height);
    line-height: 1.6;
    transition: all 0.3s ease;
}

/* ============================================= */
/* 3. ANIMATIONS & KEYFRAMES                    */
/* ============================================= */
@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        filter: 
            drop-shadow(0 0 10px rgba(255, 255, 255, 0.8))
            drop-shadow(0 0 20px rgba(255, 255, 255, 0.6))
            drop-shadow(0 0 30px rgba(255, 255, 255, 0.4));
    }
    50% {
        transform: translateY(-5px) scale(1.05);
        filter: 
            drop-shadow(0 0 15px rgba(255, 255, 255, 0.9))
            drop-shadow(0 0 30px rgba(255, 255, 255, 0.7))
            drop-shadow(0 0 45px rgba(255, 255, 255, 0.5));
    }
}

@keyframes logoGlow {
    0% {
        filter: 
            drop-shadow(0 0 10px rgba(255, 255, 255, 0.8))
            drop-shadow(0 0 20px rgba(255, 255, 255, 0.6))
            drop-shadow(0 0 30px rgba(255, 255, 255, 0.4))
            drop-shadow(0 0 40px rgba(255, 255, 255, 0.2));
    }
    50% {
        filter: 
            drop-shadow(0 0 20px rgba(255, 255, 255, 1))
            drop-shadow(0 0 40px rgba(255, 255, 255, 0.8))
            drop-shadow(0 0 60px rgba(255, 255, 255, 0.6))
            drop-shadow(0 0 80px rgba(255, 255, 255, 0.4));
    }
    100% {
        filter: 
            drop-shadow(0 0 15px rgba(255, 255, 255, 0.9))
            drop-shadow(0 0 30px rgba(255, 255, 255, 0.7))
            drop-shadow(0 0 45px rgba(255, 255, 255, 0.5))
            drop-shadow(0 0 60px rgba(255, 255, 255, 0.3));
    }
}

@keyframes breakingScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

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

@keyframes slideIn {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================= */
/* 4. UTILITY CLASSES                           */
/* ============================================= */
.fade-in {
    animation: fadeIn 0.8s ease-out;
}

.slide-in {
    animation: slideIn 0.6s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

/* ============================================= */
/* 5. HEADER & LOGO                             */
/* ============================================= */
.app-header {
    background: url('../images/header-bg.jpg') center/cover no-repeat;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    min-height: 180px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-bottom: 3px solid var(--breaking-red);
    text-align: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 150px;
    width: auto;
    max-width: 320px;
    object-fit: contain;
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    animation: 
        logoFloat 4s ease-in-out infinite,
        logoGlow 3s ease-in-out infinite alternate;
    filter: 
        drop-shadow(0 0 12px rgba(255, 255, 255, 0.8))
        drop-shadow(0 0 24px rgba(255, 255, 255, 0.6))
        drop-shadow(0 0 36px rgba(255, 255, 255, 0.4))
        drop-shadow(0 0 48px rgba(255, 255, 255, 0.2));
    position: relative;
    z-index: 2;
}

.site-name {
    font-size: 1.8rem;
    font-weight: 900;
    color: white;
    line-height: 1.2;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.5);
}

.site-tagline {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

/* ============================================= */
/* 6. BREAKING NEWS BAR                         */
/* ============================================= */
.breaking-news-bar {
    background: linear-gradient(90deg, var(--breaking-dark), var(--breaking-red));
    color: white;
    padding: 10px 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(194, 37, 48, 0.2);
}

.breaking-container {
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.breaking-label {
    background: white;
    color: var(--breaking-red);
    padding: 6px 16px;
    border-radius: 25px;
    font-weight: 900;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

.breaking-text {
    flex: 1;
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
    height: 24px;
}

.breaking-scroll {
    display: inline-block;
    animation: breakingScroll 30s linear infinite;
    padding-right: 50px;
    white-space: nowrap;
}

.breaking-item {
    display: inline-block;
    margin-left: 40px;
    padding: 0 10px;
    border-left: 2px solid rgba(255,255,255,0.3);
}

/* ============================================= */
/* 7. SEARCH SECTION                            */
/* ============================================= */
.search-section {
    padding: 0.6rem 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--light-gray);
}

.search-container {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    height: 40px;
}

.search-bar {
    flex: 1;
    background: var(--white);
    border-radius: 12px;
    padding: 0.5rem 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid var(--light-gray);
    transition: all 0.3s ease;
    height: 40px;
}

.search-input {
    border: none;
    background: none;
    outline: none;
    flex: 1;
    font-size: 0.85rem;
    color: var(--secondary);
    width: 100%;
    line-height: 1.2;
}

.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(56, 73, 153, 0.1);
}

.advanced-search {
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 12px;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    height: 40px;
}

.advanced-search:hover {
    background: #2a3a8a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 73, 153, 0.2);
}

/* ============================================= */
/* 8. HERO SLIDER                               */
/* ============================================= */
.hero-slider {
    padding: 0;
    margin: 0 auto;
    max-width: 100%;
    position: relative;
    height: var(--hero-height);
    overflow: hidden;
}

.slider-container {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 0;
    overflow: hidden;
    min-height: auto;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.slider-container:hover {
    transform: scale(1.01);
}

.slider-content {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    color: white;
    z-index: 3;
    text-align: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border-radius: 0;
    margin: 0;
    transform: none;
    top: auto;
}

.slider-content h2 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 0;
    color: white;
    line-height: 1.2;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    padding: 0.8rem 1.5rem;
    display: inline-block;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.slider-image {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
}

.news-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
    transition: all 0.5s ease;
}

.slider-container:hover .news-img {
    transform: scale(1.05);
}

/* Slider Dots */
.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 3;
}

.slider-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

.slider-dot:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.slider-dot.active {
    background: #c22530;
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(194, 37, 48, 0.8);
}

/* ============================================= */
/* 9. CATEGORIES SECTION                        */
/* ============================================= */
.categories-section {
    padding: 0 1.5rem;
    margin: 2.5rem auto;
    max-width: 1200px;
}

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

.section-title {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--black);
    position: relative;
    padding-right: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: var(--primary);
    border-radius: 4px;
}

.section-title i {
    color: var(--primary);
    font-size: 1.4rem;
}

.see-all {
    font-size: 1rem;
    color: var(--primary);
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border: 2px solid var(--primary);
    border-radius: 25px;
    font-weight: 800;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.see-all:hover {
    background: var(--primary);
    color: white;
    transform: translateX(-8px);
    box-shadow: 0 5px 15px rgba(56, 73, 153, 0.3);
}

.see-all .desktop-text {
    display: inline;
}

.see-all .mobile-text {
    display: none;
}

.categories-scroll {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    padding: 1rem 0.5rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin: 0 -0.5rem;
}

.categories-scroll::-webkit-scrollbar {
    display: none;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--secondary);
    flex-shrink: 0;
    min-width: 75px;
    transition: all 0.3s ease;
    position: relative;
}

.category-item:hover {
    transform: translateY(-5px);
}

.category-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--surface), #f0f0f0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.8rem;
    border: 2px solid var(--light-gray);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-item:hover .category-icon {
    background: var(--primary);
    border-color: var(--primary);
    transform: rotate(5deg) scale(1.1);
}

.category-icon::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-item:hover .category-icon::before {
    opacity: 1;
}

.category-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.category-fallback {
    font-size: 1.4rem;
    color: var(--primary);
    transition: all 0.3s ease;
}

.category-item:hover .category-fallback {
    color: white;
    transform: scale(1.2);
}

.category-name {
    font-size: 0.8rem;
    font-weight: 800;
    text-align: center;
    color: var(--dark-gray);
    transition: all 0.3s ease;
    padding: 0 3px;
    line-height: 1.2;
    max-width: 75px;
    word-wrap: break-word;
}

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

/* ============================================= */
/* 10. ADVERTISEMENT SLIDERS - MODIFIED         */
/* ============================================= */
/* Advertisement Container */
.advertisement {
    margin: 2rem auto;
    max-width: 1200px;
    padding: 0 1.5rem;
}

.ad-container {
    background: none;
    border: none;
    border-radius: 12px;
    padding: 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    width: 100%;
}

.ad-content {
    width: 100%;
    height: auto;
    display: block;
}

.ad-content img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Ad Slider Container */
.ad-slider-container {
    background: white;
    border-radius: 15px;
    padding: 15px;
    margin: 15px 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    border: 1px solid #eaeaea;
    max-width: 100%;
    overflow: hidden;
}

/* ============================================= */
/* إعدادات الارتفاع الأساسية                    */
/* ============================================= */
/* السلايدر الأول والثالث - الارتفاع العادي */
.ad-slider-track {
    display: flex;
    transition: transform 0.5s ease, opacity 0.5s ease;
    height: 180px;
    opacity: 1;
}

.ad-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
}

/* ============================================= */
/* السلايدر الثاني - ارتفاع مضاعف 400px        */
/* ============================================= */
#adSlider-middle .ad-slider-track {
    height: 400px !important; /* هذا هو السلايدر الثاني */
}

#adSlider-middle .ad-image {
    height: 400px !important; /* هذا هو السلايدر الثاني */
}
/* ============================================= */
/* السلايدر الأول - زيادة الارتفاع              */
/* ============================================= */
#adSlider-top .ad-slider-track {
    height: 200px !important; /* زدنا من 180px إلى 250px */
}

#adSlider-top .ad-image {
    height: 200px !important; /* زدنا من 200px إلى 250px */
}

.ad-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.ad-slider-title {
    font-weight: 800;
    color: #384999;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ad-slider-controls {
    display: none;
    gap: 10px;
}

.ad-slider-prev,
.ad-slider-next {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #384999;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.ad-slider-prev:hover,
.ad-slider-next:hover {
    background: #2a3a8a;
    transform: scale(1.1);
}

/* Ad Slider Track & Slides */
.ad-slider {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    max-width: 100%;
}

.ad-slide {
    min-width: 100%;
    flex-shrink: 0;
    position: relative;
    height: 100%;
    opacity: 0;
    animation: fadeInSlide 0.8s ease forwards;
}

.ad-slide.active {
    opacity: 1;
}

.ad-link {
    display: block;
    position: relative;
    text-decoration: none;
    color: inherit;
}

.ad-overlay {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    color: white;
    padding: 15px;
    border-radius: 0 0 8px 8px;
    max-height: 60%;
    overflow: hidden;
}

.ad-badge {
    background: #c22530;
    color: white;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 10px;
}

.ad-title {
    font-size: 1rem;
    margin: 0 0 5px 0;
    font-weight: 700;
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Ad Dots */
.ad-slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.ad-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s;
}

.ad-dot.active {
    background: #384999;
    transform: scale(1.2);
}
/* ============================================= */
/* 11. CATEGORY ARTICLES SLIDER                 */
/* ============================================= */
.category-articles-slider {
    margin: 3rem auto 2rem;
    max-width: 1200px;
    padding: 0 1.5rem;
    position: relative;
}

.category-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--light-gray);
    position: relative;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-slider-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: 0;
    width: 80px;
    height: 2px;
    background: var(--primary);
    border-radius: 3px;
}

.category-slider-title {
    font-size: 1.4rem;
    font-weight: 900;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    flex-wrap: wrap;
    align-items: center;
    color: #c22530;
}

.category-slider-title i {
    font-size: 1.2rem;
    transition: all 0.3s ease;
    color: #c22530;
}

.category-badge {
    font-size: 0.8rem;
    color: var(--white);
    background: #c22530;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(194, 37, 48, 0.3);
    margin-right: 5px;
}

.view-all-btn {
    color: #c22530;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0.4rem 0.8rem;
    border: 2px solid #c22530;
    border-radius: 20px;
    transition: all 0.3s ease;
    background: rgba(255,255,255,0.9);
    white-space: nowrap;
}

.view-all-btn:hover {
    background: #c22530;
    color: white;
    transform: translateX(-5px);
    box-shadow: 0 4px 12px rgba(194, 37, 48, 0.4);
}

.view-all-btn .desktop-text {
    display: inline;
}

.view-all-btn .mobile-text {
    display: none;
}

/* Auto Slider Container */
.auto-articles-slider {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 520px;
    border-radius: 15px;
    background: linear-gradient(to bottom, var(--surface), #f9f9f9);
    padding: 4px;
    direction: rtl;
    -webkit-overflow-scrolling: touch;
}

.slider-track {
    display: flex;
    gap: 1rem;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    height: 100%;
    align-items: stretch;
    padding: 4px;
    direction: rtl;
    transform: translateX(0);
    justify-content: flex-start;
    user-select: none;
}

.slider-track:hover {
    transition-duration: 1.2s;
}

/* Auto Slider Controls */
.auto-slider-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-articles-slider:hover .auto-slider-controls {
    opacity: 1;
}

.slider-prev,
.slider-next {
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.slider-prev:hover,
.slider-next:hover {
    background: #c22530;
    transform: scale(1.1);
}

.slider-prev:hover i,
.slider-next:hover i {
    color: white;
}

.slider-prev i,
.slider-next i {
    color: #333;
    font-size: 14px;
}

/* ============================================= */
/* 12. ARTICLE CARD                             */
/* ============================================= */
.article-card {
    flex: 0 0 calc(25% - 0.75rem);
    min-width: calc(25% - 0.75rem);
    max-width: calc(25% - 0.75rem);
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.4s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 500px;
    border: 1px solid rgba(0,0,0,0.05);
    direction: rtl;
    text-align: right;
}

.article-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0,0,0,0.12);
    border-color: rgba(194, 37, 48, 0.15);
}

.article-card:hover .article-title {
    color: #c22530;
}

.article-image-container {
    width: 100%;
    height: 250px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(45deg, #f6f6f6, #eaeaea);
}

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

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

.article-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.article-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 250px;
    background: linear-gradient(to bottom, #ffffff, #fafafa);
    overflow: hidden;
}

.article-title {
    font-size: 1.2rem;
    font-weight: 900;
    margin-bottom: 0.8rem;
    line-height: 1.4;
    color: var(--secondary);
    height: 3.4rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.article-excerpt {
    font-size: 1rem;
    color: var(--dark-gray);
    line-height: 1.6;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    margin-bottom: 1rem;
    min-height: 6rem;
}

/* ============================================= */
/* 13. ARTICLE META DATA                        */
/* ============================================= */
.article-meta {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-top: 1rem;
    border-top: 1px solid rgba(0,0,0,0.05);
    font-size: 0.85rem;
    color: var(--gray);
    flex-wrap: wrap;
    gap: 10px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #666;
    white-space: nowrap;
}

/* Red icons for meta items */
.article-meta i,
.meta-item i,
.article-time i,
.article-views i,
.article-author i,
.article-source i,
.meta-icon {
    color: #e74c3c !important;
    font-size: 0.85rem !important;
    margin-left: 4px;
}

/* Special class for red icons */
.red-icon {
    color: #e74c3c !important;
    font-size: 0.85rem;
    margin-left: 4px;
}

/* ============================================= */
/* 14. BOTTOM NAVIGATION                        */
/* ============================================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0.8rem 0;
    z-index: 1000;
    border-top: 2px solid var(--light-gray);
    box-shadow: 0 -5px 30px rgba(0,0,0,0.15);
    height: var(--bottom-nav-height);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 0.6rem;
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 60px;
    height: 60px;
    position: relative;
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary), #2a3a8a);
    transform: translateY(-15px);
    box-shadow: 0 10px 30px rgba(56, 73, 153, 0.4);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    bottom: -8px;
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--primary);
}

.nav-icon {
    font-size: 1.4rem;
    color: var(--dark-gray);
    transition: all 0.4s ease;
}

.nav-item:hover .nav-icon {
    color: var(--primary);
    transform: scale(1.2);
}

.nav-item.active .nav-icon {
    color: white;
    transform: scale(1.3);
}

.nav-text {
    font-size: 0.8rem;
    color: var(--dark-gray);
    margin-top: 4px;
    font-weight: 800;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.nav-item:hover .nav-text {
    color: var(--primary);
    opacity: 1;
}

.nav-item.active .nav-text {
    color: white;
    opacity: 1;
    transform: translateY(2px);
}

/* ============================================= */
/* 15. DEBUG & TEMPORARY STYLES                 */
/* ============================================= */
.data-source {
    position: fixed;
    bottom: 70px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    z-index: 1000;
}

.ad-slider-track::before {
    content: attr(id);
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px;
    border-radius: 5px;
    font-size: 12px;
    z-index: 1000;
}

.ad-slide::after {
    content: attr(data-ad-id);
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.9);
    color: black;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: bold;
}

/* ============================================= */
/* 16. PRINT STYLES                             */
/* ============================================= */
@media print {
    .app-header, 
    .breaking-news-bar, 
    .search-section, 
    .bottom-nav, 
    .advertisement,
    .ad-slider-container {
        display: none;
    }
    
    body {
        padding: 0;
        background: white;
        color: black;
    }
    
    .article-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}

/* ============================================= */
/* 17. RESPONSIVE DESIGN - LARGE SCREENS        */
/* ============================================= */
@media (min-width: 1400px) {
    .hero-slider, 
    .categories-section, 
    .advertisement, 
    .category-articles-slider,
    .ad-slider-container {
        max-width: 1300px;
    }
}

/* ============================================= */
/* 18. RESPONSIVE DESIGN - DESKTOP (> 1200px)   */
/* ============================================= */
@media (max-width: 1200px) {
    .article-card {
        flex: 0 0 calc(33.333% - 0.8rem);
        min-width: calc(33.333% - 0.8rem);
        max-width: calc(33.333% - 0.8rem);
        height: 460px;
    }
    
    .auto-articles-slider {
        height: 480px;
    }
    
    .article-image-container {
        height: 220px;
    }
    
    .article-title {
        font-size: 1.15rem;
        height: 3.2rem;
    }
    
    .article-excerpt {
        font-size: 0.95rem;
        min-height: 5.5rem;
        -webkit-line-clamp: 3;
    }
}

/* ============================================= */
/* 19. RESPONSIVE DESIGN - TABLETS (> 992px)    */
/* ============================================= */
@media (max-width: 992px) {
    :root {
        --header-height: 110px;
        --bottom-nav-height: 65px;
        --hero-height: 400px;
    }
    
    .logo-img {
        height: 80px;
    }
    
    .article-card {
        flex: 0 0 calc(50% - 0.7rem);
        min-width: calc(50% - 0.7rem);
        max-width: calc(50% - 0.7rem);
        height: 430px;
    }
    
    .article-image-container {
        height: 200px;
    }
    
    .article-title {
        font-size: 1.1rem;
        height: 3rem;
    }
    
    .category-slider-title {
        font-size: 1.3rem;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .category-icon {
        width: 55px;
        height: 55px;
    }
    
    .category-name {
        font-size: 0.75rem;
        max-width: 70px;
    }
    
    .auto-articles-slider {
        height: 450px;
    }
    
    .article-image-container {
        height: 200px;
    }
    
    .article-info {
        padding: 1.3rem;
        min-height: 230px;
    }
    
    .article-title {
        font-size: 1.15rem;
        min-height: 3rem;
    }
    
    .article-excerpt {
        font-size: 0.92rem;
        min-height: 5rem;
        -webkit-line-clamp: 3;
    }
}

/* ============================================= */
/* 20. RESPONSIVE DESIGN - TABLETS (> 768px)    */
/* ============================================= */
@media (max-width: 768px) {
    .auto-articles-slider {
        height: 420px !important;
    }
    
    .article-card {
        height: 400px !important;
        flex: 0 0 calc(50% - 0.5rem) !important;
        min-width: calc(50% - 0.5rem) !important;
        max-width: calc(50% - 0.5rem) !important;
    }
    
    .article-image-container {
        height: 180px !important;
    }
    
    .article-info {
        padding: 1rem !important;
        min-height: 220px;
    }
    
    .article-title {
        font-size: 1rem !important;
        height: 2.6rem !important;
        -webkit-line-clamp: 2;
        margin-bottom: 0.6rem !important;
    }
    
    .article-excerpt {
        font-size: 0.85rem !important;
        line-height: 1.4;
        -webkit-line-clamp: 2 !important;
        margin-bottom: 0.8rem !important;
        min-height: 4rem;
    }
    
    .article-meta {
        font-size: 0.8rem !important;
        padding: 0.7rem !important;
    }
    
    .article-meta i,
    .meta-item i {
        font-size: 0.8rem !important;
    }
    
    .category-slider-title {
        font-size: 1.15rem !important;
    }
    
    .section-title {
        font-size: 1.2rem !important;
    }
    
    /* Ad Sliders Mobile */
    .ad-slider-container {
        padding: 10px;
        margin: 10px 0;
    }
    
    .ad-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}
    
    .ad-image {
        height: 200px !important;
    }
    
    .ad-slider-track {
        height: 200px !important;
    }
    
    .ad-title {
        font-size: 0.9rem;
    }
    
    .ad-badge {
        font-size: 0.7rem;
        padding: 2px 8px;
    }
    
    .ad-slider-prev,
    .ad-slider-next {
        width: 35px;
        height: 35px;
    }
    
    /* Categories Mobile */
    .categories-section .section-title {
        font-size: 1.1rem !important;
    }
    
    .categories-section .section-title i {
        font-size: 1rem !important;
    }
    
    .see-all .desktop-text {
        display: none !important;
    }
    
    .see-all .mobile-text {
        display: inline !important;
    }
    
    .see-all {
        padding: 0.4rem 0.6rem !important;
        min-width: 35px !important;
        justify-content: center;
    }
    
    .see-all i {
        margin: 0 !important;
    }
    
    /* Slider Dots Hidden on Mobile */
    .slider-dots {
        display: none;
    }
}

/* ============================================= */
/* 21. RESPONSIVE DESIGN - PHONES (> 576px)     */
/* ============================================= */
@media (max-width: 576px) {
    :root {
        --header-height: 180px;
        --bottom-nav-height: 55px;
        --hero-height: 300px;
    }
    
    /* Header & Logo */
    .logo-img {
        height: 130px !important;
        width: auto;
        max-width: 320px;
        object-fit: contain;
        display: block;
        margin: 0 auto;
    }
    
    .site-name {
        font-size: 1.8rem;
    }
    
    .site-tagline {
        font-size: 0.9rem;
    }
    
    /* Search */
    .search-section {
        padding: 0.4rem 1rem;
    }
    
    .search-container {
        flex-direction: row;
        gap: 0.3rem;
        height: 36px;
    }
    
    .search-bar {
        width: 70%;
        padding: 0.3rem 0.6rem;
        border-radius: 10px;
        height: 36px;
    }
    
    .search-bar i {
        font-size: 0.75rem;
    }
    
    .search-input {
        font-size: 0.75rem;
        text-shadow: none !important;
    }
    
    .search-input::placeholder {
        font-size: 0.75rem;
        text-shadow: none !important;
    }
    
    .advanced-search {
        width: 30%;
        padding: 0.3rem 0.4rem;
        font-size: 0.75rem;
        justify-content: center;
        text-align: center;
        border-radius: 10px;
        height: 36px;
    }
    
    /* Hero Slider */
    .slider-content {
        padding: 0.8rem;
    }
    
    /* Category Headers */
    .category-slider-header {
        flex-direction: row;
        align-items: center;
        gap: 0.3rem;
        margin-bottom: 1.2rem;
    }
    
    .category-slider-title {
        font-size: 1.1rem !important;
        gap: 5px;
        flex-wrap: nowrap;
    }
    
    .section-title {
        font-size: 1.2rem !important;
    }
    
    /* Article Cards */
    .auto-articles-slider {
        height: 480px !important;
        padding: 8px;
    }
    
    .slider-track {
        gap: 0.8rem;
        padding: 8px;
    }
    
    .article-card {
        flex: 0 0 calc(100% - 0.5rem) !important;
        min-width: calc(100% - 0.5rem) !important;
        max-width: calc(100% - 0.5rem) !important;
        height: 460px !important;
        border-radius: 12px;
    }
    
    .article-image-container {
        height: 220px !important;
        border-radius: 12px 12px 0 0;
    }
    
    .article-info {
        padding: 1rem !important;
        min-height: auto;
        border-radius: 0 0 12px 12px;
        display: flex;
        flex-direction: column;
        flex-grow: 1;
    }
    
    .article-title {
        font-size: 1.05rem !important;
        height: 2.8rem !important;
        margin-bottom: 0.6rem !important;
        line-height: 1.3;
        -webkit-line-clamp: 2;
    }
    
    .article-excerpt {
        font-size: 0.85rem !important;
        line-height: 1.4;
        -webkit-line-clamp: 2 !important;
        margin-bottom: 0.8rem !important;
        color: #666;
        flex-grow: 1;
    }
    
    .article-meta {
        font-size: 0.8rem !important;
        padding: 0.7rem !important;
        margin-top: auto;
        background: #f8f9fa;
        border-radius: 8px;
        border: 1px solid #e9ecef;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .meta-item {
        font-size: 0.7rem;
        gap: 0.3rem;
    }
    
    .meta-item.author,
    .meta-item.source {
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .article-meta i,
    .meta-item i {
        font-size: 0.75rem !important;
    }
    
    /* Bottom Navigation */
    .bottom-nav {
        padding: 0.5rem 0;
        right: 8px;
        left: 8px;
        height: var(--bottom-nav-height);
    }
    
    .nav-item {
        width: 50px;
        height: 50px;
    }
    
    .nav-item.active {
        transform: translateY(-10px);
    }
    
    .nav-icon {
        font-size: 1.2rem;
    }
    
    .nav-text {
        font-size: 0.7rem;
    }
    
    /* Categories */
    .categories-scroll {
        gap: 0.6rem;
        padding: 0.8rem 0.5rem;
    }
    
    .category-item {
        min-width: 70px;
    }
    
    .category-icon {
        width: 55px;
        height: 55px;
        margin-bottom: 0.6rem;
    }
    
    .category-fallback {
        font-size: 1.2rem;
    }
    
    .category-name {
        font-size: 0.7rem;
        max-width: 70px;
        font-weight: 700;
    }
    
    /* View All Button */
    .view-all-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
        min-width: 60px;
        justify-content: center;
    }
    
    .view-all-btn span {
        display: none;
    }
    
    .view-all-btn i {
        margin: 0;
        font-size: 0.8rem;
    }
    
    /* Ad Sliders */
    .ad-slider-container {
        margin: 8px 0;
        padding: 8px;
    }
    
    .ad-image {
        height: 120px !important;
    }
    
    .ad-slider-track {
        height: 120px !important;
    }
    
    .ad-slider-title {
    font-weight: 800;
    color: #384999;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
    
    .ad-title {
        font-size: 0.8rem;
    }
    
    .ad-slider-prev,
    .ad-slider-next {
        width: 30px;
        height: 30px;
    }
}

/* ============================================= */
/* 22. RESPONSIVE DESIGN - SMALL PHONES (> 480px) */
/* ============================================= */
@media (max-width: 480px) {
    .auto-articles-slider {
        height: 440px !important;
    }
    
    .article-card {
        height: 420px !important;
    }
    
    .article-image-container {
        height: 200px !important;
    }
    
    .article-info {
        padding: 0.9rem !important;
    }
    
    .article-title {
        font-size: 1rem !important;
        height: 2.5rem !important;
        -webkit-line-clamp: 2;
        margin-bottom: 0.5rem !important;
    }
    
    .article-excerpt {
        font-size: 0.82rem !important;
        line-height: 1.3;
        -webkit-line-clamp: 2 !important;
        margin-bottom: 0.7rem !important;
    }
    
    .article-meta {
        font-size: 0.78rem !important;
        padding: 0.6rem !important;
    }
    
    .meta-item {
        font-size: 0.78rem;
        gap: 0.2rem;
    }
    
    .meta-item i {
        font-size: 0.85rem !important;
    }
}

/* ============================================= */
/* 23. RESPONSIVE DESIGN - VERY SMALL PHONES (> 360px) */
/* ============================================= */
@media (max-width: 360px) {
    :root {
        --header-height: 140px;
    }
    
    .logo-img {
        height: 110px;
    }
    
    .site-name {
        font-size: 1.4rem;
    }
    
    .search-bar {
        width: 60%;
    }
    
    .advanced-search {
        width: 40%;
    }
    
    .auto-articles-slider {
        height: 420px !important;
        padding: 6px;
    }
    
    .article-card {
        height: 400px !important;
    }
    
    .article-image-container {
        height: 180px !important;
    }
    
    .article-info {
        padding: 0.8rem !important;
    }
    
    .article-title {
        font-size: 0.95rem !important;
        height: 2.3rem !important;
        -webkit-line-clamp: 2;
        margin-bottom: 0.4rem !important;
    }
    
    .article-excerpt {
        font-size: 0.8rem !important;
        -webkit-line-clamp: 2 !important;
        margin-bottom: 0.6rem !important;
        line-height: 1.3;
    }
    
    .article-meta {
        font-size: 0.75rem !important;
        padding: 0.6rem !important;
        flex-direction: column;
        gap: 0.3rem;
        align-items: flex-start;
    }
    
    .meta-item {
        width: 100%;
        justify-content: space-between;
        font-size: 0.75rem;
    }
    
    .meta-item i {
        font-size: 0.8rem !important;
    }
}

/* ============================================= */
/* 24. LANDSCAPE MODE                           */
/* ============================================= */
@media (max-height: 500px) and (orientation: landscape) {
    :root {
        --header-height: 80px;
    }
    
    .app-header {
        background: linear-gradient(rgba(56, 73, 153, 0.85), rgba(56, 73, 153, 0.9)),
                    url('images/beirut-skyline.jpg') center/cover no-repeat;
        flex-direction: row;
        padding: 0.5rem 1rem;
        height: auto;
    }
    
    .logo-container {
        margin-bottom: 0;
        width: auto;
    }
    
    .logo-img {
        height: 70px;
    }
    
    .hero-slider {
        height: 250px;
    }
    
    .slider-container {
        min-height: 180px;
        padding: 0;
    }
    
    .bottom-nav {
        height: 50px;
        padding: 0.4rem 0;
    }
    
    .nav-item {
        width: 45px;
        height: 45px;
    }
    
    .nav-item.active {
        transform: translateY(-8px);
    }
/* ============================================= */
/* 25. RESPONSIVE FOR AD SLIDER 2 (400px)       */
/* ============================================= */

/* على التابلت (768px وما فوق) */
@media (max-width: 768px) {
    #adSlider-middle .ad-slider-track {
        height: 300px !important;
    }
    
    #adSlider-middle .ad-image {
        height: 300px !important;
    }
}

/* على الهواتف (576px وما فوق) */
@media (max-width: 576px) {
    #adSlider-middle .ad-slider-track {
        height: 250px !important;
    }
    
    #adSlider-middle .ad-image {
        height: 250px !important;
    }
}

/* على الهواتف الصغيرة (480px وما فوق) */
@media (max-width: 480px) {
    #adSlider-middle .ad-slider-track {
        height: 200px !important;
    }
    
    #adSlider-middle .ad-image {
        height: 200px !important;
    }
}

/* على الهواتف الصغيرة جداً (360px وما فوق) */
@media (max-width: 360px) {
    #adSlider-middle .ad-slider-track {
        height: 180px !important;
    }
    
    #adSlider-middle .ad-image {
        height: 180px !important;
    }
}

/* الوضع الأفقي */
@media (max-height: 500px) and (orientation: landscape) {
    #adSlider-middle .ad-slider-track {
        height: 150px !important;
    }
    
    #adSlider-middle .ad-image {
        height: 150px !important;
    }

}
.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.08);
    font-size: 13px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #666;
}

/* تنسيق اللوغو */
.site-logo-meta {
    width: 24px;
    height: 24px;
    border-radius: 3px;
    object-fit: contain;
    border: 1px solid #e0e0e0;
    padding: 1px;
    background: white;
}

/* تنسيق اسم الكاتب */
.author {
    font-weight: 600;
    color: #384999;
    font-size: 14px;
}

/* تنسيق المشاهدات */
.views {
    color: #666;
}

.views i {
    color: #d9534f;
    font-size: 12px;
}

/* للشاشات الصغيرة */
@media (max-width: 768px) {
    .article-meta {
        gap: 10px;
        font-size: 12px;
    }
    
    .site-logo-meta {
        width: 20px;
        height: 20px;
    }
    
    .author {
        font-size: 13px;
    }
}