/* Premium Gallery Modal Styles */

.premium-gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    display: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-gallery-modal.active {
    opacity: 1;
    visibility: visible;
    display: flex;
}

.gallery-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.gallery-modal-container {
    position: relative;
    width: 95%;
    max-width: 1400px;
    height: 90%;
    max-height: 900px;
    margin: 2.5% auto;
    background: linear-gradient(145deg, #f8fafc, #e2e8f0);
    border-radius: 24px;
    box-shadow: 
        20px 20px 40px rgba(148, 163, 184, 0.3),
        -20px -20px 40px rgba(255, 255, 255, 0.9),
        inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.8) translateY(50px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.premium-gallery-modal.active .gallery-modal-container {
    transform: scale(1) translateY(0);
}

/* Header */
.gallery-modal-header {
    padding: 2rem 2.5rem 1.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    box-shadow: 
        inset 0 2px 4px rgba(148, 163, 184, 0.1),
        inset 0 -2px 4px rgba(255, 255, 255, 0.8);
}

.gallery-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #16a34a, #22c55e, #16a34a);
}

.gallery-title {
    color: #1e293b;
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, #1e293b, #374151);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gallery-icon {
    color: #16a34a;
    font-size: 2rem;
    animation: leafPulse 3s ease-in-out infinite;
}

@keyframes leafPulse {
    0%, 100% { 
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 0 10px rgba(22, 163, 74, 0.3));
    }
    50% { 
        transform: scale(1.1) rotate(5deg);
        filter: drop-shadow(0 0 20px rgba(22, 163, 74, 0.5));
    }
}

.gallery-close-btn {
    background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        6px 6px 12px rgba(148, 163, 184, 0.3),
        -6px -6px 12px rgba(255, 255, 255, 0.9);
}

.gallery-close-btn:hover {
    color: #ef4444;
    transform: scale(1.1);
    box-shadow: 
        8px 8px 16px rgba(148, 163, 184, 0.4),
        -8px -8px 16px rgba(255, 255, 255, 1);
}

/* Filter Bar */
.gallery-filter-bar {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(145deg, #f8fafc, #e2e8f0);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.8);
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
    border: none;
    border-radius: 50px;
    color: #64748b;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        4px 4px 8px rgba(148, 163, 184, 0.2),
        -4px -4px 8px rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        6px 6px 12px rgba(148, 163, 184, 0.3),
        -6px -6px 12px rgba(255, 255, 255, 0.9);
}

.filter-btn:active,
.filter-btn:focus {
    outline: none;
    transform: translateY(0);
    box-shadow: 
        2px 2px 4px rgba(148, 163, 184, 0.2),
        -2px -2px 4px rgba(255, 255, 255, 0.8);
}

.filter-btn.active {
    background: linear-gradient(145deg, #16a34a, #22c55e);
    color: white;
    box-shadow: 
        inset 2px 2px 4px rgba(0, 0, 0, 0.1),
        inset -2px -2px 4px rgba(255, 255, 255, 0.1),
        4px 4px 8px rgba(22, 163, 74, 0.2);
}

.filter-btn.active:hover {
    background: linear-gradient(145deg, #15803d, #16a34a);
    box-shadow: 
        inset 2px 2px 4px rgba(0, 0, 0, 0.15),
        inset -2px -2px 4px rgba(255, 255, 255, 0.15),
        6px 6px 12px rgba(22, 163, 74, 0.3);
}

.filter-btn i {
    font-size: 1.1rem;
}

/* Content */
.gallery-modal-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

.gallery-modal-content::-webkit-scrollbar {
    width: 8px;
}

.gallery-modal-content::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.1);
    border-radius: 4px;
}

.gallery-modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(145deg, #cbd5e1, #94a3b8);
    border-radius: 4px;
    box-shadow: inset 2px 2px 4px rgba(148, 163, 184, 0.3);
}

.gallery-modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(145deg, #94a3b8, #64748b);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
}

.gallery-item {
    background: linear-gradient(145deg, #f8fafc, #e2e8f0);
    border: none;
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    transform: translateY(20px);
    opacity: 0;
    animation: slideInUp 0.6s ease forwards;
    box-shadow: 
        8px 8px 16px rgba(148, 163, 184, 0.2),
        -8px -8px 16px rgba(255, 255, 255, 0.8),
        inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.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; }

@keyframes slideInUp {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 
        12px 12px 24px rgba(148, 163, 184, 0.3),
        -12px -12px 24px rgba(255, 255, 255, 0.9),
        inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.05), rgba(34, 197, 94, 0.03));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 20px;
}

.gallery-item:hover::before {
    opacity: 1;
}

.gallery-item-image {
    width: 100%;
    height: 220px;
    object-fit: contain;
    transition: all 0.4s ease;
}

.gallery-item:hover .gallery-item-image {
    transform: scale(1.05);
}

.gallery-item-content {
    padding: 1.5rem;
    position: relative;
    z-index: 2;
}

.gallery-item-title {
    color: #1e293b;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, #1e293b, #374151);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gallery-item-description {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

/* Footer */
.gallery-modal-footer {
    padding: 1.5rem 2.5rem 2rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    background: linear-gradient(145deg, #f1f5f9, #e2e8f0);
    text-align: center;
    box-shadow: 
        inset 0 -2px 4px rgba(148, 163, 184, 0.1),
        inset 0 2px 4px rgba(255, 255, 255, 0.8);
}

.gallery-subtitle {
    color: #64748b;
    font-size: 1.1rem;
    font-style: italic;
    margin: 0;
    letter-spacing: 0.5px;
}

/* Loading Animation */
.gallery-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #16a34a;
    font-size: 1.2rem;
}

.gallery-loading i {
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .gallery-modal-container {
        width: 98%;
        height: 95%;
        margin: 1% auto;
        border-radius: 15px;
    }
    
    .gallery-modal-header {
        padding: 1.5rem 1.5rem 1rem;
    }
    
    .gallery-title {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .gallery-modal-content {
        padding: 1rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .gallery-item-image {
        height: 180px;
    }
    
    .gallery-item-content {
        padding: 1rem;
    }
    
    .gallery-item-title {
        font-size: 1.1rem;
    }
    
    .gallery-item-description {
        font-size: 0.9rem;
    }
    
    .gallery-modal-footer {
        padding: 1rem 1.5rem;
    }
    
    .gallery-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .gallery-item-image {
        height: 160px;
    }
    
    .gallery-title {
        font-size: 1.5rem;
    }
}
