﻿.gallery-root {
    position: relative;
    width: 100%;
    height: 100svh;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.6s cubic-bezier(0.2, 0.9, 0.1, 1.1), width 0.4s ease-out;
    transform-origin: left center;
    will-change: transform;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    /*justify-content: center;*/
    align-items: center;
    gap: 0;
    background-color: #333;
    /*background: linear-gradient(to right, #E8E2DB, #547792);*/
    /*background: linear-gradient(to bottom, #FFF2EF 30%, #F7A5A5 70%);*/
}


    .gallery-root.shrink {
        height: 100svh;
        position: relative;
        transform: scale(0.9) translateX(2.5svw) translateY(0);
        width: 91svw;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08), 0 15px 35px rgba(0, 0, 0, 0.12), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
    }

    .gallery-root::-webkit-scrollbar {
        width: 6px;
        height: 4px;
    }

    .gallery-root::-webkit-scrollbar-thumb {
        background-color: var(--main-color);
        border-radius: 4px;
    }

    .gallery-root h1 {
        flex: 0 0 auto;
        margin-top: 1svh;
        color: var(--gradient1);
        display: none;
        /*font-size: 2rem !important;*/
    }

/*#region FOLDERS */

.folders {
    /*flex: 1;*/
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: .25rem;
    width: 100%;
    box-sizing: border-box;
    padding-top: 5rem;
    height: auto;
    /*border: 3px solid red;*/
}



.folder-card {
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: .75rem .25rem;
    gap: .5rem;
    height: 175px;
}

.image-wrapper {
    width: 120px;
    height: 120px;
    aspect-ratio: 1 / 1;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: visible;
    border-radius: 50%;
    display: block;
    transition: transform 0.3s ease;
}

.folder-name {
    margin: 0;
    font-size: .7rem;
    color: var(--main-color);
    font-weight: 100;
    text-align: right;
}

.image-wrapper:hover {
    transform: scale(1.1);
    z-index: 10;
}

.folder-details {
    background-color: #f8f9fa;
    background-color: transparent;
}

@media (max-width: 568px) {
    .folders {
        grid-template-columns: repeat(auto-fill, minmax(125px, 1fr));
    }

    .image-wrapper {
        width: 80px;
        height: 80px;
        aspect-ratio: 1 / 1;
    }

    .folder-name {
        font-size: .6rem;
    }
}







/*#endregion */


/*#region ADMIN */


.folder-delete {
    position: absolute;
    top: 0;
    right: 0;
    width: 28px;
    height: 28px;
    background-color: #ff4d4d;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
    z-index: 10;
    border: 2px solid white;
    line-height: 1;
    padding-bottom: 4px;
}

    .folder-delete:hover {
        background-color: #ff1a1a;
        transform: scale(1.1);
    }

.folder-delete {
    user-select: none;
}

.action-buttons {
    position: fixed;
    top: 6svh;
    right: 1svw;
    display: flex;
    gap: 1rem;
    align-items: center;
    z-index: 6;
    cursor: pointer;
    font-size: 0.6rem;
}

.action-btn {
    background-color: black;
    cursor: pointer;
    border: none;
    color: black;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

    .action-btn:hover {
        border: 1px solid black;
    }

.header-left {
    position: fixed;
    top: 1svh;
    left: 7.5svw;
    display: flex;
    gap: 1rem;
    align-items: center;
    z-index: 6;
    
}

.close-album,
.delete-album-btn,
.add-video-btn,
.add-to-album-btn {
    background-color: transparent;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    padding: 12px;
    transition: all 0.2s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white;

}

    .delete-album-btn:hover,
    .add-video-btn:hover,
    .add-to-album-btn:hover {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.35), 0 6px 18px rgba(0, 0, 0, 0.25);
        transform: translateY(-1px);
    }

/*#endregion */
.album-viewer {
    position: relative;
    width: 100%;
    height: 100svh;
    margin: 0;
    padding: 0;
    padding-top: 10svh;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.6s cubic-bezier(0.2, 0.9, 0.1, 1.1), width 0.4s ease-out;
    transform-origin: left center;
    will-change: transform;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    background: #333;
}

    .album-viewer .page-title {
        color: red;
    }

    .album-viewer.shrink {
        height: 100svh;
        position: relative;
        transform: scale(0.9) translateX(2.5svw) translateY(0);
        width: 91svw;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08), 0 15px 35px rgba(0, 0, 0, 0.12), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
    }

    .album-viewer::-webkit-scrollbar {
        width: 6px;
        height: 4px;
    }

    .album-viewer::-webkit-scrollbar-thumb {
        background-color: var(--main-color);
        border-radius: 4px;
    }
/*
.page-title {
    position: absolute;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 7.5svh;
    min-width: 300px;
}

    .gallery-root h1,
    .page-title span {
        font-family: amaticasc-regular;
        font-size: 1.5rem;
        color: var(--rosy-white);
        opacity: 1;
        transition: opacity 0.4s ease;
    }

        .page-title span::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 10%;
            height: 2%;
            background: var(--gradient1);
        }*/


.vimeo-container {
    flex: 0 0 auto;
    width: 100svw;
    max-width: 100%;
    position: relative;
    min-height: 200px;
    margin: 0;
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

    .vimeo-container.active {
        display: flex;
    }

.video-item {
    width: 33%;
    min-width: 350px;
}

    .video-item iframe {
        width: 100%;
        height: 100%;
        border: none;
    }

.album-scroll {
    flex-grow: 1;
    width: 100%;
}

.album-images {
    height: auto;
    gap: 0;
    margin: 0;
    padding: 0;
    column-gap: 0;
}

    .album-images img {
        width: 100%;
        display: block;
        transition: transform 0.3s;
        cursor: pointer;
        break-inside: avoid;
    }

        .album-images img:hover {
            transform: scale(.99);
        }

        .album-images img.small,
        .album-images img.medium {
            height: 250px;
            object-fit: cover;
        }

        album-images img.large,
        .album-images img.tall {
            height: 500px;
            object-fit: cover;
        }

        .album-images img.wide {
            column-span: all;
            height: 250px;
            object-fit: cover;
            width: 100%;
        }


.fullscreen-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100svh;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    overflow: hidden;
    touch-action: none;
}

    .fullscreen-viewer.active {
        opacity: 1;
        pointer-events: all;
    }

