/* -------------------- GLOBAL RESET -------------------- */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Raleway, sans-serif;
}

body {
    position: relative;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow: visible;
    /* Allow scrolling on the body */
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background-image: url('bg/12.jpg');
    background-size: cover;
    background-position: center;
    z-index: -1;
    filter: blur(3px);
    /* ✅ Blur the background image */
    transform: scale(1.05);
    /* ✅ Prevent clipping at edges due to blur */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Raleway", sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f7f9fc;
}


/* -------------------- NAVBAR -------------------- */

nav {
    background: rgba(255, 255, 255, 0.2);
    /* Semi-transparent white */
    backdrop-filter: blur(5px);
    /* Blurs background */
    -webkit-backdrop-filter: blur(5px);
    /* Safari support */
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.2rem;
}

.navbar {
    max-width: 1200px;
    margin: auto;
    padding: 0.8rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo img {
    height: 80px;
    width: auto;
    margin-right: 20px;
}

.navbar ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.navbar ul li {
    position: relative;
}

.navbar ul li a {
    display: inline-block;
    padding: 10px 15px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    text-decoration: none;
    color: white;
    border-radius: 8px;
    /* Smooth shape even before hover */
}


/* Hover and Active styles */

.navbar ul li a:hover,
.navbar ul li a.active {
    background: rgb(0, 0, 0);
    color: rgb(255, 255, 255);
    border-color: #7a766cde;
    transform: scale(1.1);
    /* Slight expansion */
    border-radius: 15px;
    /* ✅ Rounded square shape on hover */
}


/* Active link */

.navbar ul li a.active {
    background: rgb(0, 0, 0);
    color: rgb(255, 255, 255);
    border-radius: 15px;
    /* ✅ Rounded shape stays on active */
}


/* Optional underline effect on hover */

.navbar ul li a:hover::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 10%;
    width: 80%;
    height: 2px;
    background-color: #7a766cde;
    transform: scaleX(1);
    transform-origin: bottom center;
    transition: transform 0.3s ease;
    border-radius: 2px;
}


/* -------------------- Animation -------------------- */

@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
        /* Start slightly below */
    }
    100% {
        opacity: 1;
        transform: translateY(0);
        /* End in place */
    }
}

.navbar ul li {
    animation: fadeUp 0.6s ease forwards;
    opacity: 0;
}


/* Staggered animation (each list item appears with delay) */

.navbar ul li:nth-child(1) {
    animation-delay: 0.1s;
}

.navbar ul li:nth-child(2) {
    animation-delay: 0.2s;
}

.navbar ul li:nth-child(3) {
    animation-delay: 0.3s;
}

.navbar ul li:nth-child(4) {
    animation-delay: 0.4s;
}

.navbar ul li:nth-child(5) {
    animation-delay: 0.5s;
}

.navbar ul li:nth-child(6) {
    animation-delay: 0.6s;
}

.navbar ul li:nth-child(7) {
    animation-delay: 0.7s;
}

.navbar ul li:nth-child(8) {
    animation-delay: 0.8s;
}

.navbar ul li:nth-child(9) {
    animation-delay: 0.9s;
}

.navbar ul li:nth-child(10) {
    animation-delay: 1s;
}


/* Active link */

.navbar ul li a.active {
    background: rgb(0, 0, 0);
    color: rgb(255, 255, 255);
}

.navbar ul li a:hover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    /* Thin line for underline */
    background-color: rgb(0, 0, 0);
    transform: scaleX(0);
    /* Initially hidden */
    transform-origin: bottom right;
    transition: transform 0.3s ease;
}


/* -------------------- Responsive -------------------- */

@media (max-width: 768px) {
    .navbar ul {
        flex-direction: column;
        /* Vertical stack */
        gap: 10px;
        align-items: center;
        /* Center items */
    }
    .navbar ul li a {
        font-size: 16px;
        padding: 12px 20px;
        display: block;
    }
}

@media (max-width: 480px) {
    .navbar ul li a {
        font-size: 14px;
        padding: 10px 18px;
    }
}


/* -------------------- COMMUNITY SECTION -------------------- */

.community {
    text-align: center;
    padding: 40px 20px;
}

.community h2 {
    font-size: 4rem;
    margin-bottom: 40px;
    color: rgb(255, 255, 255);
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: color 0.3s ease, transform 0.3s ease;
    backdrop-filter: blur(6px);
    display: inline-block;
    padding: 15px 30px;
    border-radius: 20px;
    background: transparent;
}

.community h2:hover {
    border: 2px solid rgb(255, 255, 255);
    transform: scale(1.03);
}


/* Grid Layout */

.community-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
}


/* Each community item */

.community-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    animation: popUp 0.6s ease forwards;
    opacity: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}


/* Responsive Image */

.community-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
    border-radius: 15px;
    transition: transform 0.4s ease, filter 0.4s ease;
}


/* Hover Effects */

.community-item:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
}

.community-item:hover img {
    transform: scale(1.1);
    filter: brightness(1.1);
}


/* Pop-up animation */

@keyframes popUp {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}


/* Staggered community-item animation delay */

.community-item:nth-child(1) {
    animation-delay: 0.1s;
}

.community-item:nth-child(2) {
    animation-delay: 0.2s;
}

.community-item:nth-child(3) {
    animation-delay: 0.3s;
}

.community-item:nth-child(4) {
    animation-delay: 0.4s;
}

.community-item:nth-child(5) {
    animation-delay: 0.5s;
}

.community-item:nth-child(6) {
    animation-delay: 0.6s;
}

.community-item:nth-child(7) {
    animation-delay: 0.7s;
}

.community-item:nth-child(8) {
    animation-delay: 0.8s;
}

.community-item:nth-child(9) {
    animation-delay: 0.9s;
}

.community-item:nth-child(10) {
    animation-delay: 1s;
}

.community-item:nth-child(11) {
    animation-delay: 1.1s;
}

.community-item:nth-child(12) {
    animation-delay: 1.2s;
}

.community-item:nth-child(13) {
    animation-delay: 1.3s;
}

.community-item:nth-child(14) {
    animation-delay: 1.4s;
}

.community-item:nth-child(15) {
    animation-delay: 1.5s;
}

.community-item:nth-child(16) {
    animation-delay: 1.6s;
}

.community-item:nth-child(17) {
    animation-delay: 1.7s;
}

.community-item:nth-child(18) {
    animation-delay: 1.8s;
}

.community-item:nth-child(19) {
    animation-delay: 1.9s;
}


/* -------------------- RESPONSIVE -------------------- */

@media (max-width: 1024px) {
    .community-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .navbar ul {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    .navbar ul li a {
        font-size: 16px;
        padding: 12px 20px;
    }
    .community-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .navbar ul li a {
        font-size: 14px;
        padding: 10px 18px;
    }
    .community h2 {
        font-size: 2.5rem;
        padding: 10px 20px;
    }
    .community-list {
        grid-template-columns: 1fr;
    }
    .logo img {
        height: 60px;
    }
    body::before {
        background-attachment: scroll;
    }
}