:root {
    --primary: #6C63FF;
    --primary-dark: #5A52D5;
    --primary-light: #8B85FF;
    --secondary: #FF6584;
    --accent: #00C9A7;
    --bg-primary: #F5F7FA;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F0F2F5;
    --text-primary: #1A1A2E;
    --text-secondary: #555577;
    --text-muted: #8888AA;
    --border: #E0E0EE;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
    --gradient-1: linear-gradient(135deg, #6C63FF, #FF6584);
    --gradient-2: linear-gradient(135deg, #00C9A7, #6C63FF);
    --gradient-3: linear-gradient(135deg, #FF6584, #FFA502);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
}

[data-theme="dark"] {
    --bg-primary: #0F0F1A;
    --bg-secondary: #1A1A2E;
    --bg-card: #16213E;
    --bg-card-hover: #1A2745;
    --text-primary: #FFFFFF;
    --text-secondary: #B0B0C8;
    --text-muted: #6C6C8A;
    --border: #2A2A4A;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] {
    --bg-primary: #F5F7FA;
    --bg-secondary: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F0F2F5;
    --text-primary: #1A1A2E;
    --text-secondary: #555577;
    --text-muted: #8888AA;
    --border: #E0E0EE;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
}

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

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

.bg-animation {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-animation .circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: float 20s infinite ease-in-out;
}

.bg-animation .circle:nth-child(1) {
    width: 400px; height: 400px;
    background: var(--primary);
    top: -100px; right: -100px;
    animation-delay: 0s;
}

.bg-animation .circle:nth-child(2) {
    width: 300px; height: 300px;
    background: var(--secondary);
    bottom: -50px; left: -50px;
    animation-delay: -5s;
}

.bg-animation .circle:nth-child(3) {
    width: 250px; height: 250px;
    background: var(--accent);
    top: 50%; left: 50%;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, -50px) scale(1.1); }
    50% { transform: translate(-30px, 30px) scale(0.9); }
    75% { transform: translate(40px, 40px) scale(1.05); }
}

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    transition: all 0.3s ease;
}

