/* 
   اتحاد الطلبة التشاديين - Premium Official Theme v2
   Refined Colors & Consistent Layout
*/

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

:root {
    /* لوحة الألوان الموحدة */
    --primary-color: #0f172a;
    /* كحلي عميق جداً */
    --primary-light: #1e293b;
    /* كحلي أفتح قليلاً للهوفر */
    --gold-color: #d9a520;
    /* ذهبي متزن */
    --gold-hover: #b4860b;
    /* ذهبي غامق للهوفر */

    --text-main: #1e293b;
    /* لون النصوص الرئيسي */
    --text-muted: #64748b;
    /* لون النصوص الفرعية */
    --bg-body: #f1f5f9;
    /* خلفية الصفحة */
    --bg-white: #ffffff;
    /* خلفية الكروت */

    --border-radius: 12px;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Tajawal', sans-serif;
    /* خط تجوال أكثر عصرية ورسمية من كايرو */
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* --- Header & Top Bar --- */
header {
    background: transparent;
    position: relative;
    z-index: 1000;
}

/* الشريط العلوي */
.top-bar {
    background-color: var(--primary-color);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.contact-info {
    display: flex;
    gap: 20px;
}

.contact-info span i {
    color: var(--gold-color);
    margin-left: 5px;
    /* RTL fix */
}

html[dir="ltr"] .contact-info span i {
    margin-left: 0;
    margin-right: 5px;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.social-mini {
    display: flex;
    gap: 10px;
}

.social-mini a {
    color: white;
    opacity: 0.7;
    transition: var(--transition);
}

.social-mini a:hover {
    opacity: 1;
    color: var(--gold-color);
}

/* Main Nav Wrapper */
.navbar-wrapper {
    background: var(--bg-white);
    box-shadow: var(--shadow-soft);
    position: sticky;
    top: 0;
}

.navbar {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo img {
    height: 80px;
    width: auto;
}

.logo-text {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--primary-color);
    line-height: 1.2;
    max-width: 250px;
    display: inline-block;
}

/* --- Navbar & Dropdown --- */
.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-item {
    position: relative;
    list-style: none;
    /* Ensure no bullets */
}

/* Base Link Style */
.nav-links a {
    color: var(--text-main);
    font-weight: 700;
    font-size: 1rem;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
    text-decoration: none;
}

.nav-links a:hover {
    color: var(--gold-color);
    background: rgba(217, 165, 32, 0.05);
}

/* Dropdown Menu Container */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    /* RTL alignment by default */
    background: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1100;
    padding: 0.5rem 0;
    border-top: 3px solid var(--gold-color);
    list-style: none;
}

/* Show Dropdown on Hover */
.nav-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown Items */
.dropdown-menu li {
    display: block;
    width: 100%;
}

.dropdown-menu a {
    padding: 0.8rem 1.2rem;
    display: block;
    width: 100%;
    border-radius: 0;
    font-size: 0.95rem;
    color: var(--text-main);
    border-bottom: 1px solid #f1f5f9;
}

.dropdown-menu a:last-child {
    border-bottom: none;
}

.dropdown-menu a:hover {
    background: #f8fafc;
    color: var(--primary-color);
    padding-right: 1.5rem;
    /* Slide effect for RTL */
}

/* LTR Adjustments */
html[dir="ltr"] .dropdown-menu {
    right: auto;
    left: 0;
}

html[dir="ltr"] .dropdown-menu a:hover {
    padding-right: 1.2rem;
    padding-left: 1.5rem;
}

/* --- Buttons & Inputs --- */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    /* حواف نصف دائرية بسيطة */
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 2px solid transparent;
    transition: var(--transition);
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

/* Language Switcher in Top Bar */
.lang-switcher-top select {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
}

.lang-switcher-top select option {
    background: var(--primary-color);
    color: white;
}

/* Primary Outline Button for Members */
.btn-primary-outline {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-primary-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* --- Hero Section --- */
.hero {
    min-height: 85vh;
    /* ارتفاع كامل تقريباً */
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.85) 100%), url('../images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    /* تأثير Parallax بسيط */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 0 1rem;
}

.hero-content {
    max-width: 900px;
    animation: fadeInUp 0.8s ease-out;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.hero h1 span {
    color: var(--gold-color);
}

.hero p {
    font-size: 1.4rem;
    margin-bottom: 2.5rem;
    color: #cbd5e1;
    font-weight: 300;
}

/* --- Global Section Styles --- */
section {
    padding: 4rem 1rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    font-weight: 800;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
    margin-bottom: 10px;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--gold-color);
    border-radius: 2px;
}

/* --- About Page Specifics fix --- */
.about-content {
    display: flex;
    align-items: center;
    gap: 4rem;
    margin-bottom: 4rem;
}

.about-text {
    flex: 1;
    text-align: right;
    /* Default for RTL */
}

html[dir="ltr"] .about-text {
    text-align: left;
}

.about-image {
    flex: 1;
}

.about-image img {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Responsive fix for About Page */
@media (max-width: 992px) {
    .about-content {
        flex-direction: column;
        text-align: center;
        gap: 2rem;
    }

    .about-text {
        text-align: center;
    }

    .about-content.reverse {
        flex-direction: column-reverse;
        /* If you have alternating sections */
    }
}


/* --- Grid & Cards Fixes --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    /* Wider cards */
    gap: 2rem;
}

.card {
    background: var(--bg-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(217, 165, 32, 0.3);
    /* حدود ذهبية خفيفة عند الهوفر */
}

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

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

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

.card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--gold-color);
    color: white;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    z-index: 10;
}

html[dir="ltr"] .card-badge {
    right: auto;
    left: 15px;
}

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

.card-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.card h3 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--primary-color);
    line-height: 1.4;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    /* يدفع الزر للأسفل */
}

