:root {
    --mm-bg: #f7fbf8;
    --mm-surface: #ffffff;

    /* Updated primary color palette (based on #28a745) */
    --mm-primary: #28a745;       /* main primary */
    --mm-primary-600: #23963e;   /* slightly darker shade */
    --mm-primary-700: #1f8537;   /* deeper shade for hover/active */

    /* Accent and supporting colors (can keep same or adjust slightly) */
    --mm-accent-gold: #c9a227;   /* gold accent */
    --mm-accent-teal: #2ebd59;   /* optional accent to complement green */

    /* Text and neutrals */
    --mm-text: #1f2d2a;          /* dark ink */
    --mm-muted: #6b7d76;         /* muted gray-green */
    --mm-border: #dfe7e3;        /* soft border */

    /* Bootstrap var overrides */
    --bs-primary: #28a745;
    --bs-dark: #1f2d2a;
    --bs-light: #f8f9fa;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--mm-bg);
    color: var(--mm-text);
}

/* Links, subtle transitions */
a,
.btn,
.card,
.navbar,
.form-control,
.table,
.dropdown-menu {
    transition: all .2s ease-in-out;
}

/* Navbar - clean, fixed, subtle hover underline */
.navbar {
    background: var(--mm-surface) !important;
    border-bottom: 1px solid var(--mm-border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.navbar .navbar-brand h1,
.navbar .navbar-brand .mb-0 {
    color: var(--mm-text) !important;
}


.navbar .nav-link {
    color: var(--mm-text);
    position: relative;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: var(--mm-primary);
}

.navbar .nav-link::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 6px;
    height: 2px;
    background: var(--mm-primary);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .25s ease;
}

.navbar .nav-link:hover::after,
.navbar .nav-link.active::after {
    transform: scaleX(1);
}
/* Highlight only the word 'Masjid' in navbar */
.navbar .navbar-brand .masjid-highlight {
  color: var(--mm-primary) !important;
}

/* Buttons */
.btn-primary {
    background: var(--mm-primary) !important;
    border-color: var(--mm-primary) !important;
}

.btn-primary:hover {
    background: var(--mm-primary-700) !important;
    border-color: var(--mm-primary-700) !important;
}

.btn-outline-primary {
    color: var(--mm-primary) !important;
    border-color: var(--mm-primary) !important;
}

.btn-outline-primary:hover {
    background: var(--mm-primary) !important;
    color: #fff !important;
}

/* Cards */
.card {
    border: 1px solid var(--mm-border);
    border-radius: 16px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

/* Forms */
.form-control,
.form-select {
    border-radius: 12px;
    border-color: var(--mm-border);
}

.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 .2rem rgba(46, 125, 109, .15);
    border-color: var(--mm-primary);
}

/* Tables */
.table {
    border-color: var(--mm-border);
}

.table thead {
    background: #eef5f2;
}

.table-striped tbody tr:nth-of-type(odd) {
    background: #f9fcfb;
}

/* Back to top button */
.back-to-top {
    background: var(--mm-primary);
}

.back-to-top:hover {
    background: var(--mm-primary-700);
}

/* Snackbars (merged) */
#snackbar,
#greensnackbar {
    visibility: hidden;
    min-width: 250px;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 12px;
    position: fixed;
    z-index: 9999;
    top: 20px;
    right: 20px;
    font-size: 14px;
    transform: translateX(0);
}

#snackbar {
    background-color: #dd120b;
}

#greensnackbar {
    background-color: #17a24a;
}

#snackbar.show,
#greensnackbar.show {
    visibility: visible;
    animation: slidein .5s forwards, fadeout .5s 2s forwards;
}

@keyframes slidein {
    from {
        transform: translateX(100px);
        opacity: 0;
    }

    to {
        transform: translateX(-50px);
        opacity: 1;
    }
}

@keyframes fadeout {
    from {
        transform: translateX(-50px);
        opacity: 1;
    }

    to {
        transform: translateX(0);
        opacity: 0;
    }
}

/* Dashboard (merged) */
#wrapper {
    display: flex;
    align-items: stretch;
}

