/* Auto Gallery Pro - Frontend Styles */

/* === GALERIE === */
.agp-auto-gallery {
    margin: 2rem 0;
    padding-top: 30px;
}

.agp-gallery-title {
    font-size: 30px;
    font-weight: 300;
    margin: 0 0 1.5rem 0;
    color: #1a1a1a;
}

.agp-gallery-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    /* OPRAVA: Aplikace dynamických hodnot z nastavení */
    gap: var(--agp-gap, 15px);
    justify-content: var(--agp-justify, flex-start);
}

.agp-gallery-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 20px 25px -5px, rgba(0, 0, 0, 0.04) 0px 10px 10px -5px;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    /* OPRAVA: Aplikace dynamických hodnot z nastavení */
    width: var(--agp-thumb-width, 350px);
    height: var(--agp-thumb-height, 250px);
    border-radius: var(--agp-radius, 8px);
    border: 1px solid white;
}

.agp-gallery-item:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1), 0 3px 6px rgba(0, 0, 0, 0.1);
}

.agp-lightbox-trigger {
    display: block;
    width: 100%;
    height: 100%;
}

.agp-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.agp-gallery-item:hover .agp-thumbnail {
    transform: scale(1.08);
}

/* === OVERLAY === */
.agp-gallery-overlay {
	display:none;
    visibility: hidden;
    /*position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    backdrop-filter: blur(2px);*/
}

.agp-gallery-item:hover .agp-gallery-overlay {
    opacity: 1;
}

.agp-overlay-icon {
    display:none;
    visibility: hidden;
}

.agp-overlay-icon svg {
    width: 2rem;
    height: 2rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.agp-overlay-text {
    display:none;
    visibility: hidden;
}

/* === LIGHTBOX === */
body.agp-lightbox-open {
    overflow: hidden;
}

.agp-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 10, 0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.agp-lightbox-overlay.agp-visible {
    opacity: 1;
}

.agp-lightbox-container {
    position: relative;
    max-width: calc(100vw - 4rem);
    max-height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.agp-lightbox-content {
    position: relative;
}

.agp-lightbox-image {
    max-width: 100%;
    max-height: calc(100vh - 8rem);
    display: block;
    border-radius: 4px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.agp-lightbox-image.agp-loaded {
    opacity: 1;
    transform: scale(1);
}

/* === OVLÁDACÍ PRVKY === */
.agp-lightbox-controls button {
    position: absolute;
    background: rgba(30, 30, 30, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.agp-lightbox-controls button:hover {
    background: rgba(255, 255, 255, 0.15);
}

.agp-lightbox-close {
    top: -1.75rem;
    right: -1.75rem;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.5rem;
    font-weight: 300;
}

.agp-lightbox-prev,
.agp-lightbox-next {
    top: 50%;
    width: 3rem;
    height: 3rem;
}

.agp-lightbox-prev { left: -4rem; }
.agp-lightbox-next { right: -4rem; }

.agp-lightbox-prev svg, .agp-lightbox-next svg {
    width: 1.5rem;
    height: 1.5rem;
}

/* === INFORMAČNÍ PRVKY === */
.agp-lightbox-counter {
    position: absolute;
    top: -2.5rem;
    left: 0;
    color: #ccc;
    font-size: 0.9rem;
}

.agp-lightbox-caption {
    margin-top: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.5;
    text-align: center;
    max-width: 80vw;
    opacity: 0;
    transform: translateY(1rem);
    transition: all 0.3s ease 0.1s;
}

.agp-lightbox-caption.agp-visible {
    opacity: 1;
    transform: translateY(0);
}

/* === LOADER === */
.agp-lightbox-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: agp-spin 1s linear infinite;
}

@keyframes agp-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* === RESPONZIVNÍ DESIGN === */
@media (max-width: 900px) {
    .agp-lightbox-prev { left: 0.5rem; }
    .agp-lightbox-next { right: 0.5rem; }
    .agp-lightbox-close { top: 0.5rem; right: 0.5rem; background: rgba(10,10,10,0.8); }
    .agp-lightbox-container { max-width: 100vw; max-height: 100vh; }
    .agp-lightbox-image { max-height: calc(100vh - 6rem); border-radius: 0; }
}

@media (max-width: 768px) {
    .agp-gallery-grid {
        justify-content: center;
    }
}