:root {
    --primary-color: #41AED9;
    --secondary-color: #41AED9;
    --accent-color: #e74c3c;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --text-color: #495057;
    --border-radius: 8px;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease-in-out;
}

body {
    font-family: 'Cairo', sans-serif;
    color: var(--text-color);
    background-color: #f9f9f9;
    line-height: 1.6;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
}

/* Global dropdown fix */
.dropdown-menu {
    overflow: hidden !important;
    max-height: 400px !important;
    overflow-y: auto !important;
}

.dropdown-item {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Fix Dropdown Position for Desktop Only */
@media (min-width: 992px) {
    .navbar {
        position: relative !important;
        z-index: 1030 !important;
        overflow: visible !important;
    }

    .navbar .container {
        overflow: visible !important;
    }

    .navbar .dropdown {
        position: relative !important;
        overflow: visible !important;
    }

    .navbar .dropdown-menu {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: auto !important;
        z-index: 9999 !important;
        float: none !important;
        transform: none !important;
        margin-top: 0 !important;
        border: 1px solid rgba(0, 0, 0, 0.15) !important;
        border-radius: 0.375rem !important;
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175) !important;
        background-color: white !important;
        display: none !important;
        overflow: hidden !important;
        min-width: 10rem !important;
        max-width: 250px !important;
        max-height: 400px !important;
        overflow-y: auto !important;
    }

    .navbar .dropdown-menu.show {
        display: block !important;
    }

    .navbar .dropdown-toggle::after {
        display: inline-block !important;
        margin-left: 0.255em !important;
        vertical-align: 0.255em !important;
        content: "" !important;
        border-top: 0.3em solid !important;
        border-right: 0.3em solid transparent !important;
        border-bottom: 0 !important;
        border-left: 0.3em solid transparent !important;
    }

    .navbar-nav {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        flex-wrap: nowrap !important;
        overflow: visible !important;
    }

    .nav-item {
        margin: 7px !important;
        white-space: nowrap !important;
        overflow: visible !important;
    }

    .nav-link {
        overflow: visible !important;
    }

    .dropdown-item {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        padding: 0.5rem 1rem !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    }

    .dropdown-item:last-child {
        border-bottom: none !important;
    }

    .dropdown-item:hover {
        background-color: #f8f9fa !important;
    }

    .dropdown-header {
        font-weight: bold !important;
        color: #6c757d !important;
        padding: 0.5rem 1rem !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
    }

    .dropdown-divider {
        margin: 0.25rem 0 !important;
        border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
    }
}

/* Container and Grid Layout */
.container {
    padding-left: 15px;
    padding-right: 15px;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

.row {
    margin-right: -15px;
    margin-left: -15px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Center cards on all screens */
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* Hero Section */
.service-hero {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.4) 100%),
                url('../img/images/127118.jpg') center/cover no-repeat;
    height: 50vh;
    min-height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    position: relative;
}

.service-hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
    animation: fadeInDown 1s ease;
}

/* Content Section */
.service-content {
    padding: 80px 0;
    background-color: white;
    max-width: 100% !important;
    overflow-x: hidden !important;
}

/* Filter Section */
.filter-section {
    background-color: #ffffff;
    padding: 30px 0;
    margin-bottom: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(65, 174, 217, 0.1);
    max-width: 100% !important;
    overflow-x: hidden !important;
}

.filter-btn {
    margin: 5px;
    border-radius: 50px;
    padding: 8px 20px;
    transition: var(--transition);
}

.filter-btn.active, .filter-btn:hover {
    background-color: var(--secondary-color);
    color: white;
}

/* Bank Cards - Desktop First Approach */
.bank-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(65, 174, 217, 0.1);
    overflow: hidden;
    transition: var(--transition);
    width: 390px; /* Fixed width for desktop */
    margin: 15px;
    margin-bottom: 60px;
    padding: 30px; /* Reduced from 70px to prevent content squeezing */
    height: 100%;
    display: none; /* Initially hide all cards */
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.bank-card.visible {
    display: block; /* Show cards with visible class */
}