#sidebar-wrapper {
    position: fixed;
    height: 100vh;
    width: 60px;
    overflow: hidden;
    background-color: #1f2a27;
    transition: width .3s ease;
}

#sidebar-wrapper.expanded {
    width: 250px;
}

.sidebar-heading {
    text-align: center;
    font-size: 1rem;
    background-color: #15201d;
    color: #e6f2ee;
}

#sidebar-logo {
    width: 40px;
    height: auto;
    margin-right: 10px;
    transition: width .3s ease;
}

#sidebar-wrapper.expanded #sidebar-logo {
    width: 100px;
}

#sidebar-title {
    display: none;
}

#sidebar-wrapper.expanded #sidebar-title {
    display: inline;
    color: #e6f2ee;
}

#sidebar-wrapper .list-group-item {
    border: none;
    text-align: left;
    color: #e6f2ee;
}

#sidebar-wrapper .list-group-item:hover {
    background-color: #213630;
    cursor: pointer;
}

#page-content-wrapper {
    margin-left: 60px;
    transition: margin-left .3s ease;
    width: 100%;
    padding: 2rem;
}

#sidebar-wrapper.expanded~#page-content-wrapper {
    margin-left: 250px;
}

/* Form pages layout helpers */
.form-container {
    max-width: 720px;
    margin: 120px auto 40px auto;
    padding: 2rem;
    background: var(--mm-surface);
    border: 1px solid var(--mm-border);
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .06);
}

.form-container h2 {
    margin-bottom: 1rem;
    color: var(--mm-primary);
}

/* Subtle fade-in */
.fade-in {
    animation: mmfade .4s ease-out both;
}

@keyframes mmfade {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/*** Spinner Start ***/

#spinner {
    opacity: 0;
    visibility: hidden;
    transition: opacity .8s ease-out, visibility 0s linear .5s;
    z-index: 99999;
}

#spinner.show {
    visibility: visible;
    opacity: 1;
}

.wow,
.animated {
    animation-duration: 2s !important;
}

/*** Spinner End ***/

.back-to-top {
    position: fixed;
    right: 30px;
    bottom: 30px;
    display: flex;
    width: 50px;
    height: 50px;
    align-items: center;
    justify-content: center;
    transition: 0.5s;
    z-index: 99;
    background: var(--mm-primary);
    color: #fff;
    border-radius: 50%;
    font-size: 1.5rem;
}

.back-to-top:hover {
    background: var(--mm-primary-700);
    color: #fff;
}

h1,
h2,
h3,
.h1,
.h2,
.h3 {
    font-weight: 700 !important;
    font-family: 'Open', sans-serif !important;
}

h4,
h5,
h6,
.h4,
.h5,
.h6 {
    font-weight: 600 !important;
    font-family: 'Open', sans-serif !important;
}

.py-6 {
    padding-top: 6rem;
    padding-bottom: 6rem;
}


/*** Button Start ***/

.btn,
.btn-primary,
.btn-secondary {
    font-weight: 600;
    border-radius: 15px;
    padding: 10px 24px;
    transition: background 0.3s;
}

.btn-primary {
    background: var(--mm-primary);
    color: #fff;
    border: none;
}

.btn-primary:hover {
    background: var(--mm-primary-700);
    color: #fff;
}

.btn-secondary {
    background: #fff;
    color: var(--mm-primary);
    border: 2px solid var(--mm-primary);
}

.btn-secondary:hover {
    background: var(--mm-primary);
    color: #fff;
}

.btn-square {
    width: 38px;
    height: 38px;
}

.btn-sm-square {
    width: 32px;
    height: 32px;
}

.btn-md-square {
    width: 46px;
    height: 46px;
}

.btn-lg-square {
    width: 58px;
    height: 58px;
}

.btn-square,
.btn-sm-square,
.btn-md-square,
.btn-lg-square {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
}

.btn.btn-primary:hover {
    color: var(--bs-primary) !important;
    background: var(--bs-dark) !important;
    border-color: var(--bs-dark) !important;
}

