/* Gallery Page Styles */

:root {
    --border-radius: 25px;
}

.gallery-page {
    padding: 120px 0 80px 0;
    background: var(--warm-white);
    min-height: 100vh;
}

.gallery-header {
    text-align: center;
    margin-bottom: 2rem;
}

.gallery-title {
    font-family: 'Dancing Script', cursive;
    font-size: 4rem;
    color: var(--coral-pink);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.gallery-subtitle {
    font-size: 1.2rem;
    color: var(--medium-text);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Gallery Controls */
.gallery-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 0 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-select,
.filter-input {
    background: white;
    border: 2px solid var(--coral-pink);
    color: var(--dark-text);
    padding: 12px 16px;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    outline: none;
    box-shadow: 0 2px 10px rgba(255, 105, 180, 0.1);
}

.filter-select {
    min-width: 180px;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23FF69B4' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
}

.filter-input {
    min-width: 220px;
}

.filter-input::placeholder {
    color: var(--medium-text);
    font-style: italic;
}

.filter-select:hover,
.filter-input:hover {
    border-color: var(--coral-pink);
    box-shadow: 0 4px 15px rgba(255, 105, 180, 0.2);
    transform: translateY(-1px);
}

.filter-select:focus,
.filter-input:focus {
    border-color: var(--coral-pink);
    box-shadow: 0 0 0 3px rgba(255, 105, 180, 0.1), 0 4px 15px rgba(255, 105, 180, 0.2);
    transform: translateY(-1px);
}

.filter-select option {
    background: white;
    color: var(--dark-text);
    padding: 8px 12px;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.gallery-item {
    position: relative;
    max-height: 250px;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: white;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    opacity: 0;
}

.gallery-disclaimer {
    color: var(--coral-pink);
    font-size: 80%;
    margin-top: 1em;
    font-weight: 400;
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 35%;
    transition: transform 0.3s ease;
}

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

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    border-radius: var(--border-radius);
    color: white;
    padding: 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
    transform: translateY(0);
}

.gallery-item-description
.gallery-item-category {
    font-size: 0.9rem;
    color: var(--primary-yellow);
    text-transform: capitalize;
}

.gallery-item-category {
    color: var(--primary-yellow);
}

/* Gallery item categories styling for better visual distinction */
.gallery-item[data-category="cupcakes"] .gallery-item-overlay {
    background: linear-gradient(transparent, rgba(255, 105, 180, 0.9));
}

.gallery-item[data-category="wedding_cakes"] .gallery-item-overlay {
    background: linear-gradient(transparent, rgba(255, 182, 193, 0.9));
}

.gallery-item[data-category="birthday_cakes"] .gallery-item-overlay {
    background: linear-gradient(transparent, rgba(255, 215, 0, 0.9));
}

.gallery-item[data-category="novelty_cakes"] .gallery-item-overlay {
    background: linear-gradient(transparent, rgba(138, 43, 226, 0.9));
}

.gallery-item[data-category="seasonal_treats"] .gallery-item-overlay {
    background: linear-gradient(transparent, rgba(34, 139, 34, 0.9));
}

/* Filter animations */
.gallery-item.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

.gallery-item.visible {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1), translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    animation: fadeIn 0.3s ease;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.modal-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 2rem;
    gap: 0;
    touch-action: pan-y;
    animation: modalSlideIn 0.3s ease;
}

.modal-wrapper {
    display: grid;
    position: relative;
    grid-template-columns: min-content;
}

.modal-image {
    max-width: 90vw;
    max-height: 70vh;
    border-radius: var(--border-radius) var(--border-radius) 0px 0px;
}

.modal-info {
    padding: 1.5rem;
    text-align: center;
    background: var(--coral-pink);
    color: white;
    width: 100%;
    max-width: 100%;
    font-size: 1.1rem;
    line-height: 1.6;
    border-radius: 0px 0px var(--border-radius) var(--border-radius);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-description {
    flex-grow: 1;
}

.modal-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-yellow);
}

.modal-price.hidden {
    display: none;
}

.modal-contact-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary-yellow);
    color: var(--coral-pink);
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: center;
    min-width: 200px;
}

.modal-contact-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Loading Animation */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--medium-text);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--coral-pink);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-page {
        padding: 100px 0 60px 0;
    }

    .gallery-title {
        font-size: 3rem;
    }

    .gallery-controls {
        gap: 1.5rem;
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        align-items: stretch;
    }

    .filter-select,
    .filter-input {
        min-width: 100%;
        padding: 14px 16px;
        font-size: 1rem;
    }

    .filter-select {
        padding-right: 40px;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    .modal-info {
        padding: 1rem;
        font-size: 1rem;
    }

    .modal-contact-btn {
        min-width: 150px;
        font-size: 0.95rem;
        padding: 0.65rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-controls {
        gap: 1rem;
        padding: 0 0.5rem;
    }

    .filter-select,
    .filter-input {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .modal-info {
        padding: 0.75rem;
        font-size: 0.95rem;
    }

    .modal-contact-btn {
        min-width: 120px;
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }

    .desktop-only {
        display: none;
    }
}