.bank-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(65, 174, 217, 0.2);
    border-color: var(--primary-color);
}

.bank-image {
    height: 280px;
    overflow: hidden;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.bank-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.bank-card:hover .bank-image img {
    transform: scale(1.05);
}

.bank-body {
    padding: 20px;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.bank-title {
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--primary-color);
    word-wrap: break-word;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Responsive Adjustments - Mobile */
@media (max-width: 992px) {
    .service-hero {
        height: 45vh;
        min-height: 350px;
    }

    .service-hero h1 {
        font-size: 2.5rem;
    }

    /* Reset dropdown behavior for mobile/tablet */
    .navbar .dropdown-menu {
        position: static !important;
        float: none !important;
        width: 100% !important;
        margin: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background-color: #f8f9fa !important;
    }
}

@media (max-width: 768px) {
    .service-hero {
        height: 40vh;
        min-height: 300px;
    }

    .service-hero h1 {
        font-size: 2rem;
    }

    /* Adjust cards for tablet */
    .bank-card {
        width: calc(50% - 30px); /* Two cards per row */
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .service-hero {
        height: 35vh;
        min-height: 250px;
    }

    .service-hero h1 {
        font-size: 1.8rem;
        padding: 0 15px;
    }

    /* Full width cards on mobile */
    .bank-card {
        width: calc(100% - 30px);
        padding: 15px;
        margin-bottom: 30px;
    }

    .bank-image {
        height: 300px;
    }

    /* Adjust filter buttons for mobile */
    .filter-btn {
        margin: 5px 2px;
        padding: 6px 12px;
        font-size: 12px;
    }

    /* Adjust buttons for mobile */
    .btn {
        padding: 8px 16px;
        font-size: 14px;
        white-space: normal;
    }

    .bank-title {
        font-size: 1.2rem;
    }
}

/* Ensure images don't overflow */
img {
    max-width: 100%;
    height: auto;
    box-sizing: border-box !important;
}

/* Footer fixes for SupportedProjects page */
footer {
    background-color: var(--secondary-color) !important;
    color: white !important;
    position: relative !important;
    overflow: hidden !important;
    padding: 2rem 0 !important;
    margin-top: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

footer:before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(65, 174, 217, 0.1) 0%, rgba(0, 0, 0, 0.9) 100%);
    pointer-events: none;
    z-index: 0;
}

footer .container {
    position: relative;
    z-index: 1;
    max-width: 100% !important;
    overflow-x: hidden !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
}

footer .row {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

footer .col-lg-4,
footer .col-md-6 {
    padding-left: 15px !important;
    padding-right: 15px !important;
}

footer img[src*="arkanlogo.png"] {
    height: 80px !important;
    max-height: 80px !important;
    width: auto !important;
    object-fit: contain !important;
    display: block !important;
}

@media (max-width: 768px) {
    footer {
        padding: 1.5rem 0 !important;
    }

    footer img[src*="arkanlogo.png"] {
        height: 60px !important;
        max-height: 60px !important;
    }
}

@media (max-width: 576px) {
    footer {
        padding: 1rem 0 !important;
    }

    footer img[src*="arkanlogo.png"] {
        height: 50px !important;
        max-height: 50px !important;
    }
}

/* Additional responsive fixes for bank cards */
@media (max-width: 1200px) {
    .bank-card {
        width: calc(33.333% - 30px) !important;
    }
}

@media (max-width: 992px) {
    .bank-card {
        width: calc(50% - 30px) !important;
    }
}

@media (max-width: 576px) {
    .bank-card {
        width: calc(100% - 30px) !important;
        margin: 15px !important;
    }

    .container {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .bank-image {
        height: 250px !important;
    }

    .bank-title {
        font-size: 1.1rem !important;
    }
}