.btn.btn-dark:hover {
    color: var(--bs-dark) !important;
    background: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}

/*** Button End ***/

/*** Navbar Start ***/
.fixed-top {
    transition: .5s;
}

.navbar-brand .mb-0 {
    display: inline;
    padding-left: 5px;
}

/*a.navbar-brand{
    display: flex;
    justify-content: center;
}*/
a.navbar-brand img {
    border-radius: 5px;
    width: auto;
    heigth: auto;
}

.navbar {
    border-bottom: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.navbar .navbar-brand h1,
.navbar .navbar-brand .mb-0 {
    display: inline;
    padding-left: 5px;
    font-family: 'Pacifico', cursive;
    font-size: 2rem;
    color: #222;
}

.navbar .navbar-nav .nav-link {
    padding: 12px 18px;
    color: #222;
    font-size: 17px;
    font-weight: 600;
    transition: color 0.3s;
}

.navbar .navbar-nav .nav-link.active,
.navbar .navbar-nav .nav-link:hover {
    color: var(--mm-primary);
}

.navbar .btn-primary {
    background: var(--mm-primary);
    border: none;
    color: #fff;
    font-weight: 600;
    border-radius: 15px;
    padding: 8px 24px;
    transition: background 0.3s;
}

.navbar .btn-primary:hover {
    background: var(--mm-primary-700);
    color: #fff;
}

.navbar .dropdown-toggle::after {
    border: none;
    content: "\f107";
    font-family: "Font Awesome 5 Free";
    font-weight: 700;
    vertical-align: middle;
    margin-left: 8px;
}

@media (min-width: 992px) {
    .navbar-collapse {
        background: transparent !important;
    }

    .navbar .nav-item .dropdown-menu {
        display: block;
        visibility: hidden;
        top: 100%;
        transform: rotateX(-75deg);
        transform-origin: 0% 0%;
        border: 0;
        transition: .5s;
        opacity: 0;
    }

    .navbar .nav-item:hover .dropdown-menu {
        transform: rotateX(0deg);
        visibility: visible;
        background: var(--bs-light) !important;
        transition: .5s;
        opacity: 1;
    }
}

.navbar-toggler {
    background: var(--bs-secondary);
    color: var(--bs-light) !important;
    padding: 10px 20px;
    border: 2px solid var(--bs-primary) !important;
    box-shadow: none !important;
}

/*** Navbar End ***/
/*** Hero Header ***/
.hero-header {
    margin-bottom: 6rem;
    padding-top: 10rem;
    padding-bottom: 6rem;
    background: url("img/hero1.jpg") center center no-repeat;
    background-size: cover;
    position: relative;
}

/* Remove white container for clean look */
.hero-header .hero-header-inner {
    padding: 0;
}

/* Headings */
.hero-header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    color: #fff;
}

.hero-header p {
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 2rem;
}

/* Unified Hero Buttons */
/* Unified Green Buttons */
.hero-header .hero-btn {
    background-color: #28a745; /* same as REGISTER MASJID */
    color: #fff;
    padding: 0.8rem 2.5rem; /* uniform padding */
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    display: inline-block;
    border: none; /* solid look */
}

.hero-header .hero-btn:hover {
    background-color: #218838; /* slightly darker green on hover */
    transform: translateY(-2px);
}

/* Outline White Button */
.hero-header .btn-outline-light.hero-btn {
    border: 2px solid #fff;  /* border thickness same as solid button */
    color: #fff;
    background-color: transparent;
}
.hero-header .btn-outline-light.hero-btn:hover {
    background-color: #ffffff33;
    color: #fff;
    transform: translateY(-2px);
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .hero-header {
        padding-top: 12rem;
        padding-bottom: 4rem;
    }
    .hero-header h1 {
        font-size: 2.5rem;
    }
    .hero-header p {
        font-size: 1.1rem;
    }
    .hero-header .hero-btn {
        padding: 0.6rem 2rem;
        font-size: 1rem;
    }
}


/*** About Start ***/
.about a.btn.btn-light:hover {
    background: var(--bs-dark) !important;
    color: var(--bs-primary) !important;
    border: 0;
}

