:root {
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --primary-light: #5eead4;
    --bg-base: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.6);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border: rgba(255, 255, 255, 0.5);
    
    --glass-blur: 24px;
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 25px -3px rgba(0, 0, 0, 0.08);
    
    --font-heading: 'Cairo', sans-serif;
    --font-body: 'Cairo', sans-serif;
}

[data-theme="dark"] {
    --bg-base: #020617;
    --bg-card: rgba(15, 23, 42, 0.6);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border: rgba(255, 255, 255, 0.05);
}

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

body {
    background: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    transition: background 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

/* Background blob effects (2027 style) */
body::before, body::after {
    content: '';
    position: fixed;
    width: 60vw;
    height: 60vw;
    border-radius: 50%;
    z-index: -1;
    filter: blur(100px);
    opacity: 0.15;
    animation: float 20s infinite alternate ease-in-out;
}

body::before {
    background: var(--primary);
    top: -20%;
    right: -10%;
}

body::after {
    background: #3b82f6;
    bottom: -20%;
    left: -10%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-5%, 5%) scale(1.1); }
}

/* Header */
.header-glass {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: var(--shadow-sm);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

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

.brand {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.3s;
}

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

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

/* Alerts */
.diaspora-alert {
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.1), transparent);
    border-right: 4px solid #dc2626;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    backdrop-filter: blur(10px);
}

.diaspora-alert .pulse {
    width: 12px;
    height: 12px;
    background: #dc2626;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

/* Grid Layouts */
.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 3rem 0 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

/* News Cards (2027 Style) */
.news-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    position: relative;
}

.news-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.news-card .img-wrapper {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.news-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.news-card .category-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(13, 148, 136, 0.85);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 700;
    backdrop-filter: blur(4px);
    z-index: 10;
}

.news-card .content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card h3 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s;
}

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

.news-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card .meta {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: transform 0.3s;
}

.theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
}

/* Urgent News Ticker (2027 UI/UX) */
.ticker-wrap {
    width: 100%;
    background: linear-gradient(90deg, #dc2626, #991b1b);
    color: white;
    padding: 0.5rem 0;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-sm);
    z-index: 999;
}

.ticker-heading {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    background: #dc2626;
    color: white;
    font-weight: 800;
    padding: 0.5rem 2rem;
    z-index: 2;
    display: flex;
    align-items: center;
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
}

.ticker-heading::before {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    margin-left: 10px;
    animation: blink 1s infinite alternate;
}

@keyframes blink {
    0% { opacity: 0.3; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.2); }
}

.ticker-move {
    display: inline-flex;
    white-space: nowrap;
    animation: ticker 30s linear infinite;
    padding-right: 150px; /* Space for the heading */
}

.ticker-move:hover {
    animation-play-state: paused;
}

.ticker-item {
    display: inline-block;
    padding: 0 2rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.ticker-item a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

.ticker-item a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

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

/* Ad Spaces */
.ad-space {
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    position: relative;
    overflow: hidden;
}

.ad-space::before {
    content: "مساحة إعلانية";
    font-size: 0.9rem;
    position: absolute;
    top: 5px;
    right: 15px;
    opacity: 0.5;
}

.ad-space.banner {
    width: 100%;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .nav-content {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .brand span {
        font-size: 1.8rem !important;
    }

    .nav-links {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 0.5rem;
        justify-content: flex-start;
        gap: 1.5rem;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .nav-links::-webkit-scrollbar {
        height: 0px;
        background: transparent; /* hide scrollbar for smooth look */
    }

    .section-title {
        font-size: 1.6rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .section-title a {
        font-size: 1rem !important;
    }

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

    .diaspora-alert {
        flex-direction: column;
        text-align: right;
        align-items: flex-start;
    }
}

@keyframes pulseLogo {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

