/* --- Fonts Import --- */
@font-face {
    font-family: 'Google Sans';
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src: url('https://cdn.jsdelivr.net/fontsource/fonts/google-sans@latest/latin-400-normal.woff2') format('woff2');
}

@font-face {
    font-family: 'Google Sans';
    font-style: normal;
    font-display: swap;
    font-weight: 700;
    src: url('https://cdn.jsdelivr.net/fontsource/fonts/google-sans@latest/latin-700-normal.woff2') format('woff2');
}

/* --- Global Resets --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
    background-color: #0c080e;
}

body {
    color: #333;
    overflow-x: hidden;
    overscroll-behavior-y: none;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;   /* fallback for browsers without lvh support */
    height: 100lvh;  /* largest viewport height — stays fixed regardless of the address bar showing/hiding, so no gap ever appears during scroll on iOS Safari or Chrome mobile */
    background-image: url('Images/background1.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -1;
}

/* --- Navigation Bar Layout --- */
.top-nav {
    position: fixed;
    top: 15px;                  
    left: 5%;
    width: 90%;                 
    z-index: 1000;
    display: flex;
    justify-content: space-between; 
    align-items: center; 
    padding: 15px 25px;
    background-color: rgba(255, 255, 255, 0.068); 
    border-radius: 16px; 
    backdrop-filter: blur(15px); 
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.4s ease-in-out; 
}

/* Scrolled State */
.top-nav.scrolled {
    top: 0;                     
    left: 0;
    width: 100%;                
    border-radius: 0;           
    padding: 10px 30px;         
    border-bottom-left-radius: 25px;
    border-bottom-right-radius: 25px;
    background-color: rgba(255, 255, 255, 0.37);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.nav-links {
    display: flex;
    gap: 15px;
}

.nav-btn {
    text-decoration: none;
    color: #eee1e2;            
    font-weight: 600;
    padding: 8px 20px;        
    background-color: rgba(83, 46, 51, 0.25); 
    border-radius: 50px;       
    display: inline-block;
    transition: all 0.3s ease; 
}

.nav-btn:hover {
    background-color: #c01557; 
    color: #ffffff;            
    box-shadow: 0 0 15px rgba(230, 0, 35, 0.7); 
    transform: translateY(-1px); 
}

.brand {
    display: flex;
    align-items: center; 
    gap: 12px; 
}

.brand h1 {
    font-size: 1.4rem;
    color: #e4d8d8;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.logo {
    height: 40px; 
    width: auto;
    border-radius: 8px; 
}

/* --- Nav Left Group (hamburger + profile on mobile) --- */
.nav-left {
    display: contents;
}

.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    padding: 6px;
    background: rgba(83, 46, 51, 0);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1100;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.nav-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: #eee1e2;
    border-radius: 2px;
    transition: transform 0.35s ease, opacity 0.25s ease;
    transform-origin: center;
}

.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-hamburger:hover {
    background: rgba(192, 21, 87, 0.5);
}

