body {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    -webkit-font-smoothing: antialiased;
}

/* Navbar */
.navbar {
    background-color: var(--navbar-bg) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0.8rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

[data-bs-theme="dark"] .navbar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar-brand {
    font-weight: 700;
    color: var(--md-sys-color-on-surface) !important;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon {
    font-size: 52px;
    line-height: 1;
}

.logo-text-container {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-text {
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
    font-size: 1.8rem;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.logo-text-ar {
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-link {
    font-weight: 500;
    font-size: 1.1rem;
    color: var(--md-sys-color-on-surface) !important;
    border-radius: 8px;
    padding: 0.5rem 1rem !important;
    transition: all 0.2s ease;
    opacity: 0.85;
}

.nav-link:hover,
.nav-link.active {
    background-color: rgba(0, 0, 0, 0.05);
    opacity: 1;
}

[data-bs-theme="dark"] .nav-link:hover,
[data-bs-theme="dark"] .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius-lg);
    background-color: var(--md-sys-color-surface-variant);
    box-shadow: var(--md-sys-elevation-1);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--md-sys-elevation-2);
    transform: scale(1.02);
}

.card-img-top {
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    object-fit: cover;
    height: 220px;
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--md-sys-color-on-surface);
    letter-spacing: -0.3px;
}

.card-text {
    color: var(--md-sys-color-outline);
    line-height: 1.5;
    font-size: 0.95rem;
}

/* Buttons */
.btn-primary {
    background-color: var(--md-sys-color-primary) !important;
    color: var(--md-sys-color-on-primary) !important;
    border: none !important;
    border-radius: 99px;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    box-shadow: none;
    transition: all 0.2s ease;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #996515 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.4) !important;
}

[data-bs-theme="dark"] .btn-primary:hover {
    background-color: #FFD700 !important;
}

/* Bootstrap Color Overrides */
.bg-primary {
    background-color: var(--md-sys-color-primary) !important;
}

.text-primary {
    color: var(--md-sys-color-primary) !important;
}

.border-primary {
    border-color: var(--md-sys-color-primary) !important;
}

.badge.bg-primary {
    background-color: var(--md-sys-color-primary) !important;
}

.progress-bar.bg-primary {
    background-color: var(--md-sys-color-primary) !important;
}

/* Footer */
footer {
    background-color: var(--md-sys-color-surface-variant) !important;
    color: var(--md-sys-color-on-surface);
    margin-top: 4rem;
    padding: 3rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

[data-bs-theme="dark"] footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Social Buttons */
.social-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    /* Optimization: Accessible touch target */
    min-height: 48px;
}

.social-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.social-btn:hover {
    transform: translateY(-3px);
    color: white;
}

.social-btn.facebook {
    background: #1877F2;
}

.social-btn.facebook:hover {
    box-shadow: 0 4px 15px rgba(24, 119, 242, 0.4);
}

.social-btn.whatsapp {
    background: #25D366;
}

.social-btn.whatsapp:hover {
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
}

.social-btn.telegram {
    background: #0088cc;
}

.social-btn.telegram:hover {
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.4);
}

.social-btn.youtube {
    background: #FF0000;
}

.social-btn.youtube:hover {
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.4);
}

/* RTL Fixes */
.rtl {
    direction: rtl;
    text-align: right;
}

.rtl .ms-auto {
    margin-right: auto !important;
    margin-left: 0 !important;
}

/* Custom Flag for Kurdish */
.fi-ku {
    background-image: url('../assets/flags/ku.svg');
    background-size: cover;
    background-position: center;
}

/* Custom Flag for Syria (New) */
.fi-sy-new {
    background-image: url('../assets/flags/sy-new.svg');
    background-size: cover;
    background-position: center;
}

/* Pulsing Animation for glowing effect */
@keyframes pulse-gold {
    0% {
        box-shadow: 0 0 0 0 rgba(218, 165, 32, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(218, 165, 32, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(218, 165, 32, 0);
    }
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

.badge.bg-warning {
    background-color: #FFD700 !important;
    animation: pulse-gold 2s infinite;
    color: #000 !important;
    /* Ensure readable text on gold */
}

/* ========================================= */
/*       DARK MODE GLOBAL TEXT FIXES         */
/* ========================================= */
[data-bs-theme="dark"] body {
    color: var(--md-sys-color-on-surface) !important;
}

[data-bs-theme="dark"] h1,
[data-bs-theme="dark"] h2,
[data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4,
[data-bs-theme="dark"] h5,
[data-bs-theme="dark"] h6,
[data-bs-theme="dark"] .h1,
[data-bs-theme="dark"] .h2,
[data-bs-theme="dark"] .h3,
[data-bs-theme="dark"] .h4,
[data-bs-theme="dark"] .h5,
[data-bs-theme="dark"] .h6 {
    color: var(--md-sys-color-on-surface);
}

[data-bs-theme="dark"] p,
[data-bs-theme="dark"] span,
[data-bs-theme="dark"] div {
    color: inherit;
    /* inherit from body usually works, but specific override below helps */
}

/* Force ".text-dark" to be light in dark mode (Counter-intuitive but necessary for classes used as 'base text') */
[data-bs-theme="dark"] .text-dark:not(.badge):not(.btn) {
    color: var(--md-sys-color-on-surface) !important;
}

[data-bs-theme="dark"] .text-body {
    color: var(--md-sys-color-on-surface) !important;
}

[data-bs-theme="dark"] .text-muted {
    color: #cccccc !important;
}

[data-bs-theme="dark"] .text-secondary {
    color: #cccccc !important;
}

/* Fix for links in dark mode */
[data-bs-theme="dark"] a:not(.btn):not(.nav-link) {
    color: #FFD700;
}

[data-bs-theme="dark"] a:not(.btn):not(.nav-link):hover {
    color: #FFE082;
}

/* Ensure card titles are extremely bright */
[data-bs-theme="dark"] .card-title,
[data-bs-theme="dark"] .card-header {
    color: #FFFFFF !important;
}

/* Fix Input placeholders */
[data-bs-theme="dark"] ::placeholder {
    color: #bbbbbb !important;
    opacity: 1;
    /* Firefox */
}

/* Border adjustments for visibility */
[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-top,
[data-bs-theme="dark"] .border {
    border-color: rgba(255, 255, 255, 0.15) !important;
}

[data-bs-theme="dark"] .bg-white {
    background-color: var(--md-sys-color-surface-variant) !important;
    color: var(--md-sys-color-on-surface) !important;
}

[data-bs-theme="dark"] .bg-light {
    background-color: var(--md-sys-color-surface) !important;
    color: var(--md-sys-color-on-surface) !important;
}

/* Dropdowns & Modals */
[data-bs-theme="dark"] .dropdown-menu {
    background-color: #252422;
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .dropdown-item {
    color: #e0e0e0;
}

[data-bs-theme="dark"] .dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

[data-bs-theme="dark"] .modal-content {
    background-color: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface);
}

[data-bs-theme="dark"] .modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .modal-footer {
    border-top-color: rgba(255, 255, 255, 0.1);
}

/* Form Controls */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #1a1a1a;
    border-color: #444;
    color: #fff;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #222;
    border-color: var(--md-sys-color-primary);
    color: #fff;
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: #666;
}

/* Tables */
[data-bs-theme="dark"] .table {
    color: var(--md-sys-color-on-surface);
    border-color: rgba(255, 255, 255, 0.1);
}

.hover-elevate {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-elevate:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

.text-gradient {
    background: var(--md-sys-color-primary);
    background: linear-gradient(135deg, var(--md-sys-color-primary), var(--md-sys-color-tertiary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}