/* assets/css/gallery.css */

/* ========== Gallery Specific Styles ========== */
.gallery {
    position: relative;
    overflow: hidden;
}

/* Instagram Feed Style */
.gallery-grid {
    position: relative;
}

.gallery-grid::before {
    content: '';
    position: absolute;
    top: -100px;
    left: -100px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
    z-index: -1;
}

.gallery-grid::after {
    content: '';
    position: absolute;
    bottom: -100px;
    right: -100px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(255, 165, 0, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite reverse;
    z-index: -1;
}

/* Gallery Item Enhanced */
.gallery-item {
    position: relative;
    background: var(--bg-light);
    animation: fadeInScale 0.6s ease both;
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }
.gallery-item:nth-child(5) { animation-delay: 0.5s; }
.gallery-item:nth-child(6) { animation-delay: 0.6s; }

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg, 
        transparent 0%, 
        transparent 50%, 
        rgba(0, 0, 0, 0.8) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.gallery-item:hover::before {
    opacity: 1;
}

/* Instagram-like hover effect */
.gallery-overlay {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.gallery-overlay i {
    transform: scale(0);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay i {
    transform: scale(1);
    animation: bounce 0.5s ease;
}

/* Gallery Caption */
.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    color: white;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 2;
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

.gallery-caption h4 {
    color: var(--primary-color);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.gallery-caption p {
    font-size: 0.875rem;
    margin: 0;
    opacity: 0.9;
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
}

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

.lightbox-img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    animation: zoomIn 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    font-size: 2.5rem;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10000;
}

.lightbox-close:hover {
    transform: scale(1.2) rotate(90deg);
}

/* Gallery Navigation (for future carousel) */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    color: var(--primary-color);
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.gallery-nav:hover {
    background: rgba(255, 215, 0, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav.prev {
    left: 20px;
}

.gallery-nav.next {
    right: 20px;
}

/* Instagram Grid Layout Variations */
.gallery-grid.mosaic {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 200px;
    gap: 1rem;
}

.gallery-grid.mosaic .gallery-item:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-grid.mosaic .gallery-item:nth-child(4) {
    grid-column: span 2;
}

/* Gallery Filters (for future implementation) */
.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1.5rem;
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: var(--border-radius-full);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: var(--secondary-color);
    transform: translateY(-2px);
}

/* Loading State */
.gallery-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.gallery-loading::after {
    content: '';
    width: 50px;
    height: 50px;
    border: 4px solid var(--bg-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Instagram Stories Style (Optional) */
.instagram-stories {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem 0;
    margin-bottom: 2rem;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-light);
}

.instagram-stories::-webkit-scrollbar {
    height: 6px;
}

.instagram-stories::-webkit-scrollbar-track {
    background: var(--bg-light);
}

.instagram-stories::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.story-item {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    cursor: pointer;
    transition: transform 0.3s ease;
}

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

.story-item img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
}

/* Gallery Stats */
.gallery-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--bg-gray);
}

.stat-item {
    text-align: center;
}

.stat-item .number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-item .label {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* Animations */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0);
    }
    33% {
        transform: translate(30px, -30px);
    }
    66% {
        transform: translate(-20px, 20px);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

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

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

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Gallery */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .gallery-item {
        height: 250px;
    }
    
    .gallery-grid.mosaic {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 150px;
    }
    
    .gallery-grid.mosaic .gallery-item:nth-child(1) {
        grid-column: span 1;
        grid-row: span 1;
    }
    
    .gallery-grid.mosaic .gallery-item:nth-child(4) {
        grid-column: span 1;
    }
    
    .lightbox-close {
        top: 20px;
        right: 20px;
        font-size: 2rem;
    }
    
    .gallery-nav {
        display: none;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .gallery-item {
        height: 300px;
    }
    
    .gallery-stats {
        gap: 1.5rem;
    }
    
    .instagram-stories {
        gap: 0.5rem;
    }
    
    .story-item {
        width: 60px;
        height: 60px;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .gallery-item {
        background: var(--secondary-color);
    }
    
    .gallery-overlay {
        background: rgba(0, 0, 0, 0.8);
    }
}