/* ============================================
   PHOTO CAROUSEL for Posts & Milestones
   ============================================ */

/* Carousel Container */
.post-photo-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    background: #000;
    margin-bottom: 16px;
}

/* Carousel Inner Container */
.post-photo-carousel-inner {
    position: relative;
    width: 100%;
    height: auto;
    display: flex;
    transition: transform 0.3s ease-in-out;
}

/* Individual Photo Slide */
.post-photo-slide {
    min-width: 100%;
    height: auto;
    display: none;
    animation: fadeIn 0.3s ease;
}

.post-photo-slide.active {
    display: block;
}

.post-photo-slide img {
    width: 100%;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.post-photo-slide img:hover {
    transform: scale(1.02);
}

/* Navigation Buttons */
.post-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    color: #0f1724;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10;
    opacity: 0;
}

.post-photo-carousel:hover .post-carousel-nav {
    opacity: 1;
}

.post-carousel-nav:hover {
    background: rgba(31, 182, 255, 0.95);
    color: white;
    transform: translateY(-50%) scale(1.1);
}

.post-carousel-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.post-carousel-prev {
    left: 12px;
}

.post-carousel-next {
    right: 12px;
}

[data-theme="dark"] .post-carousel-nav {
    background: rgba(26, 35, 50, 0.95);
    color: #f8fafb;
}

[data-theme="dark"] .post-carousel-nav:hover {
    background: rgba(31, 182, 255, 0.95);
    color: white;
}

/* Carousel Indicators (Dots) */
.post-carousel-indicators {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.post-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.post-carousel-dot:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.post-carousel-dot.active {
    background: #1fb6ff;
    width: 28px;
    border-radius: 10px;
    transform: scale(1);
}

/* Feed Image Modal (for full-screen viewing) */
#feedImageModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10001;
    padding: 20px;
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

#feedImageModal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.feed-image-modal-content {
    position: relative;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.feed-modal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

/* Modal Close Button */
.feed-modal-close {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 10002;
}

.feed-modal-close:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
    transform: rotate(90deg);
}

/* Modal Navigation Buttons */
.feed-modal-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 10002;
}

.feed-modal-nav:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-50%) scale(1.1);
}

.feed-modal-nav--prev {
    left: 20px;
}

.feed-modal-nav--next {
    right: 20px;
}

/* Modal Counter */
.feed-modal-counter {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    margin-top: 16px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    font-weight: 600;
}

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

/* Responsive Styles */
@media (max-width: 768px) {
    .post-photo-slide img {
        max-height: 500px;
    }
    
    .post-carousel-nav {
        width: 38px;
        height: 38px;
        font-size: 1.3rem;
    }
    
    .post-carousel-prev {
        left: 8px;
    }
    
    .post-carousel-next {
        right: 8px;
    }
    
    .post-carousel-indicators {
        bottom: 12px;
        gap: 8px;
        padding: 6px 12px;
    }
    
    .post-carousel-dot {
        width: 8px;
        height: 8px;
    }
    
    .post-carousel-dot.active {
        width: 24px;
    }
    
    .feed-modal-image {
        max-height: 70vh;
    }
    
    .feed-modal-nav {
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
    }
    
    .feed-modal-close {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
        top: 15px;
        right: 15px;
    }
}

@media (max-width: 576px) {
    .post-photo-slide img {
        max-height: 400px;
        border-radius: 8px;
    }
    
    .post-photo-carousel {
        border-radius: 8px;
    }
    
    .post-carousel-nav {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
        opacity: 1;
    }
    
    .post-carousel-prev {
        left: 6px;
    }
    
    .post-carousel-next {
        right: 6px;
    }
    
    .post-carousel-indicators {
        bottom: 8px;
        gap: 6px;
        padding: 4px 10px;
    }
    
    .post-carousel-dot {
        width: 7px;
        height: 7px;
    }
    
    .post-carousel-dot.active {
        width: 20px;
    }
    
    .feed-modal-image {
        max-height: 60vh;
        border-radius: 8px;
    }
    
    .feed-modal-nav {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }
    
    .feed-modal-nav--prev {
        left: 10px;
    }
    
    .feed-modal-nav--next {
        right: 10px;
    }
    
    .feed-modal-close {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
        top: 10px;
        right: 10px;
    }
    
    .feed-modal-counter {
        font-size: 0.85rem;
        margin-top: 12px;
        padding: 6px 12px;
    }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .post-photo-carousel-inner,
    .post-photo-slide,
    .post-carousel-nav,
    .feed-modal-image {
        animation: none;
        transition: none;
    }
}
