/* استدعاء خط Cairo الاحترافي من جوجل */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap');

:root {
    /* ألوان الوضع النهاري */
    --bg-color: #f0f4f8;
    --text-color: #2c3e50;
    --card-bg: rgba(255, 255, 255, 0.85);
    --border-color: rgba(255, 255, 255, 0.4);
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --input-bg: #ffffff;
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --card-radius: 16px;
}

[data-theme="dark"] {
    /* ألوان الوضع الليلي */
    --bg-color: #0f172a; 
    --text-color: #f1f5f9;
    --card-bg: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.05);
    --primary-color: #60a5fa;
    --input-bg: #1e293b;
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    transition: background-color 0.4s ease, color 0.4s ease;
    background-image: radial-gradient(circle at top right, rgba(59, 130, 246, 0.05), transparent 40%),
                      radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.05), transparent 40%);
    min-height: 100vh;
}

header {
    text-align: center;
    padding: 30px 20px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.logo-link {
    text-decoration: none;
}

h1 {
    color: var(--primary-color);
    margin: 0 0 15px 0;
    font-size: 2.2rem;
    font-weight: 700;
}

button#themeToggle {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

button#themeToggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    color: var(--primary-color);
}

main {
    max-width: 850px;
    margin: 40px auto;
    padding: 0 20px;
}

/* =========================================
   تنسيقات مربع البحث ونتائج الأسماء
   ========================================= */
.search-box {
    text-align: center;
    margin-bottom: 40px;
}

#searchInput {
    width: 100%;
    max-width: 250px;
    padding: 14px 20px;
    font-size: 18px;
    font-family: 'Cairo', sans-serif;
    border: 2px solid transparent;
    border-radius: 12px;
    outline: none;
    background-color: var(--input-bg);
    color: var(--text-color);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

#searchInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.15);
    transform: translateY(-2px);
}

.result-card {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    padding: 25px;
    margin-bottom: 20px;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

.result-card::before {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--primary-color);
    border-radius: 0 4px 4px 0;
    opacity: 0.8;
}

.result-card h3 {
    margin-top: 0;
    color: var(--primary-color);
    font-size: 24px;
    margin-bottom: 10px;
}

.result-card p {
    font-size: 17px;
    line-height: 1.8;
    margin: 0;
    opacity: 0.9;
}

/* =========================================
   تنسيقات الإعلانات
   ========================================= */
 /* .adsense-slot {
    background: var(--card-bg);
    color: #94a3b8;
    text-align: center;
    padding: 25px 10px;
    margin: 30px auto;
    max-width: 728px;
    border: 2px dashed rgba(148, 163, 184, 0.4);
    border-radius: var(--card-radius);
    font-size: 14px;
    transition: all 0.3s ease;
}*

.in-article-ad {
    margin: 30px 0;
}

/* =========================================
   تنسيقات شبكة المقالات في الصفحة الرئيسية
   ========================================= */
.articles-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.section-title {
    color: var(--primary-color);
    text-align: center;
    font-size: 28px;
    margin-bottom: 30px;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.article-card {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-5px);
    border-color: rgba(59, 130, 246, 0.4);
}

.article-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.article-content h3 {
    color: var(--primary-color);
    font-size: 20px;
    margin: 0 0 15px 0;
    line-height: 1.4;
}

.article-content p {
    font-size: 15px;
    line-height: 1.8;
    opacity: 0.85;
    margin-bottom: 20px;
    flex-grow: 1;
}

.read-more {
    display: inline-block;
    color: #ffffff;
    background-color: var(--primary-color);
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    transition: background-color 0.3s ease;
    align-self: flex-start;
}

.read-more:hover {
    background-color: var(--primary-hover);
}

.article-ad {
    margin: 0; 
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

/* =========================================
   تنسيقات صفحة المقال الكاملة (التي يقرأها الزائر)
   ========================================= */
.full-article-card {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    padding: 40px;
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.article-main-title {
    color: var(--primary-color);
    font-size: 32px;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.publish-date {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.full-article-card h2 {
    color: var(--primary-color);
    margin-top: 35px;
    margin-bottom: 15px;
    font-size: 24px;
}

.full-article-card p {
    font-size: 18px;
    line-height: 2;
    opacity: 0.9;
    margin-bottom: 20px;
}

.back-to-search {
    display: inline-block;
    margin-top: 30px;
    padding: 12px 30px;
    background-color: var(--primary-color);
    color: #ffffff;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.back-to-search:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 60px;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    color: #64748b;
}

/* =========================================
   تنسيقات نافذة الاختيار العشوائي (Modal)
   ========================================= */
.nav-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    font-weight: 600;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--bg-color);
    margin: 10% auto;
    padding: 30px;
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 450px;
    border-radius: 20px;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-btn {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-color);
    opacity: 0.5;
}

.close-btn:hover {
    opacity: 1;
}

.gender-options {
    margin: 25px 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.gender-options label {
    cursor: pointer;
    padding: 10px 20px;
    border-radius: 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.gender-options input[type="radio"] {
    display: none;
}

.gender-options input[type="radio"]:checked + label {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.generate-btn {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    transition: background 0.3s;
}

.generate-btn:hover {
    background: var(--primary-hover);
}

#randomResult {
    margin-top: 30px;
}

#randomResult h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* دعم شاشات الموبايل */
@media (max-width: 600px) {
    .full-article-card {
        padding: 20px;
    }
    .article-main-title {
        font-size: 26px;
    }
    #searchInput {
        padding: 12px 15px;
        font-size: 16px;
    }
}