/**
 * Enhanced Photo Story Modal Styles
 * Features: Caption above image, Next story preview, Reload functionality
 */

/* Modal Container */
.photo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.photo-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1;
}

.photo-modal-content {
    position: relative;
    z-index: 2;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Close Button */
.photo-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.photo-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(90deg);
}

/* Photo Counter */
.photo-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(30, 64, 175, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    z-index: 10;
}

/* Caption Above Image */
.modal-slide-caption {
    width: 100%;
    max-width: 900px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: none;
}

.modal-slide-caption:empty {
    display: none;
}

/* Image Container */
.photo-modal-image-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    max-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
}

.photo-modal-image-container img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    display: block;
    border-radius: 8px;
}

/* Navigation Buttons */
.photo-modal-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
    z-index: 5;
}

.photo-nav-btn {
    pointer-events: all;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.photo-nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.photo-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Next Story Preview */
.next-story-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 8;
    animation: fadeIn 0.5s ease;
}

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

.next-story-content {
    max-width: 600px;
    width: 90%;
    text-align: center;
    position: relative;
}

.next-story-badge {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    padding: 10px 25px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.next-story-badge i {
    font-size: 16px;
}

.next-story-preview img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.next-story-info h3 {
    color: white;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 25px;
    line-height: 1.4;
}

.read-next-btn {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(30, 64, 175, 0.4);
}

.read-next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(30, 64, 175, 0.6);
}

.read-next-btn i {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.read-next-btn:hover i {
    transform: translateX(5px);
}

/* Reload Story Button */
.reload-story-btn {
    position: absolute;
    bottom: 40px;
    right: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: none;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    z-index: 10;
}

.reload-story-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.reload-story-btn i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.reload-story-btn:hover i {
    transform: rotate(360deg);
}

/* Responsive Design */
@media (max-width: 768px) {
    .photo-modal-content {
        width: 95%;
        height: 95vh;
    }
    
    .photo-modal-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .photo-counter {
        top: 10px;
        left: 10px;
        padding: 8px 15px;
        font-size: 14px;
    }
    
    .modal-slide-caption {
        padding: 12px 20px;
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .photo-modal-image-container {
        max-height: 50vh;
    }
    
    .photo-modal-image-container img {
        max-height: 50vh;
    }
    
    .photo-nav-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .photo-modal-navigation {
        padding: 0 10px;
    }
    
    .next-story-info h3 {
        font-size: 20px;
    }
    
    .read-next-btn {
        padding: 12px 30px;
        font-size: 16px;
    }
    
    .reload-story-btn {
        bottom: 20px;
        right: 20px;
        padding: 12px 25px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .modal-slide-caption {
        padding: 10px 15px;
        font-size: 13px;
        margin-bottom: 10px;
    }
    
    .photo-modal-image-container {
        max-height: 45vh;
    }
    
    .photo-modal-image-container img {
        max-height: 45vh;
    }
    
    .next-story-preview img {
        max-height: 250px;
    }
    
    .next-story-info h3 {
        font-size: 18px;
        margin-bottom: 20px;
    }
    
    .reload-story-btn {
        bottom: 15px;
        right: 15px;
        padding: 10px 20px;
        font-size: 13px;
    }
}

/* Loading Animation */
.loading-next-story {
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.loading-next-story::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    margin-left: 10px;
    animation: spin 0.8s linear infinite;
}

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