/*
Plugin Name: Thumbnail Gallery
Description: Styles for the Thumbnail Gallery plugin.
Version: 1.1
Author: TRANSLATIONAL
*/

.thumbnail-gallery-controls {
    margin-bottom: 20px;
}

.filter-button {
    background-color: #FFFFFF;
    color: #111111;
    border: 1px solid #111111;
    padding: 1rem 2.25rem;
    cursor: pointer;
    margin-right: 5px;
    border-radius: 5px;
    font-size: 1rem;
}

.filter-button.active {
    background-color: #111111;
    color: #FFFFFF;
    border-color: #111111;
}

#view-slideshow-btn {
    background-color: #fc3682;
    color: #111111;
    border: none;
    padding: 1rem 2.25rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    animation: pulse 2s infinite;
    transition: background-color 0.3s;
}

#view-slideshow-btn:hover {
    background-color: color-mix(in srgb, #2282dd 85%, transparent);
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.thumbnail-gallery {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-gap: 15px;
    grid-template-columns: repeat(4, 1fr);
}

.thumbnail-item {
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
    transition: 0.3s;
}

.thumbnail-item:hover {
    box-shadow: 0 8px 16px 0 rgba(0,0,0,0.2);
}

.thumbnail-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* Admin Page Styles */
#col-container {
    display: flex;
}

#col-left {
    flex: 1;
    margin-right: 20px;
}

#col-right {
    flex: 2;
}

.col-wrap {
    background: #fff;
    border: 1px solid #c3c4c7;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    padding: 20px;
    margin-bottom: 20px;
}

.form-field {
    margin-bottom: 15px;
}

.form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-field textarea,
.form-field input[type="text"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
}

#approved-thumbnails ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    grid-gap: 15px;
}

#approved-thumbnails li {
    position: relative;
}

#approved-thumbnails li img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

#approved-thumbnails li .delete-thumbnail {
    position: absolute;
    top: 5px;
    right: 5px;
    background: red;
    color: white;
    text-decoration: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    line-height: 24px;
    text-align: center;
}

#edit-tags-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

#edit-tags-modal > div {
    background: white;
    width: 400px;
    margin: 100px auto;
    padding: 20px;
    border-radius: 5px;
}

/* Slideshow Overlay Styles */
#thumbnail-gallery-slideshow-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); /* Darkened background */
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slideshow-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.close-slideshow {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-slideshow:hover,
.close-slideshow:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.slideshow-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden; /* For zoom functionality */
}

.slideshow-image {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    display: block;
    margin: auto;
    transition: transform 0.3s ease; /* For smooth zoom */
    margin-right: 10px; /* Add padding between images */
}

.slideshow-image:last-child {
    margin-right: 0; /* No margin for the last image */
}

.slideshow-image-container.grid {
    display: grid;
    grid-gap: 10px;
}

.slideshow-image-container.grid.grid-2x2 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.slideshow-image-container.grid.grid-2x3 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

/* Next & previous buttons */
.prev-slide, .next-slide {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -22px;
    color: white;
    font-weight: bold;
    font-size: 20px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    -webkit-user-select: none;
}

.prev-slide {
    left: -50px;
}

/* Position the "next button" to the right */
.next-slide {
    right: -50px;
    border-radius: 3px 0 0 3px;
}

/* On hover, add a black background color with a little bit see-through */
.prev-slide:hover, .next-slide:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.slideshow-controls {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.slideshow-controls button,
.slideshow-controls select {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: #0073aa;
    color: white;
}

.slideshow-controls button:hover,
.slideshow-controls select:hover {
    background-color: #005177;
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
    #view-slideshow-btn {
        display: none;
    }

    .thumbnail-gallery {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* Navigation Styles */
.wp-block-navigation .wp-block-navigation-item .wp-block-navigation-item__content {
    font-family: var(--wp--preset--font-family--manrope);
    font-size: var(--wp--preset--font-size--medium);
    font-weight: 300;
    letter-spacing: -0.1px;
    line-height: 1.4;
    color: var(--wp--preset--color--contrast);
    text-decoration: none;
}

.wp-block-navigation .wp-block-navigation-item .wp-block-navigation-item__content:hover {
    text-decoration: underline;
}