:root {
    /* Islamic-inspired color palette */
    --primary-green: #2d5f3f;
    --primary-gold: #c9a961;
    --accent-emerald: #1a8b5c;
    --text-dark: #2c3e50;
    --text-light: #ecf0f1;
    --bg-cream: #faf8f3;
    --bg-white: #ffffff;
    --border-gold: #d4af37;
    --shadow: rgba(45, 95, 63, 0.1);
}

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

body {
    font-family: 'Amiri', 'Georgia', serif;
    line-height: 1.8;
    color: var(--text-dark);
    background-color: var(--bg-cream);
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Scheherazade New', 'Times New Roman', serif;
    font-weight: 700;
    margin-bottom: 1.2rem;
    color: var(--primary-green);
}

h1 {
    font-size: 3rem;
    line-height: 1.2;
}

h2 {
    font-size: 2.5rem;
    line-height: 1.3;
}

h3 {
    font-size: 2rem;
}

p {
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
}

a {
    color: var(--primary-green);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--accent-emerald);
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--accent-emerald) 100%);
    box-shadow: 0 4px 20px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    min-width: 180px;
}

.logo {
    height: 50px;
    width: auto;
    animation: fadeIn 1s ease-in;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.logo:hover {
    transform: scale(1.05);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.site-title {
    color: var(--text-light);
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.tagline {
    color: var(--primary-gold);
    font-size: 0.65rem;
    font-style: italic;
    line-height: 1;
    margin: 0;
}

/* Hamburger Menu */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    position: relative;
}

.menu-toggle:hover {
    color: var(--primary-gold);
}

/* Navigation */
nav {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    flex-wrap: nowrap;
    margin: 0;
    padding: 0;
}

nav li {
    position: relative;
}

nav a {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 0.7rem;
    border-radius: 5px;
    transition: all 0.3s ease;
    position: relative;
    white-space: nowrap;
    display: block;
}

/* Dropdown Menu Styles */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--primary-green);
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 0.5rem 0;
    z-index: 1000;
    margin-top: 0.2rem;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu a {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
}

.dropdown-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-gold);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

nav a:hover::after {
    width: 80%;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-gold);
}

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: 0.3rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem;
    border-radius: 20px;
    flex-shrink: 0;
}

.language-switcher button {
    background: transparent;
    border: 2px solid transparent;
    color: var(--text-light);
    padding: 0.2rem 0.5rem;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.language-switcher button:hover,
.language-switcher button.active {
    background: var(--bg-white);
    color: var(--primary-green);
    border-color: var(--primary-gold);
}

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

/* Hero Section */
.hero {
    background: linear-gradient(135deg, rgba(45, 95, 63, 0.95) 0%, rgba(26, 139, 92, 0.95) 100%),
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="50" font-size="80" opacity="0.05">☪</text></svg>');
    background-size: cover, 300px;
    color: var(--text-light);
    padding: 6rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 3rem;
    border-radius: 0 0 50% 50% / 0 0 20px 20px;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(201, 169, 97, 0.1) 0%, transparent 70%);
    animation: pulse 15s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    animation: fadeInUp 1s ease-out;
}

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

.hero h1 {
    color: var(--text-light);
    font-size: 4rem;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--primary-gold);
    font-weight: 400;
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    background: var(--primary-gold);
    color: var(--primary-green);
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(201, 169, 97, 0.3);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(201, 169, 97, 0.5);
    background: var(--border-gold);
}

/* Key Phrases Section */
.key-phrases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 4rem 0;
}

.phrase-card {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 15px;
    border-left: 5px solid var(--primary-gold);
    box-shadow: 0 8px 25px var(--shadow);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.phrase-card::before {
    content: '✦';
    position: absolute;
    top: -20px;
    right: -20px;
    font-size: 100px;
    color: var(--primary-gold);
    opacity: 0.05;
}

.phrase-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(45, 95, 63, 0.2);
    border-left-width: 8px;
}

