/* ==========================================================================
   NARPHAM CLEAN SHOWCASE STYLING (No border, No shadow, No AI slop)
   ========================================================================== */

/* Showcase Grid (Centered Album Cards) */
.artworks-showcase-grid {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 3.5rem;
    width: 100%;
    margin-top: 1.5rem;
    box-sizing: border-box;
    flex-wrap: wrap;
}

/* Base Showcase Item (Pure Flat, Borderless, Shadowless) */
.art-showcase-item {
    width: 100%;
    max-width: 280px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: var(--cursor-pointer);
    user-select: none;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.art-showcase-item:hover {
    transform: translateY(-6px);
}

/* Phone-style Album Folder Preview */
.album-folder-cover,
.album-folder-preview {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: rgba(139, 211, 252, 0.08);
    border-radius: 18px;
    padding: 0.65rem;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none !important;
    box-shadow: none !important;
    transition: background 0.3s ease, transform 0.3s ease;
}

body.dark-theme .album-folder-cover,
body.dark-theme .album-folder-preview {
    background: rgba(255, 255, 255, 0.05);
}

.album-folder-card:hover .album-folder-cover,
.album-folder-card:hover .album-folder-preview {
    background: rgba(139, 211, 252, 0.16);
    transform: scale(1.03);
}

body.dark-theme .album-folder-card:hover .album-folder-cover,
body.dark-theme .album-folder-card:hover .album-folder-preview {
    background: rgba(255, 255, 255, 0.09);
}

/* 2x2 Grid inside the folder icon */
.album-folder-mini-grid,
.album-folder-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    width: 100%;
    height: 100%;
}

.album-folder-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 8px;
    aspect-ratio: 1 / 1;
}

body.dark-theme .album-folder-thumb {
    background: rgba(255, 255, 255, 0.03);
}

.album-folder-thumb img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.album-folder-card:hover .album-folder-thumb img {
    transform: scale(1.08);
}

/* Standalone Artwork Frame */
.standalone-art-frame {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0.5rem;
    box-sizing: border-box;
    overflow: hidden;
}

.standalone-art-img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
    border: none !important;
    box-shadow: none !important;
}

.standalone-card:hover .standalone-art-img {
    transform: scale(1.08) translateY(-4px);
}

/* Item Text Information */
.art-card-info {
    margin-top: 0.9rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.art-card-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

body.dark-theme .art-card-name {
    color: #ffffff;
}

.art-card-author-caption {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 0;
}

.art-card-count {
    font-size: 0.76rem;
    color: var(--text-muted);
    opacity: 0.8;
}

/* ==========================================================================
   ALBUM EXPANDED FOLDER MODAL (Phone folder opens to reveal child apps/photos)
   ========================================================================== */
.album-folder-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.album-folder-modal.active {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.album-folder-content {
    background: var(--bg-card) !important;
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    border-radius: 8px !important; /* Subtle 8px radius per feedback */
    border: none !important;
    box-shadow: none !important;
    padding: 1.8rem !important;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.96);
    transition: transform 0.28s cubic-bezier(0.25, 1, 0.5, 1);
}

.album-folder-modal.active .album-folder-content {
    transform: scale(1);
}

.album-folder-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.album-folder-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0;
}

body.dark-theme .album-folder-title {
    color: #ffffff;
}

.album-folder-caption {
    font-size: 0.92rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 0.25rem 0 0;
}

.album-folder-body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 1.25rem 0.25rem;
    flex: 1 1 auto;
    min-height: 0 !important; /* Critical for flex child scrollability */
}

/* Child Artworks Grid inside Album */
.album-children-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.album-child-item {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 211, 252, 0.06);
    border-radius: 8px;
    cursor: var(--cursor-pointer);
    padding: 0.75rem;
    box-sizing: border-box;
    border: none !important;
    box-shadow: none !important;
    transition: transform 0.25s ease, background 0.2s ease;
}

body.dark-theme .album-child-item {
    background: rgba(255, 255, 255, 0.04);
}

.album-child-item:hover {
    transform: scale(1.06);
    background: rgba(139, 211, 252, 0.14);
}

body.dark-theme .album-child-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.album-child-item img {
    max-width: 92%;
    max-height: 92%;
    object-fit: contain;
    transition: transform 0.25s ease;
}

/* ==========================================================================
   LIGHTBOX SINGLE IMAGE VIEWER (8px subtle radius, smooth transitions)
   ========================================================================== */
