.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.show {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close, #commentsFilterOption {
    cursor: pointer;
    outline: none;
}

.modal-close {
    font-weight: bold;
    font-size: 28px;
    float: right;
    color: #aaa;
}

.modal-close:hover {
    color: black;
}

.app-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.app-card:hover {
    transform: translateY(-4px);
}

.screenshots-container {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 8px;
    scrollbar-width: thin;
}

.screenshots-container img {
    height: 200px;
    border-radius: 8px;
    object-fit: cover;
}

.description-toggle, .comments-toggle {
    color: #3b82f6;
    cursor: pointer;
    text-decoration: underline;
}

.comments-toggle {
    display: flex;
    align-items: center;
}

.download-btn {
    background-color: #3b82f6;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.download-btn:hover {
    background-color: #2563eb;
}

.version-history-btn {
    color: #3b82f6;
    cursor: pointer;
    text-decoration: underline;
    margin-top: 8px;
    display: inline-block;
}

.rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rating-star {
    color: #fbbf24;
}

/* Image Preview Modal Styles */
#imagePreviewModal {
    display: flex;
    align-items: center;
    justify-content: center;
}

#imagePreviewModal .modal-content {
    background: transparent;
    box-shadow: none;
    margin: 0;
    padding: 0;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    overflow: visible;
    position: relative;
}

#imagePreviewModal .imageClose {
    position: fixed;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

#imagePreviewModal .imageClose:hover {
    color: #ddd;
}

#previewImage {
    max-height: 85vh;
    max-width: 85vw;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#prevImage, #nextImage {
    opacity: 0.8;
    transition: opacity 0.2s;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    outline: none;
}

#prevImage {
    left: 20px;
}

#nextImage {
    right: 20px;
}

#prevImage:hover, #nextImage:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.7);
}

@media (max-width: 640px) {
    #prevImage, #nextImage {
        padding: 8px;
    }
    
    #prevImage svg, #nextImage svg {
        width: 20px;
        height: 20px;
    }
}

#imageProgress {
    position: absolute;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: opacity 0.2s;
    white-space: nowrap;
    z-index: 10;
}

#imageProgress:hover {
    background: rgba(0, 0, 0, 0.8);
}