/* Gallery Styles */
.gallery-page {
    padding-top: 80px;
    min-height: 100vh;
}

.gallery-header {
    text-align: center;
    padding: 3rem 0;
    background: linear-gradient(135deg,
        rgba(37, 99, 235, 0.05) 0%,
        rgba(251, 146, 60, 0.05) 100%);
}

.gallery-title {
    font-family: var(--font-accent);
    font-size: clamp(2.5rem, 5vw, 4rem);
    margin-bottom: 1rem;
    color: #6b7280;
}

.gallery-description {
    color: var(--text-light);
    font-size: 1.125rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Filters */
.gallery-filters {
    padding: 2rem 0;
    background: var(--white);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 60px;
    z-index: 100;
}

.filters-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.filter-category {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-label {
    min-width: 80px;
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filters-container {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.4rem 1rem;
    background: var(--white);
    border: 2px solid var(--border-light);
    border-radius: 20px;
    color: var(--text-dark);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.filter-btn:hover {
    border-color: #9ca3af;
    color: var(--text-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-btn.active {
    background: #6b7280;
    color: var(--white);
    border-color: #6b7280;
}

.filter-count {
    margin-left: 0.25rem;
    font-weight: 600;
    opacity: 0.8;
}

/* Color filter buttons with color indicators */
.filter-btn[data-type="color"] {
    padding-left: 2rem;
}

.filter-btn[data-type="color"]::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.2);
}

.filter-btn[data-color="blue"]::before { background: #4682B4; }
.filter-btn[data-color="red"]::before { background: #DC143C; }
.filter-btn[data-color="yellow"]::before { background: #FFD700; }
.filter-btn[data-color="orange"]::before { background: #FF8C00; }
.filter-btn[data-color="green"]::before { background: #228B22; }
.filter-btn[data-color="purple"]::before { background: #8B008B; }
.filter-btn[data-color="brown"]::before { background: #8B4513; }
.filter-btn[data-color="black"]::before { background: #000000; }
.filter-btn[data-color="white"]::before { background: #FFFFFF; }
.filter-btn[data-color="gray"]::before { background: #808080; }
.filter-btn[data-color="pink"]::before { background: #FFC0CB; }

/* Gallery Grid */
.gallery-container {
    padding: 3rem 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    animation: fade-in 0.8s ease;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Artwork Cards */
.artwork-card {
    position: relative;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
    animation: slide-up 0.6s ease both;
}

.artwork-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.artwork-image {
    width: 100%;
    height: 320px;
    position: relative;
    overflow: hidden;
    background: var(--light-gray);
}

.artwork-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.artwork-card:hover .artwork-image img {
    transform: scale(1.1);
}

.artwork-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(0, 0, 0, 0.7) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.artwork-card:hover .artwork-overlay {
    opacity: 1;
}

.artwork-info {
    padding: 1.5rem;
}

.artwork-title {
    font-family: var(--font-accent);
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.artwork-date {
    color: var(--text-light);
    font-size: 0.875rem;
}

.artwork-description {
    color: var(--text-light);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-top: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Masonry Layout */
.masonry-grid {
    column-count: 3;
    column-gap: 2rem;
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 2rem;
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox.active {
    display: flex !important;
    animation: fade-in 0.3s ease;
}

.lightbox-content {
    position: relative;
    width: 90vw;
    height: 80vh;
    max-width: 1400px;
    max-height: 90vh;
    min-height: 500px;
    display: flex;
    gap: 0;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
}

.lightbox-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
    position: relative;
    min-height: 400px;
    overflow: hidden;
}

/* Special handling for carousel lightbox */
.lightbox-image.lightbox-carousel {
    flex: 1;
    position: relative;
    min-height: 400px;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.lightbox-image img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-info {
    width: 350px;
    padding: 2rem;
    overflow-y: auto;
    background: var(--white);
}

.lightbox-title {
    font-family: var(--font-accent);
    font-size: 1.75rem;
    margin-bottom: 1rem;
}

.lightbox-date {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.lightbox-description {
    color: var(--text-dark);
    line-height: 1.8;
}

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 1;
}

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

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.lightbox-nav:hover {
    background: var(--white);
}

.lightbox-prev {
    left: 1rem;
}

.lightbox-next {
    right: 1rem;
}

/* Doodles Styles */
.doodle-item {
    min-width: 250px;
    scroll-snap-align: start;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

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

.doodle-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.doodle-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.doodle-info {
    padding: 1rem;
}

.doodle-title {
    font-size: 0.875rem;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.doodle-date {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 3rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
}

.empty-state h3 {
    font-family: var(--font-accent);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.empty-state p {
    color: var(--text-light);
}

/* Responsive Gallery */
@media (max-width: 1024px) {
    .masonry-grid {
        column-count: 2;
    }

    .lightbox-content {
        flex-direction: column;
        max-height: 95vh;
    }

    .lightbox-info {
        width: 100%;
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }

    .masonry-grid {
        column-count: 1;
    }

    .artwork-image {
        height: 250px;
    }

    .lightbox-content {
        margin: 1rem;
    }

    .lightbox-nav {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .gallery-filters {
        padding: 1rem 0;
    }

    .filter-btn {
        font-size: 0.875rem;
        padding: 0.375rem 1rem;
    }

    .doodle-item {
        min-width: 200px;
    }
}