/* NAVBAR & DROPDOWN GLOBAL OVERRIDES (no Bootstrap blue, no transforms) */
.navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
}

.navbar-nav .nav-link:focus,
.navbar-nav .nav-link:active {
  color: #ffffff !important;
  outline: none !important;
  box-shadow: none !important;
}

.navbar-nav .nav-link.active,
.navbar-nav .nav-link.show {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.22) !important;
}

.dropdown-item {
  color: #2d3748 !important;
}

.dropdown-item:active,
.dropdown-item.active,
.dropdown-item.active:hover,
.dropdown-item.active:focus {
  background: rgba(57, 181, 74, 0.18) !important;
  color: #1a202c !important;
  box-shadow: none !important;
}

/* CSS for hover pop up effect */
.hover-pop-up:hover {
  transform: scale(1.05); /* Scales the card to 105% of its original size */
  transition: transform 0.3s ease; /* Smooth transition effect */
  z-index: 10; /* Ensure the scaled element is above the others */
}

/* Reset the scale to normal when not hovered */
.hover-pop-up {
  transform: scale(1); /* Default scale */
  transition: transform 0.3s ease; /* Smooth transition effect */
}

/* CSS for projects card  starts*/
.project-card {
    width: 100%; /* Adjust based on layout needs */
    display: flex;
    flex-direction: column;
    border-radius: 15px; /* Rounded corners for the card */
    overflow: hidden; /* Ensures content does not overflow the card's boundaries */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* Soft shadow for depth */
    transition: transform 0.3s ease, box-shadow 0.3s ease; /* Smooth transitions for hover effects */
}
.project-card:hover {
    transform: translateY(-5px); /* Slight lift effect on hover */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2); /* Deeper shadow on hover for emphasis */
}
.project-image img {
    width: 100%; /* Ensure the image covers the width */
    height: 200px; /* Fixed height for consistency */
    object-fit: cover; /* Cover the container without losing aspect ratio */
}

.card-title {
    font-size: 1.25rem; /* Increased font size */
    color: #333; /* Darker color for better contrast */
    font-weight: 700; /* Bold font weight for title */
    margin-bottom: 0.5rem; /* Spacing below the title */
    text-align: center;
}

