/* Publiskas foto galerijas grid un lightbox stili. */

/* ===== ANIMĀCIJAS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.15s; }
.gallery-item:nth-child(3) { animation-delay: 0.2s; }
.gallery-item:nth-child(4) { animation-delay: 0.25s; }
.gallery-item:nth-child(5) { animation-delay: 0.3s; }
.gallery-item:nth-child(6) { animation-delay: 0.35s; }
.gallery-item:nth-child(7) { animation-delay: 0.4s; }
.gallery-item:nth-child(8) { animation-delay: 0.45s; }
.gallery-item:nth-child(9) { animation-delay: 0.5s; }
.gallery-item:nth-child(10) { animation-delay: 0.55s; }
.gallery-item:nth-child(11) { animation-delay: 0.6s; }
.gallery-item:nth-child(12) { animation-delay: 0.65s; }
.gallery-item:nth-child(13) { animation-delay: 0.7s; }
.gallery-item:nth-child(14) { animation-delay: 0.75s; }
.gallery-item:nth-child(15) { animation-delay: 0.8s; }
.gallery-item:nth-child(16) { animation-delay: 0.85s; }
.gallery-item:nth-child(17) { animation-delay: 0.9s; }

/* ===== GALERIJAS LAPA ===== */
.galerija-page {
    padding: 60px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    position: relative;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

/* Atpakaļ saite */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #520505;
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 30px;
    transition: all 0.2s;
    background: white;
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid #520505;
    box-shadow: 0 2px 8px rgba(82,5,5,0.1);
    position: relative;
    z-index: 3;
}

.back-link:hover {
    background: #520505;
    color: white;
    transform: translateX(-5px);
}

.page-header {
    text-align: center;
    margin-bottom: 50px;
    position: relative;
    z-index: 3;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #520505;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #ffcc00, #ffd700);
    border-radius: 2px;
}

.page-subtitle {
    font-size: 1.2rem;
    color: #666;
    max-width: 800px;
    margin: 20px auto 0;
}

/* ===== KATEGORIJU FILTRI ===== */
.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
    position: relative;
    z-index: 3;
}

.filter-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
    color: #666;
    border: 1px solid #e9ecef;
    text-decoration: none !important;
    display: inline-block;
}

.filter-btn:hover,
.filter-btn:focus,
.filter-btn:active {
    background: #520505;
    color: white;
    border-color: #520505;
    transform: translateY(-2px);
    text-decoration: none !important;
}

.filter-btn.active {
    background: #520505;
    color: white;
    border-color: #520505;
    text-decoration: none !important;
}

/* ===== GALERIJAS REŽĢIS - 4 KOLONNAS ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
    position: relative;
    z-index: 3;
}

.gallery-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    height: 220px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(82,5,5,0.1);
    transition: all 0.3s;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 30px rgba(82,5,5,0.2);
}

.gallery-image {
    position: relative;
    width: 100%;
    height: 100%;
}

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

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, #520505, transparent);
    color: white;
    padding: 20px 15px 15px;
    transform: translateY(0);
    transition: transform 0.3s;
}

.gallery-overlay h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.gallery-overlay p {
    font-size: 0.8rem;
    opacity: 0.9;
}

.gallery-overlay i {
    margin-right: 5px;
}

/* ===== LIGHTBOX ===== */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img {
    max-width: 95vw;
    max-height: 95vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

.lightbox-caption {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    padding: 8px 16px;
    font-size: 16px;
    background-color: rgba(82,5,5,0.8);
    border-radius: 30px;
    z-index: 10000;
    font-weight: 500;
    border: 2px solid rgba(255,255,255,0.2);
}

.lightbox-caption h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #ffcc00;
}

.lightbox-caption p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 20px;
    color: white;
    cursor: pointer;
    background: rgba(82,5,5,0.6);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10000;
    border: 2px solid rgba(255,255,255,0.2);
    font-size: 28px;
    line-height: 1;
    font-family: Arial, Helvetica, sans-serif;
}

.lightbox-close:hover {
    background: #7a0f0f;
    transform: scale(1.1);
    border-color: white;
}

.lightbox-close::before {
    content: "×";
    display: block;
    line-height: 1;
    margin-top: -1px;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(82,5,5,0.7);
    color: white;
    border: 2px solid #ffcc00;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: #ffcc00;
    color: #520505;
    transform: translateY(-50%) scale(1.1);
    border-color: white;
}

/* Tukšs rezultātu ziņojums */
.gallery-empty {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 30px;
    box-shadow: 0 5px 15px rgba(82,5,5,0.05);
    border: 1px solid rgba(82,5,5,0.1);
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.gallery-empty i {
    font-size: 3rem;
    color: #520505;
    margin-bottom: 15px;
    opacity: 0.5;
}

.gallery-empty p {
    margin: 0;
}

/* ===== ZOOM KONTROLES ===== */
.zoom-controls {
    position: fixed;
    bottom: 100px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10002;
    background: rgba(82,5,5,0.8);
    padding: 8px;
    border-radius: 50px;
    backdrop-filter: blur(5px);
}

.zoom-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: none;
    color: #520505;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-btn:hover {
    background: #ffcc00;
    transform: scale(1.1);
}

/* Attēla stili */
#lightbox-img {
    max-width: 95vw;
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    transition: transform 0.2s ease;
    cursor: default;
}

/* Lightbox saturs */
.lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Kategoriju statistikas stili */
.gallery-stats {
    text-align: center;
    margin-top: 30px;
    padding: 15px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(82,5,5,0.05);
    color: #666;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.gallery-stats i {
    color: #520505;
}

.gallery-stats .separator {
    color: #ddd;
}

/* ===== RESPONSĪVAIS DIZAINS ===== */
@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .page-title {
        font-size: 2.2rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .zoom-controls {
        bottom: 80px;
        right: 15px;
        gap: 8px;
        padding: 6px;
    }
    
    .zoom-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    #lightbox-img {
        max-width: 90vw;
        max-height: 80vh;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    .gallery-filters {
        gap: 8px;
    }
    
    .filter-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .lightbox-close {
        top: 20px;
        right: 25px;
        font-size: 40px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .page-title {
        font-size: 1.8rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-item {
        height: 200px;
    }
    
    .lightbox-prev {
        left: 10px;
    }
    
    .lightbox-next {
        right: 10px;
    }
}