.art-lightbox-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1100;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.art-lightbox-modal.active {
    display: flex !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.art-lightbox-content {
    background: var(--bg-card) !important;
    width: 100%;
    max-width: 780px;
    border-radius: 8px !important; /* Clean 8px radius per feedback */
    border: none !important;
    box-shadow: none !important;
    padding: 1.25rem 1.5rem !important;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transform: scale(0.96);
    transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.art-lightbox-modal.active .art-lightbox-content {
    transform: scale(1);
}

.art-lightbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.art-lightbox-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff; /* Clean white color per feedback */
}

body:not(.dark-theme) .art-lightbox-title {
    color: var(--text-dark);
}

.art-lightbox-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 440px;
    position: relative;
    overflow: hidden;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.art-lightbox-img {
    max-width: 92%;
    max-height: 430px;
    object-fit: contain;
    opacity: 1;
    transform: scale(1);
    transition: opacity 0.25s ease-out, transform 0.25s ease-out; /* Smooth slide/change transition */
    user-select: none;
    -webkit-user-drag: none;
}

.art-lightbox-img.changing {
    opacity: 0;
    transform: scale(0.97);
}

.art-lightbox-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border-color);
}

.art-lightbox-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.art-lightbox-nav-btn {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--bg-main);
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: var(--cursor-pointer);
    transition: background 0.2s ease, color 0.2s ease;
    font-size: 0.9rem;
}

body.dark-theme .art-lightbox-nav-btn {
    color: #ffffff;
}

.art-lightbox-nav-btn:hover {
    background: var(--primary-lime);
    color: #ffffff;
}

body.dark-theme .art-lightbox-nav-btn:hover {
    color: #0f172a;
}

.art-lightbox-nav-counter {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0 0.4rem;
}

.art-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-lime);
    color: #ffffff !important;
    padding: 0.55rem 1.15rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    cursor: var(--cursor-pointer);
    transition: opacity 0.2s ease;
    border: none !important;
}

body.dark-theme .art-download-btn {
    color: #0f172a !important;
}

.art-download-btn:hover {
    opacity: 0.88;
}

/* Responsive adjustments */
@media screen and (max-width: 1024px) {
    .artworks-showcase-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    .album-children-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media screen and (max-width: 600px) {
    .artworks-showcase-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    .album-children-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.85rem;
    }
    .art-lightbox-preview {
        min-height: 280px;
    }
    .art-lightbox-img {
        max-height: 270px;
    }
}

#falling-particles-canvas, .falling-particles-canvas { display: none !important; }


/* ==========================================================================
   INLINE PHOTO LIBRARY VIEW (Google Photos-style alternating mosaic)
   ========================================================================== */
.album-inline-gallery {
    display: none;
    width: 100%;
    margin-top: 1.5rem;
    animation: fadeInGallery 0.35s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

.album-inline-gallery.active {
    display: block !important;
}

@keyframes fadeInGallery {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.artworks-showcase-grid.is-hidden {
    display: none !important;
}

/* Gallery Toolbar with Back Button */
.gallery-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.2rem 1.6rem;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid var(--border-color);
}

.gallery-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-dark);
    background: rgba(139, 211, 252, 0.12);
    border: none !important;
    box-shadow: none !important;
    border-radius: 8px;
    padding: 0.6rem 1.25rem;
    cursor: var(--cursor-pointer);
    user-select: none;
    transition: background 0.22s ease, transform 0.22s ease, color 0.22s ease;
}

.gallery-back-btn:hover {
    background: var(--primary-lime);
    color: #1e293b;
    transform: translateX(-4px);
}

body.dark-theme .gallery-back-btn {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

body.dark-theme .gallery-back-btn:hover {
    background: var(--primary-lime);
    color: #1e293b;
}

.gallery-title-wrap {
    text-align: right;
}

.gallery-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0;
}

body.dark-theme .gallery-title {
    color: #ffffff;
}

.gallery-caption {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
    display: block;
    margin-top: 0.2rem;
}

/* Google Photos / Justified Mosaic Photo Gallery */
.google-photos-gallery {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
}

/* Row in Justified Mosaic */
.gallery-mosaic-row {
    display: flex;
    flex-direction: row;
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
    align-items: stretch;
}

.gallery-mosaic-row.is-last-row {
    justify-content: flex-start;
}

.photo-tile {
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    cursor: var(--cursor-pointer);
    background: rgba(139, 211, 252, 0.06);
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block;
    box-sizing: border-box;
    transition: filter 0.22s ease, transform 0.25s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.25s ease;
    will-change: transform;
}

body.dark-theme .photo-tile {
    background: rgba(255, 255, 255, 0.04);
}

.photo-tile:hover {
    filter: brightness(1.06);
    transform: scale(1.02);
    z-index: 5;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

body.dark-theme .photo-tile:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.photo-tile img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.photo-tile:hover img {
    transform: scale(1.03);
}

/* Fallback if photos rendered without row wrapper */
.google-photos-gallery:not(:has(.gallery-mosaic-row)) {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.google-photos-gallery:not(:has(.gallery-mosaic-row)) .photo-tile {
    height: 220px;
    flex-grow: 1;
}

/* Responsive Gaps */
@media screen and (max-width: 600px) {
    .google-photos-gallery,
    .gallery-mosaic-row {
        gap: 3px;
    }
}

@media screen and (max-width: 400px) {
    .google-photos-gallery,
    .gallery-mosaic-row {
        gap: 2px;
    }
}