.card-text {
    font-size: 0.9rem; /* Adjusted font size for description */
    color: #666; /* Slightly lighter color for description */
    margin-bottom: 1rem; /* Increased space below the description */
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limits the text to 3 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.project-divider {
    border: none;
    height: 1px;
    background-color: #e0e0e0; /* Light grey color for the horizontal rule */
    margin: 10px 0; /* Spacing above and below the horizontal rule */
}

.project-intentions {
    display: flex; /* Align intentions horizontally */
    justify-content: center; /* Center intentions */
    flex-wrap: wrap; /* Wrap to next line if needed */
    margin: 10px 0; /* Spacing around intentions block */
}

.intention {
    margin: 0 5px; /* Spacing between intentions */
    color: #555; /* Text color for intentions */
    display: inline; /* Ensure intentions are in line */
}

/* Color coding for intentions */
.intention.sadaqah { color: #5cb85c; }
.intention.zakat { color: #d9534f; }
.intention.lilah { color: #f0ad4e; }
.intention.other { color: #5bc0de; }

.donate-now-btn {
    text-align: center;
    padding: 10px 20px;
    border-radius: 20px;
    background-color: #1f7a2e;
    color: white;
    font-weight: bold;
    border: none;
    transition: background-color 0.3s ease;
}
.donate-now-btn:hover {
    background-color: #00876f;
    cursor: pointer;
}

.card-link {
    text-decoration: none;
    color: inherit;
}

.card-link:hover .project-card {
    box-shadow: 0 4px 8px rgba(0,0,0,0.2); /* Optional: Highlight card on hover */
}

.btn-block {
    z-index: 2; /* Ensure the button is clickable over the card-link */
}

/* CSS for projects card end*/

/* header 100% stat starts */
.donation-policy-statement {
    color: #dddddd; /* Light gray text for contrast */
    font-size: 12px;
    font-weight: 800;
    margin-left: 25px;
    padding: 10px 20px;
    border: 1px solid #4CAF50;
    border-radius: 25px;
    background: linear-gradient(145deg, #2C2C2C, #1A1A1A); /* Dark gray gradient background */
    box-shadow: 0 0 15px #4CAF50, inset 0 0 5px #388E3C;
    font-family: 'Arial', sans-serif;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: inline-block;
    transition: all 0.3s ease;
}

.donation-policy-statement:hover {
    background: linear-gradient(145deg, #1A1A1A, #2C2C2C); /* Darker gradient on hover */
    color: #ffffff; /* White text for hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* header 100% stat ends */

/* Footer starts */
footer.bg-dark {
    background-color: #121212; /* Dark background color */
}

/* General footer styles */
footer.bg-dark .footer-logo img {
    max-height: 50px; /* Logo size */
    margin-bottom: 15px;
}

footer.bg-dark .donation-policy {
    text-align: center; /* Center policy text */
}

footer.bg-dark .footer-description {
    color: #CCCCCC; /* Light gray text for readability */
    font-size: 0.875rem; /* Smaller font size */
    margin-bottom: 15px; /* Consistent spacing */
    text-align: center; /* Center description */
}

footer.bg-dark .social-links a {
    font-size: 1.25rem; /* Icon size */
    color: #DDDDDD; /* Light gray icons */
    margin: 0 10px; /* Space between icons */
}

footer.bg-dark .social-links a:hover {
    color: #4CAF50; /* Green color on hover */
}

footer.bg-dark .footer-quick-links h4,
footer.bg-dark .footer-contact-info h4 {
    color: #FFFFFF; /* White text for titles */
    margin-bottom: 1rem; /* Space below titles */
}

footer.bg-dark .footer-quick-links ul,
footer.bg-dark .footer-contact-info p {
    color: #DDDDDD; /* Light gray text */
    font-size: 0.9rem; /* Smaller font size */
}

footer.bg-dark .footer-quick-links ul li,
footer.bg-dark .footer-appeals ul li {
    margin-bottom: 0.5rem; /* Adds spacing between list items */
}

footer.bg-dark .footer-quick-links ul li a,
footer.bg-dark .footer-appeals ul li a,
footer.bg-dark .footer-contact-info p a {
    color: #DDDDDD; /* Light gray links */
    text-decoration: none; /* No underline */
    transition: color 0.3s ease; /* Smooth color transition for hover */
}

footer.bg-dark .footer-quick-links ul li a:hover,
footer.bg-dark .footer-appeals ul li a:hover,
footer.bg-dark .footer-contact-info p a:hover {
    color: #4CAF50; /* Green color on hover */
}

footer.bg-dark .footer-contact-info p {
    display: flex; /* Flexbox for aligning icons with text */
    align-items: center; /* Center items vertically */
    gap: 0.5rem; /* Space between icon and text */
}

/* Responsiveness */
@media (max-width: 768px) {
    footer.bg-dark .row {
        flex-direction: column; /* Stack columns vertically on small screens */
    }

    footer.bg-dark .col-md-6 {
        margin-bottom: 1rem; /* Add space between stacked columns */
    }
}

/* Adjust the footer bottom text with proper alignment and styling */
footer.bg-dark .copyright-info {
    color: #AAAAAA; /* Light gray text */
    font-size: 0.75rem; /* Smaller font size for footer bottom text */
    letter-spacing: 1px; /* Space out the letters slightly */
    padding: 20px 0 10px; /* Padding top and bottom */
    border-top: 1px solid #333333; /* Line above footer text */
    margin-top: 10px; /* Space between content and bottom text */
}

footer .donation-policy {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align content to the left */
}

footer .donation-policy .donation-policy-statement {
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 600;
    margin-left: 0; /* Remove additional left margin within the footer */
    padding: 8px 15px;
    border: 1px solid #4CAF50;
    border-radius: 15px;
    background: linear-gradient(145deg, #66bb6a, #43a047);
    box-shadow: 0 0 15px #4CAF50, inset 0 0 5px #388E3C;
    font-family: 'Arial', sans-serif;
    letter-spacing: 0.75px;
    text-transform: uppercase;
    display: block; /* Change to block to fill the flex container */
    transition: all 0.3s ease;
    align-self: flex-start; /* Align to the start of the flex container */
}

footer .donation-policy .donation-policy-statement:hover {
    background: linear-gradient(145deg, #43a047, #66bb6a);
    color: #E8F5E9;
    box-shadow: 0 0 20px #81C784, inset 0 0 10px #388E3C;
}

/* Footer ends */

/* Enhanced Mobile Dropdown Behavior */
@media (max-width: 991.98px) {
    /* Disable hover effects on mobile */
    .dropdown:hover .dropdown-menu {
        display: none !important;
    }
    
    /* Mobile navbar improvements */
    .navbar-collapse {
        background: rgba(15, 59, 28, 0.98);
        margin: 15px -15px -12px -15px;
        padding: 25px 20px;
        border-radius: 16px;
        margin-top: 15px;
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 9999 !important;
        position: relative;
        overflow: visible !important;
    }

    /* Mobile nav links */
    .navbar-nav .nav-link {
        padding: 12px 16px;
        font-size: 1rem;
        color: white !important;
        border-radius: 10px;
        margin-bottom: 6px;
        white-space: normal !important;
        transition: all 0.2s ease;
        font-weight: 500;
    }

    .navbar-nav .nav-link:hover {
        background: rgba(255,255,255,0.12);
    }

    /* Ensure dropdown containers are visible */
    .navbar-nav .dropdown {
        overflow: visible !important;
        position: relative !important;
    }

    .navbar-nav .nav-item {
        overflow: visible !important;
        position: relative !important;
    }

    /* SIMPLE MOBILE DROPDOWN  */
    .dropdown-menu {
        background: rgba(255,255,255,0.98) !important;
        border: none !important;
        border-radius: 12px !important;
        box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
        margin-top: 8px !important;
        width: 100% !important;
        padding: 15px !important;
        z-index: 9999 !important;
        /* FORCE THESE VALUES */
        position: static !important;
        float: none !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
        display: none !important;
    }

    /* WHEN DROPDOWN IS OPEN - FORCE IT TO SHOW */
    .dropdown-menu.show {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: static !important;
        float: none !important;
        width: 100% !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        transform: none !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    /* MOBILE DROPDOWN BRUTE FORCE */
    @media (max-width: 991px) {
        .dropdown-menu[style*="display: block"] {
            display: block !important;
            visibility: visible !important;
            opacity: 1 !important;
            animation: forceShow 0.01s forwards !important;
        }
        
        .dropdown-menu.show {
            animation: forceShow 0.01s forwards !important;
        }
    }
    
    /* FORCE IMMEDIATE VISIBILITY */
    @keyframes forceShow {
        0% { 
            display: block !important;
            visibility: visible !important;
            opacity: 1 !important;
        }
        100% { 
            display: block !important;
            visibility: visible !important;
            opacity: 1 !important;
        }
    }

    .dropdown-item {
        padding: 14px 16px !important;
        border-radius: 8px !important;
        margin-bottom: 4px !important;
        font-size: 0.95rem !important;
        font-weight: 500 !important;
        transition: all 0.2s ease !important;
        color: #2d3748 !important;
        min-height: 48px !important;
        display: flex !important;
        align-items: center !important;
        text-decoration: none !important;
    }

    .dropdown-item:hover,
    .dropdown-item:focus {
        background: rgba(57, 181, 74, 0.1) !important;
        color: #1a202c !important;
        text-decoration: none !important;
    }

    .dropdown-item:active {
    background: rgba(57, 181, 74, 0.15) !important;
}

.dropdown-item.active,
.dropdown-item.active:hover,
.dropdown-item.active:focus {
    background: rgba(57, 181, 74, 0.2) !important;
    color: #1a202c !important;
    font-weight: 600 !important;
    }

    /* BULLETPROOF MOBILE OPEN STATE */
    .dropdown-menu.mobile-open {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: static !important;
        float: none !important;
        width: 100% !important;
        background: white !important;
        border: 1px solid #ddd !important;
        border-radius: 8px !important;
        margin-top: 8px !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
        z-index: 9999 !important;
        max-height: none !important;
        overflow: visible !important;
        animation: none !important;
        transition: none !important;
        transform: none !important;
        left: auto !important;
        right: auto !important;
        top: auto !important;
    }

    /* User controls spacing on mobile */
    .navbar-nav.ms-auto {
        padding-top: 15px;
        border-top: 2px solid rgba(255,255,255,0.2);
        margin-top: 25px;
        padding-top: 25px;
    }
    
    .navbar-nav.ms-auto .nav-item {
        margin-bottom: 10px;
        text-align: center;
    }

    .basket-link,
    .account-link {
        justify-content: center !important;
    }

    /* Mobile donate button */
    .donate-btn {
        background: linear-gradient(135deg, #1f7a2e, #1f7a2e) !important;
        color: white !important;
        border: none !important;
        padding: 14px 20px !important;
        border-radius: 20px !important;
        font-weight: 600 !important;
        font-size: 1rem !important;
        box-shadow: 0 4px 15px rgba(57, 181, 74, 0.3) !important;
        transition: all 0.2s ease !important;
        text-align: center;
        width: 100%;
        margin-top: 15px;
    }

    .donate-btn:hover {
        box-shadow: 0 5px 18px rgba(57, 181, 74, 0.4) !important;
    }
    
    /* Hide donation policy badge on mobile */
    .donation-policy-badge {
        display: none !important;
    }
    
    /* Improve navbar brand spacing on mobile */
    .navbar-brand-container {
        margin-right: 15px !important;
    }
    
    /* Improve mobile toggle button */
    .navbar-toggler {
        padding: 6px 10px !important;
        margin-left: 10px;
    }
}

/* Extra small devices */
@media (max-width: 575.98px) {
    .navbar-brand img {
        height: 50px !important;
    }
    
    .navbar-toggler {
        padding: 4px 8px !important;
    }
    
    .nav-icon-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.8rem !important;
    }
    
    .donate-nav-btn {
        padding: 6px 12px !important;
        font-size: 0.85rem !important;
    }
}

/* Desktop styles - Professional without bouncing */
@media (min-width: 992px) {
    .dropdown-item {
        padding: 12px 15px;
        border-radius: 8px;
        transition: all 0.2s ease;
        font-size: 0.95rem;
    }

    .dropdown-item:hover {
        background: rgba(57, 181, 74, 0.1);
    }

    .navbar-nav .nav-link:hover {
        color: #1f7a2e !important;
        transition: all 0.2s ease;
    }

    .navbar-nav .nav-link {
        transition: all 0.2s ease;
        border-radius: 8px;
    }

    .navbar-nav .nav-link:hover {
        background: rgba(255,255,255,0.1);
    }
    
    /* Enhanced dropdown behavior for desktop */
    .dropdown {
        position: relative;
    }

    .dropdown:hover .dropdown-menu {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .dropdown-menu {
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: all 0.3s ease;
        position: absolute;
        z-index: 1000;
    }

    .dropdown:hover .dropdown-menu {
        transition-delay: 0s;
    }

    .dropdown-menu:hover {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .dropdown::before {
        content: '';
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        height: 10px;
        background: transparent;
        z-index: 999;
    }
}

.dropdown-item i {
    width: 20px;
    text-align: center;
}

.basket-icon.active {
    color: #1f7a2e !important;
}

.dropdown-toggle::after {
    margin-left: 0.5em;
}

.navbar-nav .nav-link,
.dropdown-item {
    transition: all 0.2s ease;
}

.dropdown-menu {
    z-index: 1050;
}

/* Ensure dropdowns work properly on touch devices */
@media (hover: none) and (pointer: coarse) {
    .dropdown:hover .dropdown-menu {
        display: none !important;
    }
}
