/* ============================================
   MODERN HOMEPAGE STYLES - THEME COLORS
   ============================================ */

:root {
    --theme-primary: #0B7FC4;
    --theme-primary-rgb: 11, 127, 196;
    --theme-secondary: #3E9BD4;
    --theme-accent: #1E93DC;
    --theme-light: #F3F8FC;
    --theme-dark: #152B3F;
}

/* Modern Hero Section with Background Image */
.hero-modern {
    height: 90vh;
    min-height: 700px;
    background: url('../images/background.webp') center/cover no-repeat;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 2rem 0;
}

/* Enable zoom animation only on desktop */
@media (min-width: 768px) {
    .hero-modern {
        animation: zoomEffect 20s infinite alternate;
    }
}

/* Zoom keyframes */
@keyframes zoomEffect {
    0% {
        background-size: 100%;
    }

    100% {
        background-size: 120%;
    }
}

.hero-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(187deg, rgb(96 164 205 / 80%) 0%, rgb(143 186 230 / 70%) 50%, rgb(255 255 255 / 100%) 100%);
    backdrop-filter: saturate(1.1);
}

.hero-modern::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--theme-accent) 0%, var(--gold-light, #B8DFF5) 50%, var(--theme-accent) 100%);
    z-index: 3;
}

.hero-content-wrapper {
    position: relative;
    z-index: 2;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 3rem;
    width: 100%;
}

.hero-text-modern {
    max-width: 800px;
    color: var(--theme-dark);
    margin-top: 4rem;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(11, 127, 196, 0.3);
    color: var(--theme-primary);
    box-shadow: var(--shadow-sm);
}

.hero-badge i {
    margin-right: 0.4rem;
    color: var(--theme-accent);
}

[dir="ltr"] .hero-badge i {
    margin-right: 0;
    margin-left: 0.4rem;
}

.hero-title-modern {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    margin-bottom: 1rem;
    line-height: 1.2;
    text-shadow: 0 2px 14px rgba(21, 43, 63, 0.14);
}

.hero-subtitle-modern {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    margin-bottom: 2.5rem;
    opacity: 0.95;
    line-height: 1.6;
    text-shadow: 0 1px 6px rgba(243, 248, 252, 0.6);
}

.hero-btn-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 0.5rem;
}

.btn-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    box-shadow: var(--shadow-md);
    white-space: nowrap;
    min-width: 160px;
}

.btn-primary-modern {
    background: var(--theme-primary);
    color: white;
    box-shadow: 0 10px 30px rgba(11, 127, 196, 0.35);
}

.btn-primary-modern:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(11, 127, 196, 0.45);
    background: var(--theme-secondary);
}

.btn-outline-modern {
    background: rgba(255, 255, 255, 0.6);
    color: var(--theme-primary);
    border-color: var(--theme-primary);
}

.btn-outline-modern:hover {
    background: var(--theme-primary);
    color: #fff;
    transform: translateY(-3px);
}

/* Hero Stats */
.hero-stats-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 4rem;
}

.stat-card-modern {
    background: rgba(255, 255, 255, 0.78);
    /* More transparent */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(11, 127, 196, 0.14);
    border-top: 1px solid rgba(184, 223, 245, 0.9);
    /* Top highlight */
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    text-align: center;
    color: var(--theme-dark);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy transition */
    box-shadow: 0 8px 32px 0 rgba(11, 127, 196, 0.18);
}

.stat-card-modern:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.95);
}

.stat-card-modern h3 {
    color: var(--theme-primary);
}

.stat-icon-modern {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.stat-card-modern h3 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.stat-card-modern p {
    font-size: 1rem;
    opacity: 0.9;
}

/* Hero Shape Divider */
.hero-shape-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.hero-shape-divider svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 80px;
}

.hero-shape-divider svg path {
    fill: #ffffff;
}

/* Quick Actions Section */
.quick-actions-section {
    padding: 4rem 0;
    background: #F3F8FC;
}

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

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.quick-action-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: transparent;
    /* Handled by gradient border trick if we wanted, but let's stick to shadow for now and a pseudo element */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.quick-action-card {
    background: white;
    padding: 3rem 2rem;
    border-radius: var(--border-radius-lg);
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
}