/*** About End ***/


/*** Activities Start ***/
.activities .activities-item {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 45px rgba(0, 18, 20, .08);
    transition: 0.5s;
}

.activities .activities-item:hover {
    background: var(--mm-primary) !important;
    color: var(--bs-light) !important;
}

.activities .activities-item:hover a {
    background: #ffffff !important;
    color: var(--mm-primary) !important;
}

.activities .activities-item:hover a:hover {
    background: var(--mm-primary-700) !important;
    color: #fff !important;
}

/*** Activities End ***/


/*** Events Start ***/
.event-item img {
    transition: 0.5s;
}

.event .event-item a {
    transition: 0.5s;
}

.event-item:hover img {
    transition: 0.5s;
    transform: scale(1.2)
}

.event-item a:hover {
    background: var(--bs-dark);
    color: var(--bs-primary);
    opacity: 0.5s;
}

/*** Events End ***/

/*** Sermon Start ***/
.sermon .sermon-item {
    background: #fff;
    border-radius: 1.2rem;
    box-shadow: 0 0.25rem 1rem rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    min-height: 430px; /* Much taller for better layout */
    padding: 0;
    overflow: hidden;
    justify-content: flex-start;
}

/* Display the full image with a white background, centered, not cropped */
.sermon-item img, .sermon .sermon-item img {
    width: 100%;
    height: 240px;
    object-fit: contain;
    object-position: center center;
    background: #fff;
    border-radius: 1.2rem 1.2rem 0 0;
    transition: transform 0.35s cubic-bezier(.4,2,.7,1);
    display: block;
    margin: 0 auto;
}

/* Hover zoom effect */
.sermon-item:hover img {
    transform: scale(1.04);
}

