/* Modern Interactive Gallery Styles */
/* These styles are specific to the modern gallery and won't affect existing styles */

/* Gallery Hero */
.modern-gallery-page {
    background: linear-gradient(180deg, #ffffff 0%, #f8faf9 100%);
    min-height: 100vh;
}

.gallery-hero {
    background: linear-gradient(135deg, #2d5016 0%, #4a7729 100%);
    color: white;
    padding: 4rem 2rem 3rem;
    border-radius: 0 0 30px 30px;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(45, 80, 22, 0.2);
}

.hero-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.gallery-main-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(45deg, #ffffff, #e8f5e9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.gallery-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2.5rem;
    font-weight: 300;
}

/* Gallery Controls */
.gallery-controls {
    max-width: 1200px;
    margin: 2rem auto 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-container {
    flex: 2;
    min-width: 300px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #4a7729;
    box-shadow: 0 0 0 3px rgba(74, 119, 41, 0.1);
}

.search-btn {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0.5rem;
}

.filter-controls {
    flex: 3;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-select {
    flex: 1;
    min-width: 150px;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    color: #333;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%234A4A4A' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    padding-right: 2.5rem;
}

.filter-select:focus {
    outline: none;
    border-color: #4a7729;
    box-shadow: 0 0 0 3px rgba(74, 119, 41, 0.1);
}

/* Gallery Stats */
.gallery-stats {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: #4a7729;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* View Toggle */
.view-toggle {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: flex;
    gap: 0.5rem;
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    width: fit-content;
}

.view-btn {
    padding: 0.8rem 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    color: #666;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-btn:hover {
    border-color: #4a7729;
    color: #4a7729;
}

.view-btn.active {
    background: #4a7729;
    border-color: #4a7729;
    color: white;
}

/* Gallery Container */
.gallery-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
    position: relative;
    min-height: 500px;
}

.gallery-container > div {
    display: none;
}

.gallery-container > div.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Grid View */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    animation: fadeIn 0.5s ease;
}

.grid-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    height: 300px;
}

.grid-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.grid-item:hover img {
    transform: scale(1.1);
}

.item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 1.5rem;
    color: white;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.grid-item:hover .item-overlay {
    transform: translateY(0);
}

.item-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-meta {
    display: flex;
    gap: 0.8rem;
    font-size: 0.85rem;
    opacity: 0.8;
}

.source-badge {
    background: rgba(74, 119, 41, 0.9);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
}

/* Masonry View */
.masonry-grid {
    column-count: 3;
    column-gap: 1.5rem;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.masonry-item:hover {
    transform: translateY(-5px);
}

.masonry-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* Carousel View */
.carousel-view {
    position: relative;
    background: #1a1a1a;
    border-radius: 20px;
    overflow: hidden;
}

.carousel-container {
    position: relative;
    height: 600px;
}

.carousel-slides {
    display: flex;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.carousel-slide {
    flex: 0 0 100%;
    height: 100%;
    position: relative;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.carousel-prev {
    left: 2rem;
}

.carousel-next {
    right: 2rem;
}

.carousel-dots {
    position: absolute;
    bottom: 2rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: white;
    transform: scale(1.2);
}

.carousel-info {
    padding: 2rem;
    background: white;
    color: #333;
}

/* Load More */
.load-more-container {
    max-width: 1400px;
    margin: 3rem auto;
    padding: 0 2rem;
    text-align: center;
}

.load-more-btn {
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #4a7729, #6b9a3c);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 8px 25px rgba(74, 119, 41, 0.3);
}

.load-more-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(74, 119, 41, 0.4);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
}

.image-modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 1400px;
    max-height: 90vh;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    animation: modalSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #000;
    transform: scale(1.1);
}

.modal-image-container {
    flex: 2;
    position: relative;
    background: #000;
}

.modal-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.image-nav {
    position: absolute;
    bottom: 2rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.nav-prev,
.nav-next {
    padding: 0.8rem 1.5rem;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.nav-prev:hover,
.nav-next:hover {
    background: #000;
    transform: translateY(-2px);
}

.modal-info {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    max-height: 90vh;
}

.modal-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #333;
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.modal-meta span {
    padding: 0.3rem 0.8rem;
    background: #f5f5f5;
    border-radius: 4px;
    color: #666;
}

.source-badge {
    background: #4a7729 !important;
    color: white !important;
    font-weight: 600;
}

.modal-info p {
    line-height: 1.6;
    color: #555;
    margin-bottom: 2rem;
}

.image-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.action-btn {
    flex: 1;
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    color: #666;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-btn:hover {
    border-color: #4a7729;
    color: #4a7729;
    transform: translateY(-2px);
}

.related-images {
    border-top: 2px solid #f0f0f0;
    padding-top: 1.5rem;
}

.related-images h4 {
    margin-bottom: 1rem;
    color: #333;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem;
}

.related-item {
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.related-item:hover {
    transform: scale(1.05);
}

.related-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .masonry-grid {
        column-count: 2;
    }
    
    .modal-content {
        flex-direction: column;
        width: 95%;
    }
    
    .modal-image-container {
        flex: 1;
        min-height: 50vh;
    }
}

@media (max-width: 768px) {
    .gallery-main-title {
        font-size: 2.5rem;
    }
    
    .gallery-controls {
        flex-direction: column;
    }
    
    .search-container,
    .filter-controls {
        width: 100%;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .masonry-grid {
        column-count: 1;
    }
    
    .carousel-container {
        height: 400px;
    }
    
    .modal-content {
        width: 98%;
        max-height: 95vh;
    }
    
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .gallery-hero {
        padding: 3rem 1rem 2rem;
    }
    
    .gallery-main-title {
        font-size: 2rem;
    }
    
    .image-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .view-toggle {
        width: 100%;
        justify-content: center;
    }
    
    .view-btn {
        flex: 1;
        justify-content: center;
    }
}