/* --- Glass Bubble Tile --- */
.header-intro {
    font-family: 'Google Sans', sans-serif;
    text-align: center;
    padding: 30px 20px 45px 20px;
    margin: 200px auto 40px auto;
    margin-bottom: 110px;
    max-width: 600px;
    background-color: rgba(255, 255, 255, 0.05); 
    border-radius: 16px; 
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.header-intro p {
    color: #f0e5e5;
    margin-bottom: 15px;
    font-size: 1.4rem;
    letter-spacing: -0.2px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn {
    display: inline-block;
    padding: 10px 24px;
    background-color: #1083e0; 
    color: white;
    text-decoration: none;
    border-radius: 50px;       
    font-weight: bold;
    transition: all 0.3s ease; 
    margin-bottom: 20px;
}

.btn:hover {
    background-color: #1185e4; 
    box-shadow: 0 0 15px rgba(16, 131, 224, 0.7); 
    transform: translateY(-1px); 
}

/* --- 3D Vertical Tilting Gallery Layout --- */
.gallery {
    display: flex;
    justify-content: center;
    gap: 50px;
    max-width: 1600px;
    margin: 40px auto;
    padding: 0 40px;
}

/* --- Shimmer keyframe --- */
@keyframes shimmer-sweep {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

/* --- Image Card Grid Layout --- */
.image-card {
    flex: 1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    transform-origin: bottom center;
    transform: rotateX(-25deg) translateZ(0);
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.5s ease;
    position: relative;
    text-decoration: none;
    /* Promote each card to its own compositor layer so Chrome/Samsung
       keeps the decoded image in GPU memory while scrolling */
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Pinterest-style shimmer skeleton overlay — visible by default */
.image-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.00) 0%,
        rgba(255, 255, 255, 0.00) 30%,
        rgba(255, 255, 255, 0.11) 50%,
        rgba(255, 255, 255, 0.00) 70%,
        rgba(255, 255, 255, 0.00) 100%
    );
    background-size: 200% 100%;
    background-color: rgba(28, 18, 28, 0.70);
    animation: shimmer-sweep 1.6s ease-in-out infinite;
    z-index: 2;
    transition: opacity 0.45s ease;
    pointer-events: none;
}

/* Once loaded: fade shimmer out and stop the GPU sweep */
.image-card.img-loaded::before {
    opacity: 0;
    pointer-events: none;
    animation: none;
}

/* --- Image Base --- */
.image-card img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
    filter: blur(0);
    transition: filter 0.5s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.45s ease;
    opacity: 0;
    /* Keep decoded pixels on the GPU layer */
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.image-card.img-loaded img {
    opacity: 1;
}

/* --- Top Text Overlay --- */
.overlay-text {
    position: absolute;
    top: 0; 
    left: 0;
    width: 100%;
    height: auto;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 70%, transparent 100%); 
    color: #ffffff;
    font-family: 'Google Sans', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: center;
    align-items: flex-start; 
    text-align: center;
    padding: 15px 10px 35px 10px;
    opacity: 0; 
    transition: opacity 0.5s ease;
    pointer-events: none; 
    z-index: 5;
}

/* --- Grouped Buttons Container --- */
.card-btn-container {
    position: absolute;
    bottom: 25px; 
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0; 
    pointer-events: none; 
    transition: opacity 0.4s ease;
    z-index: 15; 
}

