/* Custom Image Lightbox Modal */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.95);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-modal.active {
    display: flex;
    opacity: 1;
}

.image-modal-content {
    display: flex;
    width: 100%;
    max-width: 1400px;
    height: 90vh;
    margin: auto;
    background: #1a1a2e;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Image Section (Left) */
.image-modal-viewer {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f0f1e;
    position: relative;
    min-width: 0;
}

.image-modal-viewer img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
}

/* Sidebar Card (Right) */
.image-modal-sidebar {
    width: 400px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Sidebar Header */
.image-modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.image-poster {
    display: flex;
    align-items: center;
    gap: 12px;
}

.image-poster-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1db9c3, #2d7ab5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
}

.image-poster-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.image-poster-info h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.image-poster-info p {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* Image Details */
.image-modal-details {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.image-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 12px 0;
}

.image-stats {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

.image-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.image-stat i {
    color: #1db9c3;
}

/* Comments Section */
.image-modal-comments {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.image-modal-comments h5 {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 16px 0;
}

.comment-item {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1db9c3, #2d7ab5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
}

.comment-author {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 4px 0;
}

.comment-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin: 0 0 4px 0;
    line-height: 1.5;
}

.comment-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

/* Comment Form */
.image-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.comment-form {
    display: flex;
    gap: 10px;
}

.comment-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 10px 16px;
    color: #fff;
    font-size: 13px;
    outline: none;
    transition: all 0.3s ease;
}

.comment-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: #1db9c3;
}

.comment-submit {
    background: linear-gradient(135deg, #1db9c3, #2d7ab5);
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    color: white;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.comment-submit:hover {
    transform: scale(1.05);
}

/* Navigation Buttons */
.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.modal-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.modal-nav-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

/* Close Button */
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 10;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Loading State */
.image-modal-viewer.loading::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(29, 185, 195, 0.3);
    border-top-color: #1db9c3;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 968px) {
    .image-modal-content {
        flex-direction: column;
        height: 100vh;
        max-width: 100%;
        border-radius: 0;
    }

    .image-modal-viewer {
        height: 50vh;
    }

    .image-modal-sidebar {
        width: 100%;
        height: 50vh;
    }

    .modal-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .modal-prev {
        left: 10px;
    }

    .modal-next {
        right: 10px;
    }
}

/* Scrollbar Styling */
.image-modal-comments::-webkit-scrollbar {
    width: 6px;
}

.image-modal-comments::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.image-modal-comments::-webkit-scrollbar-thumb {
    background: rgba(29, 185, 195, 0.5);
    border-radius: 3px;
}

.image-modal-comments::-webkit-scrollbar-thumb:hover {
    background: rgba(29, 185, 195, 0.7);
}