.card-link {
    color: var(--primary-color);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: auto;
    /* يثبت في الأسفل */
}

.card-link:hover {
    color: var(--gold-color);
    gap: 10px;
}

/* --- Stats Box --- */
.stats-section {
    background-color: var(--primary-color);
    color: white;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    text-align: center;
    gap: 2rem;
}

.stat-item i {
    color: var(--gold-color);
    margin-bottom: 1rem;
    transition: transform 0.3s;
}

.stat-item:hover i {
    transform: scale(1.2);
}

.stat-item h3 {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
}

.stat-item p {
    font-size: 1.1rem;
    opacity: 0.8;
}

/* --- Footer --- */
footer {
    background-color: var(--primary-color);
    color: #e2e8f0;
    margin-top: auto;
    border-top: none;
}

.footer-content {
    padding: 4rem 2rem 2rem;
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 4rem;
}

.footer-logo h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.social-links a {
    background: rgba(255, 255, 255, 0.05);
    width: 45px;
    height: 45px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin-right: 10px;
    font-size: 1.2rem;
}

html[dir="ltr"] .social-links a {
    margin-right: 0;
    margin-left: 10px;
}

.social-links a:hover {
    background: var(--gold-color);
    color: white;
    transform: translateY(-3px);
}

.footer h3 {
    color: var(--gold-color);
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.footer ul li {
    margin-bottom: 10px;
}

.footer ul li a:hover {
    color: var(--gold-color);
    padding-right: 5px;
}

html[dir="ltr"] .footer ul li a:hover {
    padding-right: 0;
    padding-left: 5px;
}

.copyright {
    text-align: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    font-size: 0.9rem;
    color: #94a3b8;
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- MOBILE RESPONSIVE STYLES (تحسينات الجوال) --- */
@media (max-width: 992px) {
    .navbar {
        padding: 1rem;
    }

    .nav-links {
        display: none;
        /* سيتم تفعيلها بزر القائمة لاحقاً إذا أردت جافاسكربت، أو عرضها عمودياً */
        /* حالياً سأجعلها تظهر تحت اللوجو بشكل مرتب */
        display: flex;
        flex-direction: column;
        width: 100%;
        gap: 0;
        background: white;
        position: absolute;
        top: 100%;
        left: 0;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
        padding: 1rem 0;
        /* يمكن إضافة زر Toggle لاحقاً */
    }

    /* عرض الروابط بشكل بسيط للجوال مؤقتاً */
    .nav-links {
        position: static;
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
        box-shadow: none;
        width: auto;
    }

    .navbar {
        flex-direction: column;
        gap: 1rem;
    }

    .logo img {
        height: 60px;
    }
}

@media (max-width: 768px) {

    /* 1. Top Bar Optimization */
    .top-bar-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .contact-info {
        flex-direction: column;
        gap: 5px;
        font-size: 0.8rem;
    }

    /* 2. Hero Section */
    .hero {
        min-height: 60vh;
        background-attachment: scroll;
        /* Parallax breaks on some mobiles */
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    /* 3. Helper Classes for Grids */
    .grid,
    .grid-reps {
        grid-template-columns: 1fr !important;
        /* Force single column */
        gap: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        /* 2 columns for stats is fine */
    }

    /* 4. Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

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

    /* 5. Representatives Page Specifics */
    .filter-bar {
        flex-direction: column;
        padding: 1rem;
    }

    .filter-btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    #searchInput {
        width: 100% !important;
    }

    /* Map Container on Mobile */
    .map-wrapper {
        min-height: 300px;
        overflow-x: scroll;
        /* Allow horizontal scroll for map */
    }

    #turkey-svg {
        min-width: 600px;
        /* Force minimum width to keep map readable */
    }

    /* Adjust Cards */
    .card-img-container {
        height: 180px;
    }

    .rep-card {
        flex-direction: column;
        text-align: center;
        padding: 1.2rem;
    }

    .rep-card img {
        width: 100px !important;
        height: 100px !important;
        margin-bottom: 1rem;
    }
}