/* css/gallery.css - Gallery Styles with Organic Design */

/* Gallery Section */
.gallery {
    padding: var(--spacing-xxl) 0;
    background: var(--warm-white);
    position: relative;
}

.gallery::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='50' cy='50' r='1' fill='%23c9b8a8' opacity='0.3'/%3E%3C/svg%3E");
    background-size: 100px 100px;
    opacity: 0.5;
    z-index: 0;
}

.gallery .container {
    position: relative;
    z-index: 1;
}

/* Botanical Header */
.botanical-header {
    position: relative;
    display: inline-block;
}

/* Gallery Filters */
.gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: var(--spacing-xl);
    opacity: 0;
    animation: fadeIn 0.8s ease 0.2s forwards;
}

.filter-btn {
    padding: 0.625rem 1.5rem;
    background: transparent;
    color: var(--walnut);
    border: 2px solid var(--sage-light);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border-radius: 30px;
    font-style: italic;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--forest-green);
    transition: left 0.3s ease;
    z-index: -1;
}

.filter-btn:hover,
.filter-btn.active {
    color: var(--warm-white);
    border-color: var(--forest-green);
}

.filter-btn:hover::before,
.filter-btn.active::before {
    left: 0;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-bottom: var(--spacing-xl);
}

/* Gallery Item */
.gallery-item {
    position: relative;
    overflow: visible;
    background: transparent;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(30px);
}

.gallery-item.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item:hover {
    transform: translateY(-10px);
}

.gallery-item-inner {
    position: relative;
    overflow: hidden;
    background: var(--forest-dark);
    border-radius: 5px;
    box-shadow: 0 10px 30px rgba(30, 58, 41, 0.1);
    border: 1px solid rgba(124, 132, 113, 0.2);
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-item-inner {
    box-shadow: 0 20px 40px rgba(30, 58, 41, 0.2);
    border-color: var(--terracotta);
}

/* Add organic corner decorations */
.gallery-item-inner::before,
.gallery-item-inner::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border: 2px solid var(--terracotta);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 3;
}

.gallery-item-inner::before {
    top: -10px;
    left: -10px;
    border-right: none;
    border-bottom: none;
    border-radius: 10px 0 0 0;
}

.gallery-item-inner::after {
    bottom: -10px;
    right: -10px;
    border-left: none;
    border-top: none;
    border-radius: 0 0 10px 0;
}

.gallery-item:hover .gallery-item-inner::before,
.gallery-item:hover .gallery-item-inner::after {
    opacity: 0.5;
}

.gallery-item img,
.gallery-item .placeholder-img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    transition: transform 0.5s ease, filter 0.5s ease;
    border-radius: 5px 5px 0 0;
}

.gallery-item:hover img,
.gallery-item:hover .placeholder-img {
    transform: scale(1.05);
    filter: brightness(0.8);
}

/* Gallery Overlay */
.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(30, 58, 41, 0) 0%,
        rgba(30, 58, 41, 0.95) 100%
    );
    display: flex;
    align-items: flex-end;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 5px;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.overlay-content {
    transform: translateY(20px);
    transition: transform 0.3s ease;
    width: 100%;
}

.gallery-item:hover .overlay-content {
    transform: translateY(0);
}

.overlay-content h3 {
    font-family: var(--font-secondary);
    font-size: 1.5rem;
    color: var(--warm-white);
    margin-bottom: 0.5rem;
    font-style: italic;
}

.overlay-content p {
    color: rgba(244, 241, 232, 0.8);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Item Actions */
.item-actions {
    display: flex;
    gap: 1rem;
}

.btn-view,
.btn-offer {
    padding: 0.5rem 1.25rem;
    background: transparent;
    color: var(--warm-white);
    border: 1px solid rgba(244, 241, 232, 0.5);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 20px;
}

.btn-view:hover {
    background: var(--warm-white);
    color: var(--forest-dark);
    border-color: var(--warm-white);
}

.btn-offer {
    background: var(--terracotta);
    color: var(--warm-white);
    border-color: var(--terracotta);
}

.btn-offer:hover {
    background: transparent;
    color: var(--terracotta);
    border-color: var(--terracotta);
}

.btn-offer:disabled {
    background: var(--stone-gray);
    border-color: var(--stone-gray);
    cursor: not-allowed;
    opacity: 0.5;
}

/* Availability Badge */
.availability-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.375rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 2;
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

.availability-badge.available {
    background: rgba(124, 132, 113, 0.9);
    color: var(--warm-white);
    border: 1px solid rgba(244, 241, 232, 0.3);
}

.availability-badge.sold {
    background: rgba(188, 108, 60, 0.9);
    color: var(--warm-white);
    border: 1px solid rgba(244, 241, 232, 0.3);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 58, 41, 0.95);
    z-index: 2000;
    padding: 2rem;
    overflow-y: auto;
}

.lightbox.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    font-size: 3rem;
    color: var(--warm-white);
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 2001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    color: var(--terracotta);
    transform: rotate(90deg);
}

.lightbox-content {
    max-width: 1200px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    animation: scaleIn 0.3s ease;
    background: rgba(250, 248, 243, 0.05);
    padding: 2rem;
    border-radius: 10px;
    border: 1px solid rgba(201, 184, 168, 0.2);
}

.lightbox-content img,
.lightbox-placeholder {
    width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    border: 10px solid var(--warm-white);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border-radius: 5px;
}

.lightbox-info {
    color: var(--warm-white);
    padding: 2rem;
}

.lightbox-info h3 {
    font-family: var(--font-secondary);
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--terracotta);
    font-style: italic;
}

.lightbox-info p {
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: rgba(244, 241, 232, 0.9);
}

#lightboxDetails {
    font-size: 1rem;
    color: rgba(244, 241, 232, 0.7);
    margin-bottom: 2rem;
}

.lightbox-actions {
    margin-top: 2rem;
}

.lightbox-actions .btn {
    width: 100%;
    max-width: 300px;
    border-radius: 30px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 58, 41, 0.9);
    z-index: 2000;
    padding: 2rem;
    overflow-y: auto;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--warm-white);
    max-width: 500px;
    width: 100%;
    padding: 3rem;
    position: relative;
    animation: slideUp 0.3s ease;
    border: 2px solid var(--forest-green);
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-content::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    border: 1px solid rgba(124, 132, 113, 0.3);
    border-radius: 15px;
    z-index: -1;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    color: var(--olive);
    cursor: pointer;
    transition: color 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--forest-dark);
    transform: rotate(90deg);
}

.modal-content h2 {
    font-family: var(--font-secondary);
    margin-bottom: 0.5rem;
    color: var(--forest-dark);
    font-style: italic;
}

.artwork-title {
    color: var(--terracotta);
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

/* Responsive Gallery */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .lightbox-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .gallery-item img,
    .gallery-item .placeholder-img {
        height: 350px;
    }
    
    .gallery-filters {
        padding: 0 1rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .lightbox-content {
        gap: 2rem;
    }
    
    .lightbox-info {
        padding: 1rem;
    }
    
    .lightbox-info h3 {
        font-size: 1.75rem;
    }
    
    .modal-content {
        padding: 2rem;
        margin: 1rem;
    }
}

@media (max-width: 480px) {
    .gallery-item img,
    .gallery-item .placeholder-img {
        height: 300px;
    }
    
    .item-actions {
        flex-direction: column;
    }
    
    .btn-view,
    .btn-offer {
        width: 100%;
    }
}

/* Animation Keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}