/* ========================================
   PHOTO GALLERY STYLES
   ======================================== */

/* Gallery Introduction */
.gallery-intro {
    max-width: 800px;
    margin: 0 auto 40px;
}

.gallery-intro h3 {
    color: #E67C3C;
    font-size: 28px;
    margin-bottom: 15px;
    font-weight: 600;
}

.gallery-intro p {
    color: #666;
    font-size: 16px;
    line-height: 1.8;
}

/* Topic Tabs */
.gallery-tabs-wrapper {
    margin-bottom: 40px;
    border-bottom: 2px solid #e0e0e0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.gallery-tabs {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    min-width: min-content;
}

.gallery-tab-item {
    flex-shrink: 0;
}

.gallery-tab-button {
    background: transparent;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    position: relative;
    white-space: nowrap;
}

.gallery-tab-button:hover {
    color: #E67C3C;
    background: rgba(230, 124, 60, 0.05);
}

.gallery-tab-item.active .gallery-tab-button {
    color: #E67C3C;
    border-bottom-color: #E67C3C;
}

/* Day Filter */
.day-filter-wrapper {
    margin-bottom: 30px;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.day-filter-label {
    font-size: 15px;
    color: #333;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.day-filter-label i {
    color: #E67C3C;
}

.day-filter-select {
    padding: 10px 40px 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 15px;
    color: #333;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
}

.day-filter-select:hover,
.day-filter-select:focus {
    border-color: #E67C3C;
    outline: none;
}

/* Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.photo-card {
    transition: all 0.3s ease;
    opacity: 1;
    transform: scale(1);
}

.photo-card.hidden {
    display: none;
}

.photo-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    background: #f5f5f5;
    aspect-ratio: 4/3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.photo-wrapper:hover {
    box-shadow: 0 8px 20px rgba(230, 124, 60, 0.3);
    transform: translateY(-5px);
}

.photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.photo-wrapper:hover .photo-img {
    transform: scale(1.1);
}

/* Photo Overlay */
.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(230, 124, 60, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-wrapper:hover .photo-overlay {
    opacity: 1;
}

.photo-overlay i {
    font-size: 48px;
    color: white;
    animation: zoomPulse 1.5s ease-in-out infinite;
}

@keyframes zoomPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Caption Overlay */
.photo-caption-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 20px 15px 15px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.photo-wrapper:hover .photo-caption-overlay {
    transform: translateY(0);
}

.photo-caption-overlay p {
    color: white;
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

/* Lightbox */
.photo-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.photo-lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 5px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 15px 25px;
    margin-top: 20px;
    border-radius: 5px;
    max-width: 600px;
    text-align: center;
    font-size: 16px;
    line-height: 1.6;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 20px;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: #E67C3C;
    border-color: #E67C3C;
    transform: scale(1.1);
}

.lightbox-close {
    top: 30px;
    right: 30px;
}

.lightbox-prev {
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev:hover {
    transform: translateY(-50%) scale(1.1);
}

.lightbox-next {
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next:hover {
    transform: translateY(-50%) scale(1.1);
}

/* ========================================
   VIDEO GALLERY STYLES
   ======================================== */

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.video-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.video-card:hover {
    box-shadow: 0 8px 20px rgba(230, 124, 60, 0.3);
    transform: translateY(-5px);
}

/* Video Thumbnail */
.video-thumbnail {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    background: #000;
    aspect-ratio: 16/9;
}

.video-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease, opacity 0.3s ease;
}

.video-thumbnail:hover .video-thumb-img {
    transform: scale(1.1);
    opacity: 0.7;
}

/* Play Overlay */
.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    transition: background 0.3s ease;
}

.video-thumbnail:hover .video-play-overlay {
    background: rgba(230, 124, 60, 0.8);
}

.play-button {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.video-thumbnail:hover .play-button {
    background: white;
    transform: scale(1.15);
}

.play-button i {
    font-size: 28px;
    color: #E67C3C;
    margin-left: 4px;
}

/* Video Duration Badge */
.video-duration {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
}

/* Video Info */
.video-info {
    padding: 20px;
}

.video-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.video-description {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Video Modal */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-modal.active {
    display: flex;
    opacity: 1;
}

.video-modal-content {
    background: white;
    border-radius: 8px;
    max-width: 90%;
    max-height: 90%;
    width: 1000px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.video-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    font-size: 18px;
}

.video-modal-close:hover {
    background: #E67C3C;
    transform: scale(1.1);
}

.video-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e0e0e0;
}

.video-modal-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
    font-weight: 600;
}

.video-modal-body {
    padding: 0;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */

@media (max-width: 768px) {
    /* Photo Gallery */
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }

    .gallery-tab-button {
        padding: 12px 20px;
        font-size: 14px;
    }

    .day-filter-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .day-filter-select {
        width: 100%;
    }

    .lightbox-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
    }

    .lightbox-prev,
    .lightbox-next {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .lightbox-prev {
        left: 15px;
    }

    .lightbox-next {
        right: 15px;
    }

    /* Video Gallery */
    .video-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .video-modal-content {
        width: 95%;
    }

    .video-modal-header {
        padding: 15px;
    }

    .video-modal-header h3 {
        font-size: 16px;
        padding-right: 30px;
    }
}

@media (max-width: 480px) {
    .photo-grid {
        grid-template-columns: 1fr;
    }

    .gallery-intro h3 {
        font-size: 22px;
    }

    .gallery-intro p {
        font-size: 14px;
    }

    .play-button {
        width: 60px;
        height: 60px;
    }

    .play-button i {
        font-size: 24px;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.gallery-tab-button:focus,
.day-filter-select:focus,
.lightbox-close:focus,
.lightbox-prev:focus,
.lightbox-next:focus,
.video-modal-close:focus {
    outline: 2px solid #E67C3C;
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