.phrase-icon {
    font-size: 3rem;
    color: var(--accent-emerald);
    margin-bottom: 1rem;
}

.phrase-card h3 {
    color: var(--primary-green);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.phrase-card p {
    color: var(--text-dark);
    line-height: 1.7;
}

/* Ad Placement Areas */
.ad-container {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border: 2px dashed var(--border-gold);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    margin: 3rem 0;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #666;
    position: relative;
}

.ad-container::before {
    content: 'Advertisement Space';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-gold);
    color: var(--bg-white);
    padding: 0.3rem 1rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Sidebar Ad */
.sidebar-ad {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border: 2px dashed var(--border-gold);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    min-height: 600px;
    position: sticky;
    top: 120px;
}

/* Content Grid with Sidebar */
.content-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    margin: 3rem 0;
}

/* Section Styling */
section {
    margin: 4rem 0;
    animation: fadeInUp 0.8s ease-out;
}

.section-title {
    text-align: center;
    font-size: 2.8rem;
    color: var(--primary-green);
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--primary-gold), transparent);
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin: 3rem 0;
}

.card {
    background: var(--bg-white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px var(--shadow);
    transition: all 0.4s ease;
    border-top: 4px solid var(--primary-gold);
}

.card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 40px rgba(45, 95, 63, 0.25);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--accent-emerald) 100%);
    color: var(--text-light);
    padding: 2rem;
}

.card-header h3 {
    color: var(--text-light);
    font-size: 1.6rem;
}

.card-body {
    padding: 2rem;
}

.card-footer {
    padding: 1.5rem 2rem;
    background: var(--bg-cream);
    border-top: 1px solid rgba(45, 95, 63, 0.1);
}

/* Contact Form */
.contact-form {
    max-width: 700px;
    margin: 3rem auto;
    background: var(--bg-white);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 10px 40px var(--shadow);
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-green);
    font-size: 1.1rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(45, 95, 63, 0.2);
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-cream);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-gold);
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(201, 169, 97, 0.1);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.captcha-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-cream);
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}

.captcha-question {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-green);
}

.captcha-input {
    width: 100px !important;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
}

.submit-button {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--accent-emerald) 100%);
    color: var(--text-light);
    padding: 1.2rem;
    font-size: 1.2rem;
    font-weight: 700;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(45, 95, 63, 0.3);
}

.submit-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(45, 95, 63, 0.4);
}

/* Studies Category */
.studies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.study-item {
    background: var(--bg-white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px var(--shadow);
    transition: all 0.3s ease;
    border-left: 5px solid var(--accent-emerald);
}

.study-item:hover {
    transform: translateX(5px);
    box-shadow: 0 8px 30px rgba(45, 95, 63, 0.2);
}

.study-meta {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-cream);
    font-size: 0.9rem;
    color: #666;
}