.fullscreen-image {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    touch-action: none;
    user-select: none;
    -webkit-user-drag: none;
    will-change: transform;
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
    }

    to {
        transform: scale(1);
    }
}

.nav-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: white;
    font-size: 30px;
    width: 50px;
    height: 100px;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.2s ease;
}

.prev-button {
    left: 20px;
}

.next-button {
    right: 20px;
}

.image-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 15px;
    border-radius: 20px;
    z-index: 1001;
}

.close-fullscreen {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    z-index: 1001;
    text-shadow: 0 0 5px black;
}



.gallery-root.swiping .gallery-container,
.gallery-root.swiping .album-viewer {
    transition: none !important;
}

.gallery-root.album-open .gallery-container {
    transform: translateX(-100%);
}

.gallery-root.album-open .album-viewer {
    transform: translateX(-100%);
}

.gallery-root.album-open .close-album {
    display: block;
    opacity: 1;
    pointer-events: all;
}



.image-item {
    position: relative;
    display: block;
    break-inside: avoid;
    margin-bottom: 0;
}

    .image-item img {
        width: 100%;
        display: block;
    }

/*ADMIN*/
.image-checkbox {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    z-index: 2;
    border: 1px solid white;
}



/*#region MODEL */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 400px;
    border-radius: 8px;
    direction: rtl;
}

.close {
    color: #aaa;
    float: left;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.form-group {
    margin-bottom: 15px;
}

    .form-group label {
        display: block;
        margin-bottom: 5px;
        font-weight: bold;
    }

.form-control {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.status-message {
    margin-top: 15px;
}

.success {
    color: green;
    font-weight: bold;
}

.error {
    color: red;
    font-weight: bold;
}

.info {
    color: blue;
    font-weight: bold;
}

/*#endregion */



.album-images {
    column-count: 5;
}


@media (max-width: 1000px) {
    .album-images {
        column-count: 4;
    }
}

@media (max-width: 768px) {
    .album-images {
        column-count: 3;
    }
}

@media (max-width: 1000px) {
    .gallery-root.shrink,
    .album-viewer.shrink {
        height: 100vh;
        position: relative;
        transform: scale(1) translateX(0) translateY(0);
        width: 70vw;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08), 0 15px 35px rgba(0, 0, 0, 0.12), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
    }


    .side-menu {
        width: 30vw;
        padding: 0;
    }

    .video-item {
        margin: 0;
        width: 50%;
    }

    .album-viewer.shrink .album-images {
        column-count: 1 !important;
    }

        .album-viewer.shrink .album-images img.small,
        .album-viewer.shrink .album-images img.medium {
            height: 400px;
        }

    .album-images img.small, .album-images img.medium {
        height: 200px;
    }
    /*ADMIN*/
    .header-left {
        position: fixed;
        top: 6.5svh;
        left: 0;
        display: flex;
        gap: 1rem;
        align-items: center;
        justify-content: center;
        width: 100svw;
    }

    .close-album,
    .delete-album-btn,
    .add-video-btn,
    .add-to-album-btn {
        padding: 3px;
    }
}

@media (max-width: 600px) {
    .gallery-root.shrink,
    .album-viewer.shrink {
        width: 65vw;
    }

    .side-menu {
        width: 35vw;
    }

    album-images img.large, .album-images img.tall {
        height: 200px;
    }

    .album-images img.small, .album-images img.medium {
        height: 125px;
    }

    .album-viewer.shrink .album-images img.small, .album-images img.medium {
        /*height: 200px;*/
    }


    .album-viewer.shrink .album-images img.small,
    .album-viewer.shrink .album-images img.medium {
        height: 200px;
    }
}

@media (max-width: 768px) and (pointer: coarse), (max-width: 768px) and (hover: none) {
    .gallery-root.shrink,
    .album-viewer.shrink {
        width: 65vw;
    }

    .side-menu {
        width: 35vw;
    }


    .album-viewer.shrink .album-images {
        column-count: 1 !important;
    }

    .album-viewer::-webkit-scrollbar {
        display: none;
        width: 0;
    }

    .nav-button {
        display: none !important;
    }

        .nav-button.prev-button,
        .nav-button.next-button {
            display: none !important;
        }

    .close-album {
        display: none !important;
    }

    .folders {
        margin-top: 10svh;
        height: auto;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: .15rem;
        padding: 0 4%;
    }

    .folder-item {
        position: relative;
        height: 17.5dvh;
        overflow: hidden;
        cursor: pointer;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        transition: transform 0.3s ease;
        background-size: cover;
        background-position: top center;
    }


    .folder-card {
        height: 125px;
    }

    .vimeo-container {
        flex: 0 0 35svh;
        /*min-width: 100px;*/
        width: 100%;
        max-width: 100%;
        position: relative;
        min-height: 30svh;
        margin: 0;
        padding: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        overflow: hidden;
    }

    .video-item {
        min-width: 325px;
    }

    .album-viewer.shrink .video-item {
        width: 90%;
        min-width: 80px;
    }

    .album-viewer.shrink .page-title {
        width: 100%;
        min-width: 80px;
    }
}