[data-theme="dark"] .header {
    background: rgba(15, 15, 26, 0.85);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon {
    width: 88px;
    height: 88px;
    border-radius: 16px;
    object-fit: contain;
    flex-shrink: 0;
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    position: relative;
}

.header-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.header-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: var(--secondary);
    border-radius: 50%;
    font-size: 10px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.search-container {
    position: relative;
    flex: 1;
    max-width: 500px;
    margin: 0 24px;
}

.search-bar {
    width: 100%;
    padding: 12px 20px 12px 44px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'Tajawal', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
    direction: rtl;
}

.search-bar:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.search-bar::placeholder {
    color: var(--text-muted);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

/* Mobile Search Modal & Button (زر ومربع البحث المنبثق للموبايل) */
.mobile-search-btn {
    display: none;
}

.mobile-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-search-modal.active {
    display: flex;
    opacity: 1;
}

.mobile-search-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.mobile-search-box {
    position: relative;
    z-index: 2;
    width: 100%;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    transform: translateY(-20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-search-modal.active .mobile-search-box {
    transform: translateY(0);
}

.mobile-search-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-search-input-container {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.mobile-search-icon {
    position: absolute;
    right: 14px;
    color: var(--primary);
    font-size: 15px;
    pointer-events: none;
}

.mobile-search-input {
    width: 100%;
    padding: 12px 40px 12px 38px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Tajawal', sans-serif;
    font-size: 15px;
    outline: none;
    direction: rtl;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mobile-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
}

.mobile-search-clear {
    position: absolute;
    left: 10px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-search-cancel-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    font-family: 'Tajawal', sans-serif;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    padding: 8px 4px;
    white-space: nowrap;
}

.mobile-search-tags {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.search-tag-title {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.search-tag-btn {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-tag-btn:hover, .search-tag-btn:active {
    background: var(--gradient-1);
    color: #ffffff;
    border-color: transparent;
}

.layout-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.main-container {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 94px;
    height: fit-content;
    max-height: calc(100vh - 118px);
    overflow-y: auto;
}

.sidebar-section {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.sidebar-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-title i {
    color: var(--primary);
}

.topic-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.topic-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    touch-action: manipulation;
}

.topic-item:hover {
    background: var(--bg-card-hover);
}

.topic-item.active {
    background: rgba(108, 99, 255, 0.1);
    border-color: var(--primary);
}

.topic-item-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topic-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.topic-name {
    font-size: 14px;
    font-weight: 500;
}

.topic-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 10px;
}

.notif-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.notif-toggle:hover {
    background: var(--bg-card-hover);
}

.toggle-switch {
    width: 44px;
    height: 24px;
    background: var(--border);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.toggle-switch.active {
    background: var(--primary);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    top: 3px;
    right: 3px;
    transition: all 0.3s ease;
}

.toggle-switch.active::after {
    right: 23px;
}

.content-area {
    min-width: 0;
}

.breaking-news {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.breaking-label {
    background: var(--secondary);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.ticker-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.ticker-content {
    display: flex;
    gap: 0;
    white-space: nowrap;
    width: max-content;
}

.ticker-item {
    padding: 0 30px;
    font-size: 14px;
    color: var(--text-secondary);
    border-left: 2px solid var(--border);
    cursor: pointer;
    transition: color 0.3s;
    flex-shrink: 0;
}

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

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-title {
    font-size: 22px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title .dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.view-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
}

.view-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 14px;
}

.view-btn.active {
    background: var(--primary);
    color: white;
}

.featured-news {
    margin-bottom: 32px;
}

.featured-slider-container {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 420px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}

.featured-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
    transform: scale(1.02);
    cursor: pointer;
}

.featured-slide.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    z-index: 1;
}

.featured-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 50px 30px 24px;
    background: linear-gradient(transparent, rgba(0,0,0,0.92));
    z-index: 2;
}

.featured-category {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 4px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(108, 99, 255, 0.4);
}

.featured-title {
    font-size: 26px;
    font-weight: 800;
    color: white;
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: rgba(255,255,255,0.75);
    font-size: 13px;
    flex-wrap: wrap;
}

.featured-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.featured-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    opacity: 0;
}

.featured-slider-container:hover .featured-arrow {
    opacity: 1;
}

.featured-arrow:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

.featured-arrow.prev {
    right: 16px;
}

.featured-arrow.next {
    left: 16px;
}

.featured-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.featured-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: all 0.3s ease;
}

.featured-dot.active {
    background: var(--primary);
    width: 22px;
    border-radius: 10px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.news-grid.list-view {
    grid-template-columns: 1fr;
}

.news-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    position: relative;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.news-card-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

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

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

.news-card-category {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(10px);
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.news-card-bookmark {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 34px;
    height: 34px;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 14px;
}

.news-card-bookmark:hover,
.news-card-bookmark.saved {
    background: var(--secondary);
}

.news-card-body {
    padding: 20px;
}

.news-card-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.6;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s;
}

.news-card:hover .news-card-title {
    color: var(--primary);
}

.news-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.news-source {
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-source-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--gradient-1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    font-weight: 700;
}

.news-source-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.news-time {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.list-view .news-card {
    display: grid;
    grid-template-columns: 280px 1fr;
}

.list-view .news-card-image {
    height: 100%;
    min-height: 200px;
}

.list-view .news-card-desc {
    -webkit-line-clamp: 4;
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 20px;
}

.loader {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-muted);
    font-size: 14px;
}

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

.skeleton-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.skeleton-image {
    height: 200px;
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-card-hover) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.skeleton-body {
    padding: 20px;
}

.skeleton-line {
    height: 14px;
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--bg-card-hover) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
    margin-bottom: 10px;
}

.skeleton-line:nth-child(1) { width: 80%; }
.skeleton-line:nth-child(2) { width: 60%; }
.skeleton-line:nth-child(3) { width: 90%; height: 10px; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.notif-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    z-index: 200;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.notif-panel.open {
    right: 0;
}

.notif-panel-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 1;
}

.notif-panel-title {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.notif-close {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.notif-close:hover {
    border-color: var(--secondary);
    color: var(--secondary);
}

.notif-list {
    padding: 16px;
}

.notif-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: all 0.3s;
    border: 1px solid transparent;
    cursor: pointer;
}

.notif-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border);
}

.notif-item.unread {
    background: rgba(108, 99, 255, 0.05);
    border-color: rgba(108, 99, 255, 0.2);
}

.notif-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    color: white;
}

.notif-item-content {
    flex: 1;
    min-width: 0;
}

.notif-item-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notif-item-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.notif-item-time {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
}

.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-body {
    padding: 30px;
}

.modal-category {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 4px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.6;
    margin-bottom: 16px;
}

.modal-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    color: var(--text-muted);
    font-size: 13px;
    flex-wrap: wrap;
}

.modal-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-desc {
    font-size: 15px;
    line-height: 1.9;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 10px 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: 'Tajawal', sans-serif;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(108, 99, 255, 0.05);
}

.modal-btn.primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.modal-btn.primary:hover {
    background: var(--primary-dark);
}

.hamburger-btn {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
}

.hamburger-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

@media (max-width: 1024px) {
    .layout-wrapper {
        display: block;
    }

    .view-toggle {
        display: none;
    }

    .sidebar {
        display: none;
        position: fixed;
        top: 0;
        right: -320px;
        width: 300px;
        height: 100vh;
        z-index: 101;
        background: var(--bg-secondary);
        padding: 20px;
        border-left: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        transition: right 0.3s ease;
        overflow-y: auto;
        max-height: 100vh;
        touch-action: manipulation;
    }

    .sidebar.open {
        display: block;
        right: 0;
        z-index: 9999;
    }

    .hamburger-btn {
        display: flex;
    }

    .search-container {
        margin: 0 8px;
    }
}

@media (max-width: 768px) {
    .header-content {
        height: 60px;
    }

    .logo-text {
        display: none;
    }

    .search-container {
        display: none !important;
    }

    .mobile-search-btn {
        display: flex !important;
    }

    .layout-wrapper {
        padding: 16px;
    }

    .featured-card {
        height: 280px;
    }

    .featured-title {
        font-size: 20px;
    }

    .featured-overlay {
        padding: 24px 16px 16px;
    }

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

    .list-view .news-card {
        grid-template-columns: 1fr;
    }

    .list-view .news-card-image {
        height: 200px;
    }

    .notif-panel {
        width: 100%;
        right: -100%;
    }

    .modal {
        max-height: 90vh;
    }

    .modal-image {
        height: 200px;
    }

    .modal-body {
        padding: 20px;
    }

    .modal-title {
        font-size: 20px;
    }

    .breaking-news {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0 12px;
    }

    .header-actions {
        gap: 4px;
    }

    .header-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .main-container {
        padding: 12px;
    }

    .section-title {
        font-size: 18px;
    }

    /* Agents & Packages Mobile Adjustments */
    .agents-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .agent-card {
        border-radius: var(--radius-sm);
    }

    .agent-image {
        height: 160px;
    }

    .agent-body {
        padding: 16px;
    }

    .agent-name {
        font-size: 16px;
    }

    .agent-actions {
        flex-direction: column;
        gap: 8px;
    }

    .agent-btn {
        width: 100%;
        padding: 11px;
    }

    .packages-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 32px 24px;
    margin-top: 40px;
    position: relative;
    z-index: 1;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-brand h3 {
    font-size: 18px;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-brand p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.footer-copyright {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    opacity: 0.8;
}

.footer-dev {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    opacity: 0.8;
}

.footer-dev strong {
    color: var(--primary);
}

.dev-link {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
}

.dev-link:hover {
    opacity: 0.8;
}

.footer-social {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.social-link:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.social-link i {
    font-size: 18px;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }
}

/* PWA Smart Banner styles */
.pwa-smart-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 500px;
    background: rgba(22, 33, 62, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    transition: all 0.3s ease;
    font-family: 'Tajawal', sans-serif;
    direction: rtl;
}

[data-theme="light"] .pwa-smart-banner {
    background: rgba(255, 255, 255, 0.95);
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.pwa-banner-logo {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: cover;
}

.pwa-banner-text h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 2px 0;
}

.pwa-banner-text p {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin: 0;
}

.pwa-banner-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.pwa-banner-btn:hover {
    background: var(--primary-dark);
}

/* Ad Card styling */
.ad-card {
    border: 2px dashed #25D366 !important;
    background: linear-gradient(180deg, rgba(37, 211, 102, 0.04), rgba(22, 33, 62, 0.95)) !important;
    box-shadow: 0 8px 32px rgba(37, 211, 102, 0.1) !important;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

[data-theme="light"] .ad-card {
    background: linear-gradient(180deg, rgba(37, 211, 102, 0.03), rgba(255, 255, 255, 0.95)) !important;
}

.ad-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 5px;
    background: linear-gradient(90deg, #25D366, var(--primary));
    z-index: 2;
}

.ad-card:hover {
    border-color: #25D366 !important;
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 16px 48px rgba(37, 211, 102, 0.25) !important;
}

/* Custom Page Container */
.custom-page-container {
    animation: fadeIn 0.4s ease;
    padding-top: 10px;
}

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

/* Distinct Neon Ad Cards */
.ad-card.ad-card-reels {
    border: 2px solid var(--secondary) !important;
    background: linear-gradient(180deg, rgba(255, 101, 132, 0.05), var(--bg-card)) !important;
    box-shadow: 0 0 20px rgba(255, 101, 132, 0.15) !important;
}

.ad-card.ad-card-reels::before {
    background: linear-gradient(90deg, var(--secondary), var(--primary));
}

.ad-card.ad-card-reels:hover {
    box-shadow: 0 0 30px rgba(255, 101, 132, 0.3) !important;
    border-color: var(--secondary) !important;
}

/* Reels Video Element Styling */
.reels-container {
    width: 100%;
    aspect-ratio: 9 / 16; /* نسبة 9:16 للفيديو العمودي */
    background: #000;
    position: relative;
    overflow: hidden;
}

.ad-video-element {
    transition: transform 0.5s ease;
}

.news-card:hover .ad-video-element {
    transform: scale(1.03);
}

/* Benefit Button inside Ad Card */
.benefit-btn:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-lg);
}

/* Agents Grid & Cards */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.agent-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

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

.agent-image {
    height: 200px;
    overflow: hidden;
    background: var(--bg-secondary);
}

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

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

.agent-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.agent-name {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.agent-region {
    font-size: 13px;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.agent-address {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.agent-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.agent-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.3s, transform 0.2s;
}

.agent-btn.whatsapp {
    background: #25D366;
    color: white;
}

.agent-btn.whatsapp:hover {
    background: #20ba56;
    transform: scale(1.02);
}

.agent-btn.website {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.agent-btn.website:hover {
    background: var(--border);
    transform: scale(1.02);
}

/* Packages Grid & Cards */
.packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.package-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    position: relative;
}

.package-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 4px;
    background: var(--gradient-1);
}

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

.package-header {
    padding: 24px;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.package-header h3 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.package-price {
    font-size: 28px;
    font-weight: 900;
    color: var(--secondary);
}

.package-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.package-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
    white-space: pre-line;
    flex-grow: 1;
}

.package-duration {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.package-btn {
    background: var(--gradient-1);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: Tajawal, sans-serif;
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: center;
}

.package-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 101, 132, 0.3);
}

/* Modal Agent Item (for Region select) */
.modal-agent-item {
    transition: transform 0.2s;
}
.modal-agent-item:hover {
    transform: translateX(-2px);
}

/* Video ad play button overlay hover effects */
.news-card:hover .play-btn-overlay {
    transform: scale(1.12);
    background: #ffffff !important;
    box-shadow: 0 8px 25px rgba(255, 101, 132, 0.5) !important;
}
.news-card:hover .play-btn-overlay-container {
    background: rgba(0, 0, 0, 0.2) !important;
}
.news-card:hover .play-btn-overlay i {
    color: var(--secondary) !important;
}

/* Illustrative Image Badge (رمز صورة تعبيرية) */
.illustrative-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    z-index: 6;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    font-family: Tajawal, system-ui, sans-serif;
}

.illustrative-badge i {
    font-size: 11px;
    color: #ff6584;
}

.featured-illustrative {
    bottom: 16px;
    left: 16px;
    z-index: 10;
}

.modal-illustrative {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 10;
}

/* Floating Back to Top Button (زر العودة إلى رأس الصفحة) */
.back-to-top-btn {
    position: fixed;
    bottom: 25px;
    left: 25px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-1);
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 8px 25px rgba(108, 99, 255, 0.45);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.8);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    outline: none;
}

.back-to-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.back-to-top-btn:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 12px 30px rgba(108, 99, 255, 0.65);
    background: var(--gradient-2);
}

.back-to-top-btn:active {
    transform: translateY(0) scale(0.95);
}

@media (max-width: 768px) {
    .back-to-top-btn {
        bottom: 20px;
        left: 20px;
        width: 44px;
        height: 44px;
        font-size: 16px;
    }
}