.study-date, .study-category {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.study-content {
    padding: 2rem;
}

.study-content h3 {
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.study-excerpt {
    color: var(--text-dark);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.read-more {
    display: inline-block;
    color: var(--accent-emerald);
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border: 2px solid var(--accent-emerald);
    border-radius: 25px;
    transition: all 0.3s ease;
}

.read-more:hover {
    background: var(--accent-emerald);
    color: var(--text-light);
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--accent-emerald) 100%);
    color: var(--text-light);
    padding: 4rem 2rem 2rem;
    margin-top: 5rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-section h3 {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.8rem;
}

.footer-section a {
    color: var(--text-light);
    opacity: 0.9;
    transition: all 0.3s ease;
}

.footer-section a:hover {
    opacity: 1;
    color: var(--primary-gold);
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.95rem;
    opacity: 0.8;
}

/* Arabic RTL Support */
body[dir="rtl"] {
    font-family: 'Amiri', 'Traditional Arabic', serif;
}

body[dir="rtl"] .card,
body[dir="rtl"] .phrase-card {
    border-left: none;
    border-right: 5px solid var(--primary-gold);
}

body[dir="rtl"] .study-item {
    border-left: none;
    border-right: 5px solid var(--accent-emerald);
}

body[dir="rtl"] nav a:hover {
    padding-right: 1.2rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .content-with-sidebar {
        grid-template-columns: 1fr;
    }
    
    .sidebar-ad {
        position: relative;
        top: 0;
        min-height: 250px;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 0.5rem;
        position: relative;
        padding: 0.5rem 1rem;
        align-items: flex-start;
    }
    
    /* Show hamburger menu button */
    .menu-toggle {
        display: block !important;
        position: absolute;
        top: 0.8rem;
        right: 1rem;
        z-index: 1002;
    }
    
    /* CRITICAL: Hide navigation by default on mobile */
    nav {
        width: 100%;
        order: 3;
        display: none !important;
        max-height: 0;
        overflow: hidden;
    }
    
    /* Show navigation ONLY when menu is active */
    nav.active {
        display: block !important;
        max-height: 1000px;
    }
    
    nav ul {
        display: flex !important;
        flex-direction: column;
        gap: 0;
        text-align: center;
        background: rgba(45, 95, 63, 0.98);
        padding: 1rem;
        border-radius: 10px;
        margin-top: 0.5rem;
    }
    
    nav li {
        width: 100%;
        position: relative;
    }
    
    nav a {
        display: block;
        padding: 0.8rem 1rem;
        width: 100%;
        font-size: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    /* Dropdown on mobile - expand vertically */
    .dropdown-menu {
        position: static;
        display: none;
        background: rgba(0, 0, 0, 0.2);
        box-shadow: none;
        margin: 0;
        padding: 0;
    }
    
    .dropdown.active .dropdown-menu {
        display: block;
    }
    
    .dropdown-menu a {
        padding-left: 2rem;
        font-size: 0.9rem;
    }
    
    .logo {
        height: 60px;
    }
    
    .logo-container {
        width: 100%;
        justify-content: flex-start;
    }
    
    .language-switcher {
        order: 2;
        margin-left: 0;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    .key-phrases,
    .cards-grid,
    .studies-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-form {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    
    .logo {
        height: 80px;
    }
    
    .hero {
        padding: 4rem 1rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
}

/* Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.loading {
    animation: shimmer 2s infinite;
    background: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-size: 1000px 100%;
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Print Styles */
@media print {
    header,
    footer,
    .ad-container,
    .sidebar-ad,
    nav {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* Studies Listing Styles */
.studies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.study-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.study-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-gold);
}

.study-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.study-date,
.study-category {
    color: var(--primary-green);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.study-title {
    color: var(--primary-green);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.study-excerpt {
    color: var(--text-dark);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.study-link {
    display: inline-block;
    color: var(--primary-gold);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.study-link:hover {
    color: var(--accent-emerald);
    transform: translateX(5px);
}

.no-studies {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.no-studies p {
    font-size: 1.2rem;
    color: var(--text-dark);
}

@media (max-width: 768px) {
    .studies-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .study-card {
        padding: 1.5rem;
    }
    
    .study-title {
        font-size: 1.3rem;
    }
}

/* ========================================
   Advertisement Styles
   ======================================== */

.ad-container {
    margin: 2rem auto;
    padding: 1rem;
    text-align: center;
    max-width: 100%;
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.horizontal-ad {
    margin: 1.5rem auto;
    max-width: 970px;
}

.vertical-ad {
    margin: 1.5rem auto;
    max-width: 336px;
}

/* Responsive ads */
@media (max-width: 768px) {
    .ad-container {
        padding: 0.5rem;
        margin: 1rem auto;
    }
    
    .horizontal-ad,
    .vertical-ad {
        max-width: 100%;
    }
}

/* Ads inside articles */
article .ad-container {
    margin: 3rem auto;
}

/* Ensure ads don't overflow */
.ad-container ins {
    max-width: 100%;
}