/* --- Bottom Download Button --- */
.card-btn {
    text-decoration: none;
    color: #eee1e2;          
    font-weight: 600;
    padding: 8px 20px;      
    background-color: rgba(83, 46, 51, 0.85);
    border-radius: 50px;     
    display: inline-block;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.card-btn:hover {
    background-color: #c01557;
    color: #ffffff;           
    box-shadow: 0 0 15px rgba(230, 0, 35, 0.7);
}

/* --- Like Group Wrapper --- */
.like-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.like-count {
    position: absolute;
    top: 100%; 
    margin-top: 6px;
    color: #eee1e2;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'Google Sans', sans-serif;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    opacity: 0;
    transform: translateY(-10px) scale(0.5); 
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    pointer-events: none;
}

.like-container.is-liked .like-count {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.like-btn {
    width: 36px;
    height: 36px;
    background-color: rgba(83, 46, 51, 0.85);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #eee1e2;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: background-color 0.3s ease, transform 0.2s cubic-bezier(0.25, 1.5, 0.5, 1), color 0.3s ease;
}

.like-btn:hover {
    background-color: #c01557;
    color: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(230, 0, 35, 0.7);
}

.like-btn.liked {
    background-color: #c01557;
    color: white;
}

.like-btn.liked svg {
    fill: white;
}

/* --- Desktop Interaction States --- */
.image-card:hover {
    transform: rotateX(0deg) scale(1.15);
    z-index: 10;
    box-shadow: 0 20px 35px rgba(0, 0, 0, 0.35);
}

.image-card:hover .overlay-text {
    opacity: 1;
}

.image-card:hover .card-btn-container {
    opacity: 1;
    pointer-events: auto;
}

/* --- Profile Container & Dropdown --- */
.profile-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: rgba(83, 46, 51, 0.4); 
    padding: 6px 16px 6px 6px;
    border-radius: 50px;
    cursor: pointer;
    text-decoration: none;
    color: #eee1e2;
    font-weight: 600;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.profile-container:hover {
    transform: scale(1.20); 
    background-color: #c01557; 
    color: #ffffff;
    box-shadow: 0 0 22px rgba(230, 0, 35, 0.65); 
}

.profile-container:active {
    transform: scale(0.94);
}

.profile-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.profile-dropdown {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 250px;
    background-color: rgba(18, 10, 14, 0.6);
    backdrop-filter: blur(35px);
    -webkit-backdrop-filter: blur(35px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    padding: 14px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.65), inset 0 1px 2px rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) scale(0.2);
    transform-origin: center center;
}

.profile-dropdown.active {
    pointer-events: auto;
    visibility: visible;
    animation: dynamicIslandPopOut 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes dynamicIslandPopOut {
    0% {
        opacity: 0;
        top: 50%;
        transform: translate(-50%, -50%) scaleX(0.3) scaleY(0.3);
        border-radius: 50px;
    }
    55% {
        opacity: 1;
        top: 60px;
        transform: translate(-50%, 0) scaleX(1.06) scaleY(0.93);
        border-radius: 24px;
    }
    80% {
        transform: translate(-50%, 0) scaleX(0.97) scaleY(1.02);
    }
    100% {
        opacity: 1;
        top: 52px;
        transform: translate(-50%, 0) scaleX(1) scaleY(1);
        border-radius: 26px;
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: 18px;
    color: #eee1e2;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.dropdown-item svg {
    color: #bfaab1;
    transition: transform 0.2s ease, color 0.2s ease;
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.dropdown-item:hover svg {
    transform: scale(1.15);
    color: #ffffff;
}

.dropdown-divider {
    border: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 6px 6px;
}

.dropdown-item.logout-btn:hover {
    background-color: rgba(192, 21, 87, 0.2);
    color: #ff4a85;
}

.dropdown-item.logout-btn:hover svg {
    color: #ff4a85;
}


/* ==========================================================================
   PREVIEW PAGE STYLES
   ========================================================================== */

.preview-container {
    max-width: 600px;
    margin: 120px auto 40px auto;
    text-align: center;
    padding: 25px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.preview-img {
    max-width: 100%;
    height: auto;
    max-height: 65vh;
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,0.2);
}

.preview-title {
    color: #fff;
    margin: 20px 0;
    font-size: 1.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'Google Sans', sans-serif;
}

.support-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.telegram-btn {
    display: inline-block;
    background-color: #26a5e4;
    color: white;
    padding: 10px 24px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 25px;
    transition: all 0.3s ease;
    margin-bottom: 20px;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(38, 165, 228, 0.3);
}

.telegram-btn:hover {
    background-color: #1a8cc7;
    transform: scale(1.03);
}

.enjoy-text {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Action Buttons Wrapper */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
}

/* Final Save Button */
.final-download-btn {
    display: inline-block;
    width: 100%;
    max-width: 300px;
    background-color: #ff3366;
    color: white;
    padding: 14px 25px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(255, 51, 102, 0.4);
    text-align: center;
}

.final-download-btn:hover {
    background-color: #ff0044;
    transform: scale(1.03);
}

/* Add to Collection Button */
.collection-btn {
    display: inline-block;
    width: 100%;
    max-width: 300px;
    background-color: rgba(245, 244, 242, 0.116);
    color: white;
    padding: 14px 25px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(185, 183, 179, 0.178);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: center;
}

.collection-btn:hover {
    background-color: #bd823eab;
    transform: scale(1.03);
}

/* Collection Button SVG & Alignment */
.collection-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.collection-btn svg {
    width: 20px;
    height: 20px;
    fill: transparent;
    stroke: currentColor;
    stroke-width: 2;
    transition: fill 0.3s ease, stroke 0.3s ease, transform 0.2s ease;
}

/* Highlighted Active State */
.collection-btn.active svg {
    fill: #ff3366;
    stroke: #ff3366;
    transform: scale(1.2);
}

.collection-btn.active {
    background-color: #cfa225e8; /* Optional: active background color */
    box-shadow: 0 4px 15px rgba(190, 166, 27, 0.568);
}
/* --- Footer Styles --- */
footer {
    background-color: rgba(255, 255, 255, 0.06); 
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 30px 20px;
    margin-top: 60px; 
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between; 
    align-items: center;
    flex-wrap: wrap; 
    gap: 15px;
    font-family: 'Google Sans', sans-serif;
    color: #999797;
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    text-decoration: none;
    color: #a3a2a2;
    font-weight: 600;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-links a.footer-social:hover {
    color: #e60023; 
}

/* ==========================================================================
   LIVE PAGE VIDEO CAROUSEL
   ========================================================================== */

.video-carousel-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 30px auto;
    aspect-ratio: 16 / 9; /* Forces a perfect landscape layout */
    overflow: hidden;
    border-radius: 16px;
    background-color: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.25);
}

.carousel-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 10;
    pointer-events: auto;
}

.carousel-slide video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures the video fills the landscape box perfectly */
    border-radius: 16px;
}

/* Reusing your nav-btn and like-btn design language */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(83, 46, 51, 0.85);
    color: #eee1e2;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 20;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: background-color 0.3s ease, transform 0.2s cubic-bezier(0.25, 1.5, 0.5, 1);
}