/* Padding and larger font for content */
.p-4 {
    padding: 1.5rem 1.5rem !important;
    padding-bottom: 1rem !important;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.sermon-item .h5, .sermon-item h5 {
    font-size: 1.28rem; /* Increased heading font size */
    font-weight: 700;
    margin-bottom: 0.65rem;
}

.sermon-item p, .sermon-item .small, .sermon-item .mb-0 {
    font-size: 1.09rem; /* Larger body font size */
    margin-bottom: 0;
    color: #222;
    line-height: 1.7;
}

@media (max-width: 991px) {
    .col-md-6.col-xl-5 {
        max-width: 95%;
        margin-left: auto;
        margin-right: auto;
    }
}

/*** Sermon End ***/


/*** Blog Start ***/
.blog-item {
    height: 100%;
    box-shadow: 0 0 45px rgba(0, 0, 0, .08);
}

.blog-item img {
    transition: 0.5s;
}

.blog-item:hover img {
    transform: scale(1.2)
}

.blog-item .blog-meta a,
.blog-item .blog-meta a i {
    transition: 0.5s;
}

.blog-item .blog-meta a:hover,
.blog-item .blog-meta a i:hover {
    color: var(--bs-primary) !important;
}

/*** Blog End ***/


/*** Team Start ***/
.team .team-img {
    height: 100%;
    padding: 25px;
    background: var(--bs-white);
    overflow: hidden;
    box-shadow: 0 0 45px rgba(0, 0, 0, .08);
}

.team .team-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

ul {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 20px;
}

.team .team-item {
    position: relative;
    overflow: hidden;
}

.team .team-item img {
    transition: 0.5s;
}

.team .team-item:hover img {
    transform: scale(1.2);
}

.team .team-item .team-content {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    padding: 15px;
    transform: translateX(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: 0.5s;
}

.team .team-item:hover .team-content {
    opacity: 1;
    background: rgba(46, 125, 109, .25);
}

/*** Team End ***/

/* Feature List Styling */
.feature-list {
  list-style-type: disc;
  padding-left: 1.5rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #333;
  margin: 0;
}

.feature-list li {
  margin-bottom: 0.6rem;
}

/* Iframe & Image adjustments */
.team-img iframe {
  width: 100%;
  height: 280px;
  border: none;
  border-radius: 15px;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
  .feature-list {
    font-size: 1rem;
  }
}

@media (max-width: 768px) {
  .team-img iframe {
    height: 220px;
  }
}

@media (max-width: 576px) {
  .feature-list {
    font-size: 0.95rem;
    padding-left: 1.2rem;
  }
}

/*** Testimonial Start ***/
.testimonial-item {
    background: var(--bs-light);
    padding: 35px 40px; /* slightly increased from 25px */
    border-radius: 14px;
}

/* slightly larger image for balance */
.testimonial-carousel .owl-item img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    border-radius: 50%;
}

/* carousel padding balanced */
.testimonial-carousel {
    position: relative;
    padding-left: 50px;
    padding-right: 50px;
}

/* navigation buttons */
.testimonial-carousel .owl-nav .owl-prev,
.testimonial-carousel .owl-nav .owl-next {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    width: 50px;
    height: 38px;
    background: var(--bs-primary);
    color: var(--bs-dark);
    font-size: 20px;
    top: 50%;
    transform: translateY(-50%);
    transition: .5s;
    border-radius: 6px;
}

.testimonial-carousel .owl-nav .owl-prev:hover,
.testimonial-carousel .owl-nav .owl-next:hover {
    background: var(--bs-dark) !important;
    color: var(--bs-primary) !important;
}

.testimonial-carousel .owl-nav .owl-prev {
    left: 0;
}

.testimonial-carousel .owl-nav .owl-next {
    right: 0;
}

/* Header size: larger than previous but smaller than original */
.testimonial h2,
.testimonial .display-3 {
    font-size: 38px !important;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

/* text readability improvements */
.testimonial-item h6 {
    font-size: 17px;
    margin-bottom: 4px;
}

.testimonial-item p.small {
    font-size: 14px;
}

.testimonial-item .fs-6 {
    font-size: 16px;
    line-height: 1.6;
}

/* balanced section padding */
.testimonial {
    padding-top: 60px !important;
    padding-bottom: 60px !important;
}
/*** Testimonial End ***/

/*** Footer Start ***/
.footer {
    margin-top: 0; /* Removed top white gap */
    background: #222;
    color: #fff;
}

.footer .footer-item h4,
.footer .footer-item h1 {
    color: #fff;
    font-weight: 700;
}

.footer .footer-item a.btn {
    background: var(--mm-primary);
    color: #fff;
    border-radius: 15px;
    padding: 8px 24px;
}

.footer .footer-item a.btn:hover {
    background: var(--mm-primary-700);
}

.footer .footer-item p,
.footer .footer-item .text-secondary {
    color: #ccc;
}

.footer .footer-item a,
.footer .footer-item a i {
    color: #fff;
    transition: color 0.3s;
}

.footer .footer-item a:hover,
.footer .footer-item a i:hover {
    color: var(--mm-primary) !important;
}

.footer .border-top,
.footer .border-bottom {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* --- Ayat Section Styling --- */
.footer .footer-item .ayat {
    font-family: "Scheherazade New", serif;
    font-size: 1.1rem;
    color: #f2f2f2;
    line-height: 1.8;
}

.footer .footer-item .translation {
    font-size: 0.95rem;
    color: #ccc;
    font-style: italic;
    margin-top: 0.5rem;
}

.footer-bottom {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #555;
}
.footer .py-5 {
    padding-bottom: 0 !important;
}
/*** Footer End ***/


body {
    padding-top: 90px;
    /* Adjust if your navbar is taller */
    font-family: 'Open Sans', Arial, sans-serif;
    background: #f8f8f8;
}

/* Pages without fixed navbar (timing screens, dashboard) */
body.no-navbar,
body.dashboard-page {
    padding-top: 0 !important;
}

/* Form Container */
.form-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Form Elements */
.form-group label {
    font-weight: bold;
    color: #333;
}

/* Normalized controls */
.mm-form .form-control,
.mm-form .form-select,
.form-control,
.form-select,
.form-control-file {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background: #fafafa;
    min-height: 44px;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--mm-primary);
    outline: none;
}

.logo-preview {
    width: 150px;
    height: 150px;
    border: 2px dashed #ddd;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
}

.submit-btn,
.btn-primary {
    background-color: var(--mm-primary);
    color: #fff;
    padding: 1rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.submit-btn:hover,
.btn-primary:hover {
    background-color: var(--mm-primary-700);
}

.form-links {
    text-align: right;
}

.forgot-password {
    color: var(--mm-primary);
    text-decoration: none;
}

.forgot-password:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .form-container {
        margin: 1rem;
        padding: 1.5rem;
        max-width: 100%;
    }

    .navbar .navbar-nav .nav-link {
        padding: 10px 8px;
        font-size: 16px;
    }

    .footer {
        padding: 2rem 0 1rem 0;
    }
}

/*** Masjid Cards ***/
.masjid-card {
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  transition: box-shadow 0.2s;
  min-height: 300px; /* reduced slightly for smaller screens */
  max-width: 100%; /* allow full width on mobile */
  margin: 0.5rem auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.logo-img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 1rem;
  border-radius: 12px;
  background: #f8f8f8;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

/* Card button */
.btn-block {
  width: 70%;
  margin: 10px auto 0 auto;
  font-size: 0.95rem;
  padding: 8px 0;
  border-radius: 8px;
}

/* Card container flex for tablets */
.masjid-card-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}


.card-title,
.card-text {
  text-align: center;
  width: 100%;
}

#masjidSearchForm {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Card container flex */
.masjid-card-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

/* Masjid card sizing */
.masjid-card {
  flex: 1 1 calc(33.33% - 1rem); /* default: 3 per row */
  max-width: 320px; /* prevents cards from growing too wide */
  min-width: 220px; /* ensures cards don't shrink too small */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 0.5rem;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

/* Tablets: 2 per row */
@media (max-width: 992px) {
  .masjid-card {
    flex: 1 1 calc(50% - 1rem);
  }
}

/* Mobile: 1 per row */
@media (max-width: 576px) {
  .masjid-card {
    flex: 1 1 100%;
    max-width: 100%;
  }
}


/* === Responsive Fixes === */
/* Mobile: ≤576px */
@media (max-width: 576px) {
  .masjid-card {
    min-height: auto;
    padding: 0.8rem;
  }
  .logo-img {
    width: 90px;
    height: 90px;
  }
  #masjidSearchForm {
    flex-direction: column;
    gap: 0.5rem;
  }
  #masjidSearchForm input,
  #masjidSearchForm select {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Tablets: 577px - 992px */
@media (min-width: 577px) and (max-width: 992px) {
  .masjid-card {
    flex: 1 1 calc(50% - 1rem); /* 2 cards per row */
    max-width: 48%;
  }
}

/* Large screens > 992px */
@media (min-width: 993px) {
  .masjid-card {
    flex: 1 1 calc(33.33% - 1rem); /* 3 cards per row */
    max-width: 32%;
  }
}

/* ============================================================
   RESPONSIVE ENHANCEMENTS (for all pages)
   ============================================================ */

/* --- Mobile: ≤576px --------------------------------------- */
@media (max-width: 576px) {
  /* Navbar toggle spacing */
  .navbar .navbar-nav .nav-link {
    padding: 8px 6px;
    font-size: 15px;
  }
  .navbar .btn-primary {
    padding: 6px 14px;
    font-size: 14px;
  }

  /* Hero section text & spacing */
  .hero-header {
    padding-top: 8rem;
    padding-bottom: 3rem;
    text-align: center;
  }
  .hero-header h1 {
    font-size: 1.8rem;
    line-height: 1.3;
  }

  /* Form containers */
  .form-container {
    width: 100%;
    margin: 1rem auto;
    padding: 1.25rem;
  }
  .form-container input,
  .form-container select,
  .form-container button {
    width: 100%;
    font-size: 0.95rem;
  }

  /* Buttons - prevent overlap */
  .btn,
  .btn-primary,
  .btn-secondary {
    display: block;
    width: 100%;
    margin-bottom: 0.75rem;
  }

  /* Salah table wrapping */
  table,
  .table {
    font-size: 0.9rem;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  .table th,
  .table td {
    padding: 0.6rem;
  }

  /* Dashboard and cards */
  .card {
    margin-bottom: 1rem;
  }
  .masjid-card {
    max-width: 100%;
    min-height: auto;
  }

  /* Footer alignment */
  .footer .footer-item {
    text-align: center;
  }

  /* Back to top button */
  .back-to-top {
    width: 32px;
    height: 32px;
    font-size: 1rem;
    right: 15px;
    bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }

  /* Navbar login button */
  .navbar-login-btn {
    width: 100%;
    margin: 10px 0 0 0;
    height: 38px;
    font-size: 15px;
    border-radius: 10px;
  }
}

/* --- Tablets: ≤768px -------------------------------------- */
@media (max-width: 768px) {
  .navbar-brand h1 {
    font-size: 1.6rem;
  }
  .hero-header h1 {
    font-size: 2rem;
  }
  .form-container {
    max-width: 90%;
  }
  .activities .activities-item,
  .team .team-item,
  .blog-item,
  .event-item {
    margin-bottom: 1.5rem;
  }
  .footer .footer-item {
    margin-bottom: 1rem;
  }

  /* Back to top button slight position change */
  .back-to-top {
    bottom: 40px;
  }
}

/* --- Small Laptops: ≤992px -------------------------------- */
@media (max-width: 992px) {
  .navbar-collapse {
    background: var(--mm-surface);
  }
  .hero-header {
    padding-top: 10rem;
  }
  .hero-header h1 {
    font-size: 2.4rem;
  }
  .form-container {
    max-width: 600px;
  }
  .table th,
  .table td {
    padding: 0.75rem;
  }

  /* Navbar login button adjustments */
  .navbar-login-btn {
    width: 100%;           /* Full width in mobile menu */
    margin: 10px 0 0 0;
    height: 38px;
    font-size: 15px;
    border-radius: 10px;
  }
}

/* --- Desktops: ≤1200px ------------------------------------ */
@media (max-width: 1200px) {
  .hero-header h1 {
    font-size: 2.6rem;
  }
  .activities .activities-item {
    padding: 1rem;
  }
  .team .team-img {
    padding: 15px;
  }
  .footer {
    padding: 2rem 1rem;
  }
}

/* --- Large Desktops: ≤1400px ------------------------------- */
@media (max-width: 1400px) {
  .hero-header h1 {
    font-size: 2.8rem;
  }
  .navbar .nav-link {
    font-size: 16px;
  }
}

/* --- 32-inch TVs & Ultra-wide Screens: ≤2560px ------------- */
@media (max-width: 2560px) {
  body {
    max-width: 100vw;
    margin: 0 auto;
  }
  .hero-header h1 {
    font-size: 3.5rem;
  }
  .hero-header p {
    font-size: 1.25rem;
  }
  .form-container {
    max-width: 700px;
  }
  .footer {
    font-size: 1.1rem;
  }
  .table th,
  .table td {
    font-size: 1.05rem;
  }
}

/* --- Ultra-wide Large Screens: >1600px ------------------- */
@media (min-width: 1601px) {
  body {
    max-width: 100vw;
    margin: 0;
  }
}

/* --- Global overflow fix --- */
html,
body {
  overflow-x: hidden;
}

/* Navbar login button general styles */
.navbar-login-btn {
  padding: 6px 22px;          /* Compact height, reasonable width */
  min-width: 82px;            /* Ensures button is not too small */
  height: 40px;               /* Uniform height across breakpoints */
  font-size: 16px;            /* Matches nav-link size */
  border-radius: 14px;        /* Modern style with rounded edges */
  display: inline-flex;       /* To align text vertically */
  align-items: center;
  justify-content: center;
  margin-left: 12px;          /* Space between last nav-link and button */
  background: var(--mm-primary);
  border: none;
  color: #fff;
  font-weight: 600;
  transition: background 0.3s ease;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}
.navbar-login-btn:hover,
.navbar-login-btn.active {
  background: var(--mm-primary-700);
  color: #fff;
}
