/* =========================
   RESET
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, sans-serif;
    min-height: 100vh;

    background:
        radial-gradient(circle at top left, #d8b4fe, transparent 30%),
        radial-gradient(circle at bottom right, #93c5fd, transparent 30%),
        #f8fafc;

    color: #111827;

    transition: background 0.5s ease, color 0.5s ease;
}


/* =========================
   NAVBAR
========================= */

.nav {
    width: calc(100% - 40px);
    min-height: 75px;

    margin: 20px auto;
    padding: 0 25px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    border: 1px solid rgba(255, 255, 255, 0.5);

    background: rgba(255, 255, 255, 0.45);

    backdrop-filter: blur(15px);

    border-radius: 25px;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);

    position: sticky;
    top: 15px;

    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo span {
    font-size: 30px;
}

.logo p {
    font-size: 25px;
    font-weight: bold;

    background: linear-gradient(
        90deg,
        #2563eb,
        #9333ea
    );

    -webkit-background-clip: text;
    background-clip: text;

    color: transparent;
}


/* =========================
   THEME BUTTON
========================= */

.theme {
    width: 45px;
    height: 45px;

    border: none;
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.7);

    font-size: 20px;

    cursor: pointer;

    transition: 0.3s;
}

.theme:hover {
    transform: rotate(20deg) scale(1.1);
}


/* =========================
   HERO
========================= */

.hero {
    text-align: center;

    padding: 60px 20px 30px;
}

.hero h1 {
    font-size: clamp(32px, 5vw, 55px);

    margin-bottom: 12px;

    background: linear-gradient(
        90deg,
        #2563eb,
        #9333ea
    );

    -webkit-background-clip: text;
    background-clip: text;

    color: transparent;
}

.hero p {
    color: #64748b;
    font-size: 17px;
}


/* =========================
   FILTER BUTTONS
========================= */

.gallary {
    width: 100%;

    display: flex;
    justify-content: center;
    align-items: center;

    gap: 12px;

    flex-wrap: wrap;

    padding: 20px;
}

.filter {
    border: none;

    padding: 12px 22px;

    border-radius: 50px;

    background: rgba(255, 255, 255, 0.7);

    color: #334155;

    font-weight: bold;

    cursor: pointer;

    transition: 0.3s;

    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.filter:hover {
    transform: translateY(-3px);

    background: #2563eb;

    color: white;
}

.filter.active {
    background: linear-gradient(
        135deg,
        #2563eb,
        #7c3aed
    );

    color: white;
}


/* =========================
   GALLERY
========================= */

.caintaner {
    width: calc(100% - 40px);

    max-width: 1400px;

    margin: 30px auto;

    display: grid;

    grid-template-columns: repeat(3, 1fr);

    gap: 22px;
}


/* =========================
   IMAGE CARD
========================= */

.image-card {
    position: relative;

    width: 100%;
    height: 300px;

    overflow: hidden;

    border-radius: 20px;

    cursor: pointer;

    background: white;

    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);

    transition:
        transform 0.4s ease,
        box-shadow 0.4s ease;
}

.image-card:hover {
    transform: translateY(-8px);

    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}


/* =========================
   IMAGES
========================= */

.image-card img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;

    transition:
        transform 0.6s ease,
        filter 0.4s ease;
}

.image-card:hover img {
    transform: scale(1.12);

    filter: brightness(0.75);
}


/* =========================
   OVERLAY
========================= */

.overlay {
    position: absolute;

    left: 0;
    bottom: 0;

    width: 100%;

    padding: 20px;

    background: linear-gradient(
        transparent,
        rgba(0, 0, 0, 0.8)
    );

    color: white;

    transform: translateY(100%);

    transition: 0.4s ease;
}

.image-card:hover .overlay {
    transform: translateY(0);
}


/* =========================
   LIGHTBOX
========================= */

.lightbox {
    display: none;

    position: fixed;

    inset: 0;

    width: 100%;
    height: 100%;

    background: rgba(0, 0, 0, 0.94);

    justify-content: center;
    align-items: center;

    padding: 20px;

    z-index: 9999;
}

.lightbox-content {
    width: auto;
    max-width: 85vw;

    text-align: center;
}

#bigImage {
    display: block;

    max-width: 85vw;
    max-height: 80vh;

    width: auto;
    height: auto;

    object-fit: contain;

    border-radius: 15px;

    box-shadow: 0 0 50px rgba(255, 255, 255, 0.15);
}


/* =========================
   CLOSE BUTTON
========================= */

#close {
    position: absolute;

    top: 20px;
    right: 30px;

    width: 50px;
    height: 50px;

    border: none;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.15);

    color: white;

    font-size: 35px;

    cursor: pointer;

    transition: 0.3s;

    z-index: 10;
}

#close:hover {
    background: #ef4444;

    transform: rotate(90deg);
}


