:root {
    --gap: 15px;
    --overlay-bg: rgba(0, 0, 0, 0.8);
    
}



body.dark-theme {
    background-color: var(--bg-color-dark);
    color: var(--text-color-dark);
}

.filters {margin: 10px;}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--gap);
    padding: var(--gap);
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.3s;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Іконка сердечка */
.card-heart {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    z-index: 3;
    transition: fill 0.3s;
}

.card-heart.liked svg path {
    fill: #ff0000; /* Червоний колір при лайку */
}

/* Іконка збільшення */
.magnify-icon {
    position: absolute;
    top: 5px;
    right: 8px;
    color: black;
    cursor: pointer;
    z-index: 2;
}

/* Стилі для трикутного фону сердечка */
.card-heart::before {
    content: '';
    position: absolute;
    top: -7px;
    left: -10px;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    clip-path: polygon(0 0, 100% 0, 0 100%);
    z-index: -1;
    transition: background 0.3s;
}



/* Стилі для трикутного фону лупи */
.magnify-icon::before {
    content: '';
    position: absolute;
    top: -7px;
    right: -10px;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    clip-path: polygon(100% 0, 0 0, 100% 100%);
    z-index: -1;
    transition: background 0.3s;
}

/* Темна тема */
body.dark-theme .card-heart::before,
body.dark-theme .magnify-icon::before {
    background: rgba(0, 0, 0, 0.7);
}

/* Ховер-ефекти */
.card-heart:hover::before,
.magnify-icon:hover::before {
    background: rgba(255, 255, 255, 0.95);
}

body.dark-theme .card-heart:hover::before,
body.dark-theme .magnify-icon:hover::before {
    background: rgba(0, 0, 0, 0.8);
}

/* Шторка з інформацією */
.overlay {
    position: absolute;
    bottom: -100%;
    left: 0;
    right: 0;
    background: var(--overlay-bg);
    color: white;
    padding: 15px;
    transition: bottom 0.3s;
}

.gallery-item:hover .overlay,
.gallery-item:focus-within .overlay {
    bottom: 0;
}

.overlay-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Фіксований блок для поширення */
#fixed-share-container {
    position: fixed;
    bottom: 300px;
    right: 10px;
    background: var(--bg-color-light);
    border: 1px solid var(--border-color-light);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
}

body.dark-theme #fixed-share-container {
    background: var(--bg-color-dark);
    border-color: var(--border-color-dark);
}

#fixed-share-container.hidden {
    display: none;
}

#fixed-share-container.visible {
    display: flex;
}

.like-info {
    color: black;
    display: flex;
    align-items: center;
    font-size: 20px;
    margin-bottom: 10px;
}

.like-info .heart {
    margin-right: 5px;
}

.like-info img#copy-btn {
    width: 24px;
    height: 24px;
    cursor: pointer;
    margin-left: 10px;
}



.action-buttons {
    position: relative;
    text-align: center;
}

.action-buttons img#share-btn {
    width: 24px;
    height: 24px;
    cursor: pointer;
}

/* Випадаюче меню для соцмереж */

.gallery-social-dropdown {
    position: absolute;
    top: 40px;
    right: -20px;
    background: var(--bg-color-light);
    border: 1px solid var(--border-color-light);
    border-radius: 6px;
    padding: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    z-index: 1500;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

body.dark-theme .gallery-social-dropdown {
    background: var(--bg-color-dark);
    border-color: var(--border-color-dark);
}

.gallery-social-dropdown.hidden {
    display: none;
}

.gallery-social-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    transition: background 0.2s ease-in-out;
}

.gallery-social-option img {
    width: 32px;
    height: 32px;
}

.gallery-social-option:hover {
    background: var(--input-color-light);
    border-radius: 4px;
}

body.dark-theme .gallery-social-option:hover {
    background: var(--input-color-dark);
}


/* Сповіщення */
.notification {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: #4a6a0c;
    color: var(--text-color-dark);
    padding: 10px 20px;
    border-radius: 5px;
    opacity: 0.9;
    z-index: 1000;
    transition: opacity 0.5s ease-out;
}

.notification.fade-out {
    opacity: 0;
}

/* Модальне вікно 
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.modal-close {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}
*/

@media (max-width: 768px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .overlay {
        bottom: -100%;
    }

    .gallery-item:focus-within .overlay {
        bottom: 0;
    }
}