/* Gallery Styles */
.gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 80vh;
}

.gallery-header {
    text-align: center;
    margin-bottom: 50px;
}

.gallery-header h1 {
    font-size: 3rem;
    color: var(--color-logo-orange);
    margin-bottom: 15px;
    font-family: 'AmaticSC', sans-serif;
    font-weight: 700;
}

.gallery-header p {
    font-size: 1.2rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 40px;
}

.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background: white;
    height: 250px;
}

.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.gallery-item-inner {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
    cursor: pointer;
}

.gallery-item-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
    display: block;
    background: #f0f0f0;
    opacity: 1;
    visibility: visible;
    min-height: 200px;
}

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

/* No Images State */
.no-images {
    text-align: center;
    padding: 80px 20px;
    color: #666;
}

.no-images-icon {
    margin-bottom: 20px;
    color: #ccc;
}

.no-images h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--color-logo-orange);
}

.no-images p {
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--color-logo-orange);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top:hover {
    background: var(--color-logo-pink);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    color: white;
}

/* Loading Animation */
.gallery-item img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item img.loaded {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-container {
        padding: 20px 15px;
    }
    
    .gallery-header h1 {
        font-size: 2.5rem;
    }
    
    .gallery-header p {
        font-size: 1rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 12px;
    }
    
    .gallery-item {
        height: 200px;
    }
    
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .gallery-item {
        height: 150px;
    }
    
    .gallery-header h1 {
        font-size: 2rem;
    }
}

/* Lightbox Customization */
.lb-data .lb-caption {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.lb-data .lb-number {
    color: #ccc;
    font-size: 12px;
}

.lb-outerContainer {
    border-radius: 8px;
    overflow: hidden;
}

.lb-image {
    border-radius: 8px;
}

/* Animation for gallery items */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-item[data-aos="fade-up"] {
    animation: fadeInUp 0.6s ease-out;
}

/* Simple hover effect */
.gallery-item-inner {
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-item-inner {
    transform: scale(1.01);
}

/* Focus states for accessibility */
.gallery-item-inner:focus {
    outline: 3px solid var(--color-logo-orange);
    outline-offset: 2px;
}

.back-to-top:focus {
    outline: 3px solid var(--color-logo-pink);
    outline-offset: 2px;
}

/* Custom Image Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    margin: auto;
    padding: 0;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--color-logo-orange);
}

.modal-image-container {
    position: relative;
    width: 100%;
    height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.modal-btn {
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    padding: 15px 20px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
}

.modal-btn:hover {
    background: var(--color-logo-orange);
    transform: scale(1.1);
}

.prev-btn {
    margin-left: 20px;
}

.next-btn {
    margin-right: 20px;
}

.modal-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 25px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.modal-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
    color: white;
}

.modal-info span {
    font-size: 0.9rem;
    color: #ccc;
}

/* Image Error State */
.image-error {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f5f5f5;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    text-align: center;
    padding: 20px;
}

.image-error svg {
    margin-bottom: 10px;
    color: #ccc;
}

.image-error span {
    font-size: 0.9rem;
}

/* Modal Animations */
.image-modal {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: scale(0.8);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        height: 95vh;
    }
    
    .modal-image-container {
        height: 70vh;
    }
    
    .modal-close {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }
    
    .modal-btn {
        width: 40px;
        height: 40px;
        padding: 10px;
    }
    
    .prev-btn {
        margin-left: 10px;
    }
    
    .next-btn {
        margin-right: 10px;
    }
    
    .modal-info {
        bottom: 10px;
        padding: 10px 20px;
    }
    
    .modal-info h3 {
        font-size: 1rem;
    }
    
    .modal-info span {
        font-size: 0.8rem;
    }
}
