/* Gallery Page Styling */

/* Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Photo Card */
.photo-card {
    background: var(--surface-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(26, 51, 41, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(45, 125, 110, 0.08);
    cursor: pointer;
}

.photo-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(26, 51, 41, 0.2);
    border-color: var(--primary-color);
}

/* Photo Image */
.photo-image {
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    position: relative;
}

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

.photo-card:hover .photo-image img {
    transform: scale(1.08);
}

/* Photo Info */
.photo-info {
    padding: 1rem;
}

.photo-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.photo-caption {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    color: var(--text-dark);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.photo-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.813rem;
    color: var(--text-muted);
}

.photo-meta .material-icons {
    font-size: 1rem;
    color: var(--primary-color);
}

/* No Results State */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--surface-light);
    border-radius: 12px;
    color: var(--text-muted);
}

.no-results .material-icons {
    font-size: 4rem;
    color: var(--primary-color);
    opacity: 0.5;
    margin-bottom: 1rem;
}

.no-results h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    color: var(--text-dark);
}

.no-results p {
    margin: 0;
    font-size: 1.125rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1rem;
    }

    .photo-image {
        height: 200px;
    }
}

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

    .photo-image {
        height: 240px;
    }
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    padding: 20px;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.image-modal-content {
    background: white;
    border-radius: 16px;
    max-width: 1400px;
    width: 100%;
    max-height: 90vh;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.image-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}

.image-modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: rotate(90deg);
}

.image-modal-close .material-icons {
    color: white;
    font-size: 28px;
}

.image-modal-body {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 0;
    max-height: 90vh;
    overflow: hidden;
}

.image-modal-image {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border-radius: 16px 0 0 16px;
    overflow: hidden;
}

.image-modal-image img {
    max-width: 100%;
    max-height: calc(90vh - 80px);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.image-modal-details {
    padding: 40px;
    overflow-y: auto;
    background: white;
    border-radius: 0 16px 16px 0;
}

.image-modal-details h2 {
    color: var(--text-color);
    margin: 0 0 24px 0;
    font-size: 2rem;
    line-height: 1.2;
}

.modal-detail-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-detail-section:last-of-type {
    border-bottom: none;
}

.modal-detail-section label {
    display: block;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-detail-section p {
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.modal-tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--surface-light);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--primary-color);
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid var(--border-color);
}

.modal-actions .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
}

/* Modal Responsive */
@media (max-width: 1024px) {
    .image-modal-body {
        grid-template-columns: 1fr;
    }

    .image-modal-image {
        border-radius: 16px 16px 0 0;
        padding: 20px;
    }

    .image-modal-details {
        border-radius: 0 0 16px 16px;
        padding: 24px;
    }

    .image-modal-image img {
        max-height: 50vh;
    }
}

@media (max-width: 768px) {
    .image-modal {
        padding: 0;
    }

    .image-modal-content {
        max-height: 100vh;
        border-radius: 0;
    }

    .image-modal-image {
        border-radius: 0;
    }

    .image-modal-details {
        border-radius: 0;
        padding: 20px;
    }

    .image-modal-details h2 {
        font-size: 1.5rem;
    }
}

/* Video Play Overlay */
.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.photo-card:hover .video-play-overlay {
    opacity: 1;
}

.video-modal-content {
    max-width: 1200px;
}

.video-modal-player {
    background: #000;
    padding: 0 !important;
    display: block;
}

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

/* YouTube Embed Container */
.youtube-embed-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    width: 100%;
}

.youtube-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}
