/* ===== GALLERY PAGE STYLES ===== */

/* Gallery Page Container */
.gallery-page {
    max-width: 1800px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Hero Section */
.gallery-hero {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--bg-surface), var(--bg-surface-light));
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.gallery-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--italian-flag-gradient);
}

.gallery-title {
    font-size: 2.5rem;
    color: var(--accent-green);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.gallery-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin: 0;
}

/* Filter Bar */
.gallery-filter-bar {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 30px;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.filter-search {
    flex: 1;
    min-width: 200px;
}

.search-input {
    width: 100%;
    padding: 10px 15px;
    background-color: var(--bg-surface-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 2px rgba(14, 107, 59, 0.3);
}

.filter-category,
.filter-sort {
    flex: 0 0 auto;
}

.category-select,
.sort-select {
    padding: 10px 15px;
    background-color: var(--bg-surface-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
}

.category-select:focus,
.sort-select:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 2px rgba(14, 107, 59, 0.3);
}

.filter-btn {
    padding: 10px 20px;
    font-size: 15px;
}

/* Masonry Grid */
.gallery-container {
    min-height: 400px;
}

.grid-layout {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: 250px;
    gap: 20px;
}

@media (max-width: 1400px) {
    .grid-layout {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: 280px;
    }
}

@media (max-width: 1100px) {
    .grid-layout {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 300px;
    }
}

@media (max-width: 768px) {
    .grid-layout {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 250px;
    }

    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-category,
    .filter-sort {
        width: 100%;
    }

    .category-select,
    .sort-select {
        width: 100%;
    }
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 40px;
    padding: 20px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.pagination-link {
    padding: 10px 20px;
    background-color: var(--accent-green);
    border: 1px solid var(--accent-green);
    border-radius: var(--radius-sm);
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: var(--font-weight-semibold);
    transition: all 0.3s ease;
    cursor: pointer;
}

.pagination-link:hover {
    background-color: #0d7a3e;
    border-color: #0d7a3e;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pagination-info {
    padding: 10px 20px;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: var(--font-weight-semibold);
}

/* Gallery Item */
.gallery-item {
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.gallery-item-inner {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    background-color: var(--bg-surface-light);
    border: 1px solid var(--border-color);
    position: relative;
}

.gallery-item-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--italian-flag-gradient);
    z-index: 2;
}

.gallery-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.05);
}

/* Featured Badge */
.featured-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    color: #000;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* Gallery Item Overlay */
.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 50%, transparent 100%);
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

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

.gallery-item-info {
    color: var(--text-primary);
}

.gallery-item-title {
    font-size: 1.1rem;
    margin: 0 0 5px 0;
    color: var(--accent-green);
}

.gallery-item-category {
    display: inline-block;
    background: var(--italian-flag-gradient);
    color: #000;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.gallery-item-caption {
    font-size: 14px;
    margin: 0;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Empty State */
.gallery-empty {
    text-align: center;
    padding: 80px 20px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.gallery-empty h2 {
    font-size: 2rem;
    color: var(--accent-green);
    margin-bottom: 15px;
}

.gallery-empty p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 25px;
}

/* ===== LIGHTBOX STYLES ===== */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0,0,0,0.8);
    border: 2px solid;
    border-image: var(--italian-flag-gradient) 1;
}

.lightbox-info {
    margin-top: 20px;
    text-align: center;
    color: var(--text-primary);
    max-width: 600px;
}

.lightbox-title {
    font-size: 1.5rem;
    color: var(--accent-green);
    margin: 0 0 8px 0;
}

.lightbox-category {
    display: inline-block;
    background: var(--italian-flag-gradient);
    color: #000;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.lightbox-caption {
    font-size: 15px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Lightbox Navigation Buttons */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: var(--accent-green);
    color: #fff;
    transform: scale(1.1);
}

.lightbox-close {
    top: -60px;
    right: 0;
}

.lightbox-prev {
    left: -70px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev:hover {
    transform: translateY(-50%) scale(1.1);
}

.lightbox-next {
    right: -70px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next:hover {
    transform: translateY(-50%) scale(1.1);
}

@media (max-width: 768px) {
    .lightbox-close {
        top: -50px;
        right: 0;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .lightbox-prev {
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .lightbox-next {
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .lightbox-image {
        max-height: 60vh;
    }
}

/* Loading Animation */
.gallery-image {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Error and Placeholder States */
.gallery-error-placeholder,
.gallery-no-image {
    display: none;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #222;
    color: #6c757d;
    text-align: center;
    padding: 20px;
}

.gallery-error-placeholder i,
.gallery-no-image i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

.gallery-no-image {
    display: flex;
}

/* Empty State */
.gallery-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Item Caption */
.gallery-item-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 2rem 1rem 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.gallery-item-title {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}