.quick-action-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.quick-action-card:hover::after {
    transform: scaleX(1);
}

.quick-action-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    transition: all 0.3s ease;
}

.quick-action-card:hover .quick-action-icon {
    transform: scale(1.1) rotate(5deg);
}

.quick-action-card h4 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #152B3F;
}

.quick-action-card p {
    color: #718096;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Modern Services Section */
.services-modern {
    padding: 6rem 0;
    background: white;
}

.section-header-modern {
    text-align: center;
    margin-bottom: 4rem;
}

.section-badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    color: white;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.section-header-modern h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    color: #152B3F;
    margin-bottom: 1rem;
}

.section-header-modern p {
    font-size: 1.1rem;
    color: #718096;
    max-width: 700px;
    margin: 0 auto;
}

.services-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card-modern {
    background: white;
    padding: 3rem 2.5rem;
    border-radius: var(--border-radius-lg);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.service-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.service-card-modern:hover::before {
    transform: scaleX(1);
}

.service-card-modern:hover {
    transform: translateY(-10px);
    border-color: var(--theme-primary);
    box-shadow: 0 20px 50px rgba(11, 127, 196, 0.16);
}

.service-icon-modern {
    width: 90px;
    height: 90px;
    margin: 0 auto 1.5rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    transition: all 0.4s ease;
    position: relative;
}

.service-card-modern:hover .service-icon-modern {
    transform: scale(1.1) rotate(-5deg);
}

/* Gradient variations for service icons - institutional palette */
.gradient-1 {
    background: linear-gradient(135deg, #0B7FC4 0%, #3E9BD4 100%);
}

.gradient-2 {
    background: linear-gradient(135deg, #1E93DC 0%, #0E6DA6 100%);
}

.gradient-3 {
    background: linear-gradient(135deg, #0B4F7A 0%, #0B7FC4 100%);
}

.gradient-4 {
    background: linear-gradient(135deg, #3E9BD4 0%, #5FADE0 100%);
}

.gradient-5 {
    background: linear-gradient(135deg, #0B5E96 0%, #1E93DC 100%);
}

.gradient-6 {
    background: linear-gradient(135deg, #0B7FC4 0%, #1E93DC 100%);
}

.service-card-modern h3 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #152B3F;
    margin-bottom: 1rem;
}

.service-card-modern p {
    color: #718096;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.service-link-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--theme-primary);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    background: #f7fafc;
}

.service-link-modern:hover {
    background: var(--theme-primary);
    color: white;
    transform: translateX(5px);
}

[dir="rtl"] .service-link-modern:hover {
    transform: translateX(-5px);
}

.service-link-modern i {
    transition: transform 0.3s ease;
}

.service-link-modern:hover i {
    transform: translateX(5px);
}

[dir="rtl"] .service-link-modern:hover i {
    transform: translateX(-5px);
}

/* Modern About Section */
.about-modern {
    padding: 6rem 0;
    background: white;
}

.about-grid-modern {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-content-modern h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 800;
    color: #152B3F;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.about-content-modern .lead {
    font-size: 1.2rem;
    color: #4a5568;
    margin-bottom: 1rem;
    line-height: 1.7;
}

.about-content-modern p {
    color: #718096;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.about-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: #edf2f7;
    transform: translateX(10px);
}

.feature-item i {
    color: var(--theme-primary);
    font-size: 1.5rem;
}

.feature-item span {
    font-weight: 600;
    color: #152B3F;
}

.image-wrapper-modern {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.image-wrapper-modern img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.image-wrapper-modern:hover img {
    transform: scale(1.05);
}

.image-overlay-modern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(11, 127, 196, 0.35) 0%, rgba(62, 155, 212, 0.35) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-wrapper-modern:hover .image-overlay-modern {
    opacity: 1;
}

/* Call to Action Section */
.cta-section {
    padding: 5rem 0;
    background: linear-gradient(135deg, #E7F1F9 0%, #DCEBFA 100%);
    border-block: 3px solid var(--theme-accent);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(11,127,196,0.07)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,165.3C1248,171,1344,149,1392,138.7L1440,128L1440,0L1392,0C1344,0,1248,0,1152,0C1056,0,960,0,864,0C768,0,672,0,576,0C480,0,384,0,288,0C192,0,96,0,48,0L0,0Z"></path></svg>') no-repeat top;
    background-size: cover;
}

.cta-content {
    text-align: center;
    color: var(--theme-dark);
    position: relative;
    z-index: 2;
}

.cta-content h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    opacity: 0.95;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    /* Ensure container takes full width */
}

.btn-light-modern {
    background: white;
    color: var(--theme-primary);
}

.btn-light-modern:hover {
    background: #f7fafc;
    transform: translateY(-3px);
}

.btn-outline-light-modern {
    background: transparent;
    color: var(--theme-primary);
    border-color: var(--theme-primary);
}

.btn-outline-light-modern:hover {
    background: var(--theme-primary);
    color: #fff;
}

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

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

@keyframes fade-in-right {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

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

@keyframes fade-in-left {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

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

.animate.fade-in-up {
    animation: fade-in-up 0.8s ease-out forwards;
}

.animate.fade-in-right {
    animation: fade-in-right 0.8s ease-out forwards;
}

.animate.fade-in-left {
    animation: fade-in-left 0.8s ease-out forwards;
}

.animate.delay-1 {
    animation-delay: 0.2s;
    opacity: 0;
}

.animate.delay-2 {
    animation-delay: 0.4s;
    opacity: 0;
}

.animate.delay-3 {
    animation-delay: 0.6s;
    opacity: 0;
}

/* Latest Sections (Ads, Jobs, Tenders) */
.latest-section {
    padding: 6rem 0;
    background: white;
}

.latest-section.bg-light {
    background: #f8f9fa;
}

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

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

.latest-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--theme-primary);
}

.latest-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.latest-card-header i {
    font-size: 2rem;
    color: var(--theme-primary);
}

.latest-date {
    font-size: 0.85rem;
    color: #718096;
    background: #f7fafc;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
}

.latest-badge {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
}

.latest-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #152B3F;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.latest-card p {
    color: #718096;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.latest-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--theme-primary);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.latest-link:hover {
    gap: 1rem;
}

.latest-link i {
    transition: transform 0.3s ease;
}

.latest-link:hover i {
    transform: translateX(5px);
}

[dir="rtl"] .latest-link:hover i {
    transform: translateX(-5px);
}


/* ==========================================================================
   Team Section - Hierarchy & Professional Tree
   ========================================================================== */

.team-section {
    padding: 6rem 0;
    background: linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%);
    position: relative;
    overflow: hidden;
}

.team-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(#cbd5e0 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
    pointer-events: none;
}

.team-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5rem;
    position: relative;
    padding-top: 3rem;
    /* Extra space for top image */
    max-width: 1200px;
    margin: 0 auto;
}

.team-level {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3rem;
    position: relative;
    width: 100%;
    z-index: 2;
}

.team-level:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: -5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 5rem;
    background: linear-gradient(to bottom, var(--theme-primary) 50%, #cbd5e0 100%);
    z-index: 0;
}

.team-level:not(:last-child)::before {
    content: '';
    position: absolute;
    bottom: -5rem;
    left: 50%;
    transform: translate(-50%, 50%);
    width: 12px;
    height: 12px;
    background: white;
    border: 3px solid var(--theme-primary);
    border-radius: 50%;
    z-index: 1;
}

.members-level {
    padding-top: 2rem;
    border-top: 2px solid #cbd5e0;
    width: fit-content !important;
    min-width: 300px;
    margin: 0 auto;
    position: relative;
}

.members-level::before {
    content: '';
    position: absolute;
    top: -2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 2rem;
    background: #cbd5e0;
}

.leadership-level {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 4rem;
    padding-bottom: 2rem;
}

.president-wrapper {
    z-index: 10;
}

.vice-wrapper {
    margin-top: 6rem;
    z-index: 9;
}

/* Global Member Card Style */
.member-card {
    background: white;
    border-radius: 16px;
    overflow: visible !important;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 280px;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(226, 232, 240, 0.6);
    padding: 3.5rem 1.5rem 1.5rem;
    margin-top: 4.5rem;
    text-align: center;
}

.member-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.1);
}

.member-card .card-image {
    height: 100px;
    width: 100px;
    border-radius: 50%;
    margin: -8rem auto 1.5rem;
    position: relative;
    z-index: 2;
    padding: 0;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.member-card .card-image a,
.member-card .card-image img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.member-card h4 {
    color: #152B3F;
    font-weight: 700;
    font-size: 1.15rem;
    margin: 0;
}

.member-card .position {
    display: block;
    color: var(--theme-primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.member-card .bio {
    display: block !important;
    font-size: 0.85rem;
    color: #718096;
    line-height: 1.5;
    margin-bottom: 1.25rem;
    display: -webkit-box !important;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: auto !important;
}

.member-card .social-links-centered {
    margin-top: auto;
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.member-card .social-links-centered a {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f7fafc;
    color: #718096;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.member-card .social-links-centered a:hover {
    background: var(--theme-primary);
    color: white;
    transform: translateY(-2px);
    border-color: var(--theme-primary);
}

/* President Highlights */
.president-wrapper .member-card {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
        linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%) border-box;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
}

.president-wrapper .member-card .position {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%);
    color: white !important;
    padding: 0.2rem 0.75rem;
    border-radius: 50px;
    display: inline-block;
}

/* ==========================================================================
   Team Responsive - Mobile Layout (Max-width: 768px)
   ========================================================================== */

@media (max-width: 768px) {
    .team-section {
        padding: 3rem 0;
    }

    .team-tree {
        padding: 0 1.25rem;
        gap: 1.5rem;
        padding-top: 0;
    }

    .leadership-level {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

    .vice-wrapper,
    .president-wrapper {
        width: 100%;
        margin: 0 !important;
    }

    .team-level::after,
    .team-level::before,
    .members-level::before {
        display: none;
    }

    .members-level {
        border-top: none;
        padding-top: 0;
        width: 100% !important;
        margin: 0;
    }

    .team-level {
        gap: 1rem;
    }

    .member-card {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 1.25rem !important;
        flex-direction: row !important;
        align-items: center;
        text-align: left !important;
        border-radius: 12px;
        margin-top: 0 !important;
        overflow: visible !important;
        /* Critical to prevent trimming */
        flex-wrap: wrap;
        gap: 0 !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05) !important;
    }

    [dir="rtl"] .member-card {
        text-align: right !important;
    }

    .member-card .card-image {
        width: 65px !important;
        height: 65px !important;
        margin: 0 !important;
        margin-right: 1.25rem !important;
        flex-shrink: 0 !important;
        position: static !important;
        padding: 0 !important;
        border-radius: 50% !important;
        overflow: hidden !important;
    }

    [dir="rtl"] .member-card .card-image {
        margin-right: 0 !important;
        margin-left: 1.25rem !important;
    }

    .member-card .card-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border-radius: 50% !important;
        display: block !important;
    }

    .member-card .card-body {
        padding: 0 !important;
        text-align: inherit !important;
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    /* Name & Role Side-by-Side */
    .member-card .card-body>div:first-child {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
    }

    .member-card h4 {
        font-size: 1.05rem !important;
        margin: 0 !important;
        display: inline-block;
        line-height: 1.2;
    }

    .member-card .position {
        font-size: 0.75rem !important;
        margin: 0 !important;
        display: inline-block;
        vertical-align: middle;
    }

    .team-section .president-wrapper .member-card .position {
        padding: 0.15rem 0.6rem !important;
        margin-left: 0.25rem !important;
        background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-secondary) 100%) !important;
        color: #ffffff !important;
        border-radius: 50px !important;
    }

    /* Bio Below Them */
    .member-card .bio {
        display: -webkit-box !important;
        width: 100%;
        order: 2;
        margin: 0.75rem 0 0.5rem 0 !important;
        font-size: 0.8rem !important;
        line-height: 1.4 !important;
        -webkit-line-clamp: 4 !important;
        line-clamp: 4 !important;
        -webkit-box-orient: vertical !important;
        color: #4a5568 !important;
        overflow: visible !important;
        visibility: visible !important;
    }

    .member-card .social-links-centered {
        justify-content: flex-start !important;
        margin-top: 0.25rem !important;
        width: 100%;
        order: 3;
    }

    [dir="rtl"] .member-card .social-links-centered {
        justify-content: flex-start !important;
    }

    .member-card .social-links-centered a {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.8rem !important;
        border: 1px solid #e2e8f0 !important;
    }
}

/* Utility Classes */
.mt-4 {
    margin-top: 2rem;
}

.mt-5 {
    margin-top: 3rem;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .hero-modern {
        min-height: auto;
        height: auto;
        padding: 6rem 0 4rem;
        overflow: visible;
    }

    .hero-content-wrapper {
        padding: 0 1.5rem;
        overflow: visible;
    }

    .hero-stats-modern {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .services-grid-modern {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .latest-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .about-grid-modern {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-image-modern {
        order: -1;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn-modern {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }

    .cta-content h2 {
        font-size: 2rem;
    }

    .cta-buttons .btn-modern {
        width: 100%;
        /* Full width buttons on mobile */
        max-width: none;
    }
}

@media (max-width: 480px) {

    .hero-stats-modern,
    .latest-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Quick Actions grid handled by mobile-list-cards.css */
    .quick-actions-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }


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

    .service-card-modern,
    .latest-card {
        padding: 2.5rem 2rem;
        border-radius: 20px;
    }

    /* Hide subtext descriptions on mobile for cleaner look */
    .service-card-modern p,
    .latest-card p {
        display: none;
    }

    .stat-card-modern {
        padding: 1.5rem;
        margin-bottom: 0.5rem;
    }

    /* Make buttons full width on small screens */
    .hero-btn-group {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }

    .btn-modern {
        width: 100%;
        padding: 1rem;
        /* Larger touch target */
        display: flex;
        /* Ensure it behaves as block-like for width */
        max-width: none;
        /* remove any desktop constraints */
    }

    /* Specifically target section footer buttons (Show all...) */
    .text-center .btn-modern,
    .services-modern .text-center a,
    .latest-section .text-center a {
        width: 100% !important;
        display: flex !important;
        margin-top: 1rem;
    }

    .hero-title-modern {
        font-size: 2.5rem;
        /* Readable hero title */
    }
}

/* Enhancements for better mobile readability */
@media (max-width: 768px) {
    .section-header-modern h2 {
        font-size: 2.2rem;
        margin-bottom: 0.5rem;
    }

    .section-header-modern p {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .service-card-modern h3,
    .latest-card h3 {
        font-size: 1.4rem;
    }

    .services-modern,
    .quick-actions-section,
    .about-modern,
    .latest-section {
        padding: 4rem 0;
    }
}

/* RTL Support */
[dir="rtl"] .feature-item:hover {
    transform: translateX(-10px);
}

[dir="rtl"] .animate.fade-in-right {
    animation: fade-in-left 0.8s ease-out forwards;
}

[dir="rtl"] .animate.fade-in-left {
    animation: fade-in-right 0.8s ease-out forwards;
}

/* Mobile Button Styles */
@media (max-width: 576px) {
    .hero-btn-group {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }

    .btn-modern {
        width: 100%;
        min-width: auto;
        padding: 1rem 2rem;
        font-size: 1rem;
    }

    .hero-text-modern {
        margin-top: 2rem;
    }
}

@media (min-width: 577px) and (max-width: 768px) {
    .hero-btn-group {
        gap: 0.75rem;
    }

    .btn-modern {
        flex: 1;
        min-width: 140px;
    }
}