.carousel-btn:hover {
    background-color: #c01557;
    color: #ffffff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 15px rgba(230, 0, 35, 0.7);
}

.prev-btn { left: 15px; }
.next-btn { right: 15px; }

/* Responsive adjustments */
@media (max-width: 600px) {
    .video-carousel-container {
        width: 94%;
        border-radius: 12px;
    }
    .carousel-btn {
        width: 35px;
        height: 35px;
    }
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE ENGINE
   ========================================================================== */

@media (max-width: 992px) {
    .top-nav {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 0;
        padding: 10px 18px;
        top: 10px;
    }

    .top-nav.scrolled {
        padding: 8px 18px;
    }

    /* Left cluster: hamburger + profile pill sit side by side */
    .nav-left {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
    }

    .brand h1 {
        font-size: 1.1rem;
    }

    .nav-hamburger {
        display: flex;
    }

    /* Profile pill — relative so dropdown anchors to it */
    #userProfileWrapper {
        position: relative;
        transform: none;
        left: auto;
    }

    .profile-container {
        padding: 5px 12px 5px 5px;
        gap: 7px;
        font-size: 0.85rem;
        min-height: 34px;
    }

    .profile-icon {
        width: 26px;
        height: 26px;
    }

    #profileName {
        max-width: 72px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Dropdown opens below the pill, anchored to its left edge */
    .profile-dropdown {
        left: 0;
        width: min(250px, 80vw);
        transform: scale(0.2);
        transform-origin: top left;
    }

    @keyframes dynamicIslandPopOut {
        0% {
            opacity: 0;
            top: 50%;
            transform: scaleX(0.3) scaleY(0.3);
            border-radius: 50px;
        }
        55% {
            opacity: 1;
            top: 60px;
            transform: scaleX(1.06) scaleY(0.93);
            border-radius: 24px;
        }
        80% {
            transform: scaleX(0.97) scaleY(1.02);
        }
        100% {
            opacity: 1;
            top: 52px;
            transform: scaleX(1) scaleY(1);
            border-radius: 26px;
        }
    }

   /* Hide the inline links — shown via hamburger dropdown */
    .nav-links {
        display: flex; 
        pointer-events: none;
        opacity: 0;
        visibility: hidden;
        transform: scale(0.3);
        
        /* CHANGED: Anchors the pop-out animation to the top-left (hamburger side) */
        transform-origin: top left; 

        flex-direction: column;
        position: absolute;
        top: calc(100% + 10px);
        left: 0;
        width: 100%;
        background: rgba(20, 10, 18, 0.92);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-radius: 16px;
        padding: 12px;
        gap: 6px;
        box-shadow: 0 12px 30px rgba(0,0,0,0.4);
        border: 1px solid rgba(255,255,255,0.08);
        z-index: 1050;
    }

    .nav-links.open {
        pointer-events: auto;
        visibility: visible;
        animation: mobileNavPopOut 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    }

    /* Add the matching bouncy keyframes specific to the mobile nav */
    @keyframes mobileNavPopOut {
        0% {
            opacity: 0;
            transform: scaleX(0.3) scaleY(0.3);
            border-radius: 50px;
        }
        55% {
            opacity: 1;
            transform: scaleX(1.02) scaleY(0.95);
            border-radius: 12px;
        }
        80% {
            transform: scaleX(0.98) scaleY(1.02);
        }
        100% {
            opacity: 1;
            transform: scaleX(1) scaleY(1);
            border-radius: 16px;
        }
    }

    .nav-btn {
        padding: 10px 18px;
        font-size: 0.95rem;
        width: 100%;
        text-align: center;
        border-radius: 12px;
    }

    .header-intro {
        margin-top: 110px;
    }

    .gallery {
        display: grid;
        grid-template-columns: repeat(3, 1fr); 
        perspective: none; 
        padding: 0 20px;
        gap: 15px;
    }

    .image-card {
        transform: none !important; 
        position: relative; 
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
        transition: box-shadow 0.4s cubic-bezier(0.25, 1, 0.5, 1), transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    }

    .image-card.visible {
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.45); 
    }

    .image-card img {
        height: 300px; 
        filter: blur(0); 
    }

    .image-card .overlay-text {
        opacity: 0;
        pointer-events: none; 
        transition: opacity 0.4s ease-in-out;
        font-size: 0.8rem;
    }

    .image-card.visible .overlay-text {
        opacity: 1;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        background: linear-gradient(to bottom, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.3) 70%, transparent 100%);
        display: flex;
        justify-content: center;
        align-items: flex-start;
        padding: 15px 10px 30px 10px;
        font-size: 0.2rem;
    }

    .image-card.visible .card-btn-container {
        opacity: 1;
        pointer-events: auto !important; 
        bottom: 15px;
    }
}