/* =========================
   NEXT / PREVIOUS
========================= */

.navigation {
    position: absolute;

    top: 50%;

    transform: translateY(-50%);

    width: 55px;
    height: 55px;

    border: none;

    border-radius: 50%;

    background: rgba(255, 255, 255, 0.15);

    color: white;

    font-size: 30px;

    cursor: pointer;

    transition: 0.3s;

    z-index: 10;
}

.navigation:hover {
    background: #2563eb;

    transform:
        translateY(-50%)
        scale(1.1);
}

#prev {
    left: 30px;
}

#next {
    right: 30px;
}


/* =========================
   COUNTER
========================= */

#counter {
    color: white;

    margin-top: 12px;

    font-size: 16px;
}


/* =========================
   FOOTER
========================= */

footer {
    width: 100%;

    text-align: center;

    padding: 35px 15px;

    color: #64748b;

    font-size: 14px;
}


/* =========================
   DARK MODE
========================= */

body.dark {
    background:
        radial-gradient(
            circle at top left,
            #312e81,
            transparent 30%
        ),
        radial-gradient(
            circle at bottom right,
            #1e3a8a,
            transparent 30%
        ),
        #020617;

    color: white;
}

body.dark .nav {
    background: rgba(15, 23, 42, 0.7);

    border-color: rgba(255, 255, 255, 0.1);
}

body.dark .theme {
    background: rgba(30, 41, 59, 0.9);
}

body.dark .hero p {
    color: #cbd5e1;
}

body.dark .filter {
    background: rgba(30, 41, 59, 0.8);

    color: white;
}

body.dark .filter.active {
    background: linear-gradient(
        135deg,
        #2563eb,
        #7c3aed
    );
}

body.dark .image-card {
    background: #0f172a;
}

body.dark footer {
    color: #94a3b8;
}


/* =========================
   LARGE SCREEN
========================= */

@media (min-width: 1400px) {

    .caintaner {
        grid-template-columns: repeat(4, 1fr);
    }

    .image-card {
        height: 320px;
    }
}


/* =========================
   TABLET
========================= */

@media (max-width: 992px) {

    .caintaner {
        grid-template-columns: repeat(2, 1fr);

        width: calc(100% - 30px);
    }

    .image-card {
        height: 280px;
    }

    .hero {
        padding-top: 50px;
    }

    .navigation {
        width: 50px;
        height: 50px;

        font-size: 25px;
    }

    #prev {
        left: 20px;
    }

    #next {
        right: 20px;
    }
}


/* =========================
   MOBILE
========================= */

@media (max-width: 600px) {

    /* Navbar */

    .nav {
        width: calc(100% - 20px);

        min-height: 65px;

        margin: 10px auto;

        padding: 0 15px;

        border-radius: 18px;

        top: 10px;
    }

    .logo {
        gap: 8px;
    }

    .logo span {
        font-size: 24px;
    }

    .logo p {
        font-size: 19px;
    }

    .theme {
        width: 40px;
        height: 40px;

        font-size: 18px;
    }


    /* Hero */

    .hero {
        padding: 40px 15px 20px;
    }

    .hero h1 {
        font-size: 32px;
        line-height: 1.2;
    }

    .hero p {
        font-size: 14px;

        line-height: 1.6;
    }


    /* Filters */

    .gallary {
        gap: 8px;

        padding: 15px 10px;
    }

    .filter {
        padding: 10px 14px;

        font-size: 13px;
    }


    /* Gallery */

    .caintaner {
        width: calc(100% - 30px);

        margin: 20px auto;

        grid-template-columns: 1fr;

        gap: 18px;
    }

    .image-card {
        height: 260px;

        border-radius: 17px;
    }


    /* Lightbox */

    .lightbox {
        padding: 15px;
    }

    .lightbox-content {
        width: 90vw;

        max-width: 90vw;
    }

    #bigImage {
        width: 90vw;

        max-width: 90vw;

        max-height: 65vh;

        height: auto;

        border-radius: 10px;
    }


    /* Navigation */

    .navigation {
        width: 42px;
        height: 42px;

        font-size: 20px;
    }

    #prev {
        left: 8px;
    }

    #next {
        right: 8px;
    }


    /* Close */

    #close {
        top: 15px;
        right: 15px;

        width: 42px;
        height: 42px;

        font-size: 28px;
    }


    /* Counter */

    #counter {
        font-size: 14px;

        margin-top: 8px;
    }


    /* Footer */

    footer {
        padding: 25px 15px;

        font-size: 12px;

        line-height: 1.5;
    }
}


/* =========================
   VERY SMALL MOBILE
========================= */

@media (max-width: 380px) {

    .logo p {
        font-size: 17px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .filter {
        padding: 9px 11px;

        font-size: 12px;
    }

    .image-card {
        height: 230px;
    }

    #bigImage {
        max-height: 60vh;
    }
}