@media (max-width: 600px) {
    .top-nav {
        width: 94%;
        left: 3%;
        padding: 8px 12px;
    }

    .brand h1 {
        font-size: 1rem;
    }

   

    .logo {
        height: 28px;
    }

    .header-intro {
        margin-top: 90px;
        margin-left: 16px;
        margin-right: 16px;
        padding: 20px 15px 35px 15px;
    }

    .header-intro p {
        font-size: 1.1rem;
    }

    .btn { 
        margin-bottom: 15px;
        padding-left: 8px;
        padding-right: 8px;
    }

    .gallery {
        grid-template-columns: repeat(2, 1fr); 
        gap: 10px;
        padding: 0 15px;
        margin: 20px auto;
    }

    .image-card img {
        height: 220px; 
    }

    .image-card.visible .overlay-text {
        padding: 12px 10px 25px 10px;
        font-size: 0.95rem;
    }

    .image-card.visible .card-btn-container {
        bottom: 10px;
    }

    .card-btn {
        padding: 5px 14px;
        font-size: 0.75rem;
    }

    .like-btn {
        width: 32px;
        height: 32px;
    }

    .preview-container {
        margin-top: 140px;
        padding: 15px;
        width: 90%;
    }

    .preview-title {
        font-size: 1.4rem;
    }

    .final-download-btn,
    .collection-btn {
        font-size: 0.95rem;
        padding: 12px 20px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
    }
}


/* --- Profile Settings Modal --- */
.profile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* iOS Safari: recalculates as the toolbar shows/hides so this stays full-screen */
    background-color: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.profile-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.profile-card {
    width: 440px;
    max-width: 90%;
    background: rgba(22, 14, 22, 0.85);
    backdrop-filter: blur(35px);
    -webkit-backdrop-filter: blur(35px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    padding: 24px;
    color: #ffffff;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7), inset 0 1px 2px rgba(255, 255, 255, 0.15);
    transform: scale(0.92) translateY(15px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.profile-modal-overlay.active .profile-card {
    transform: scale(1) translateY(0);
}

/* Header */
.profile-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.back-btn {
    background: transparent;
    border: none;
    color: #bfaab1;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s ease;
}

.back-btn:hover {
    color: #ffffff;
}

.header-user-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.06);
    padding: 4px 14px 4px 4px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-mini-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.header-user-badge span {
    font-size: 0.88rem;
    font-weight: 600;
    color: #ffffff;
}

/* Body */
.profile-card-body {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
}

.profile-avatar-wrapper {
    flex-shrink: 0;
}

.modal-main-avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e01b6a;
    box-shadow: 0 0 18px rgba(224, 27, 106, 0.45);
}

.profile-inputs-group {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Desktop only — centered in nav */
@media (min-width: 993px) {
    #userProfileWrapper {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
}

.input-field-container label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: #99939d;
    margin-bottom: 5px;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(10, 6, 12, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 8px 14px;
}

.input-wrapper input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 500;
    transition: background-color 0.2s ease, padding 0.2s ease;
    border-radius: 8px;
}

.input-wrapper input:not([readonly]) {
    cursor: text;
}

.edit-input-btn {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px;
    transition: color 0.2s ease;
}

.edit-input-btn:hover {
    color: #ffffff;
}

/* Tags Container */
.tags-section {
    position: relative;
    background: rgba(10, 6, 12, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 16px 16px 20px 16px;
}

.tags-section h4 {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: #99939d;
    text-align: center;
    margin-bottom: 12px;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
    margin-bottom: 15px;
    justify-content: flex-start;
}

.tag-pill {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    display: inline-block;
    transition: background 0.2s ease;
}

.tag-pill:hover {
    background: rgba(255, 255, 255, 0.18);
}

a.tag-pill.link-pill {
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
}

a.tag-pill.link-pill:hover {
    background: #e01b6a;
    border-color: #e01b6a;
    box-shadow: 0 4px 10px rgba(224, 27, 106, 0.4);
    transform: translateY(-2px);
}

.floating-edit-btn {
    position: absolute;
    bottom: -10px;
    right: 12px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e01b6a;
    border: none;
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(224, 27, 106, 0.5);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.floating-edit-btn:hover {
    transform: scale(1.1);
    background: #ff2378;
}

#userTagsContainer span {
    display: inline-block;
    width: 100%;
    margin-bottom: 10px;
}

/* --- Tags Manager Sub-Modal Grid --- */
.tags-manager-card {
    display: flex;
    flex-direction: column;
}

.tags-selection-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    max-height: 250px;
    overflow-y: auto;
    padding: 10px;
}

.tags-selection-grid::-webkit-scrollbar {
    width: 6px;
}

.tags-selection-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.tag-option-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #99939d;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.tag-option-pill:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.tag-option-pill.selected {
    background: #e01b6a;
    border-color: #e01b6a;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(224, 27, 106, 0.3);
}

/* --- Fullscreen Collection Modal Overlay --- */
.collection-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* iOS Safari: recalculates as the toolbar shows/hides so this stays full-screen */
    background: rgba(12, 8, 14, 0.4); 
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 3000;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.collection-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.collection-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 24px 60px 24px;
    color: #ffffff;
    font-family: 'Google Sans', sans-serif;
}

/* Header Navbar */
.collection-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 30px; 
}

.collection-center-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.collection-item-count {
    font-size: 0.9rem;
    color: #bfaab1;
    font-weight: 500;
}

.collection-title-badge {
    display: flex;
    align-items: center;
    gap: 10px;
}

.collection-title-badge h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

/* Collection Gallery Grid */
.collection-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.collection-card {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.35s ease, border-color 0.35s ease;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.collection-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.5);
    border-color: rgba(224, 27, 106, 0.5);
}

.collection-card img {
    width: 100%;
    height: 340px;
    object-fit: cover;
    display: block;
}

.collection-card .card-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 16px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    display: flex;
    justify-content: flex-end; /* Changed from space-between */
    align-items: center;
}

.collection-card .card-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.remove-collection-btn {
    background: rgba(192, 21, 87, 0.8);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.remove-collection-btn:hover {
    background: #e01b6a;
    transform: scale(1.15);
}

/* Empty Collection Placeholder */
.empty-collection-box {
    grid-column: 1 / -1;
    text-align: center;
    padding: 70px 20px;
    color: #99939d;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 24px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
}

.empty-collection-box svg {
    color: #e01b6a;
    margin-bottom: 14px;
    opacity: 0.8;
}

.empty-collection-box h4 {
    font-size: 1.1rem;
    color: #ffffff;
    margin-bottom: 8px;
}
/* Mobile View: Force exactly 2 image cards per row in the collection */
@media (max-width: 768px) {
    .collection-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columns on mobile */
    gap: 12px;
    padding: 15px 0;
}

.collection-card {
    position: relative;
    width: 100%;
    /* Forces tall vertical portrait shape (9:14 ratio) */
    aspect-ratio: 9 / 14; 
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
}

.collection-card img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Fills the portrait box without stretching the image */
    display: block;
}

    .collection-card .card-title {
        font-size: 0.75rem; /* Shrink the title text a bit more for small screens */
    }
    
    .collection-card .card-footer {
        padding: 6px 8px;
    }
}

/* Prevents scrolling on the background body */
body.no-scroll {
    overflow: hidden !important;
}

* {
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

/* --- Hide Only Brand Header Name on Mobile When Signed In --- */
@media (max-width: 992px) {
  .top-nav:has(#userProfileWrapper[style*="display: flex"]) .brand h1 {
    display: none;
  }
}