/* Basic Fallback Horizontal Grid */
.basic-grid {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 0;
}

.basic-item {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    flex: 0 0 300px;
    height: 200px;
}

.basic-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Main Horizontal Line Layout */
.hadis-carousel {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    overflow-x: auto;
}

.hadis-grid {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding: 10px 0;
}

.grid-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 0 0 90px;
    width: 90px;
    display: flex;
    flex-direction: column;
}

.grid-item img {
    width: 100%;
    height: 70px;
    object-fit: cover;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.grid-item:hover img {
    transform: scale(1.1);
}

.image-text {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 4px;
    font-size: 9px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    height: 20px;
    line-height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    unicode-bidi: plaintext;
    direction: auto;
}







.view-icon {
    font-size: 24px;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Lightbox Styles */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.lightbox-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 90vh;
    gap: 20px;
}

.main-image-container {
    position: relative;
    background-color: rgb(255, 255, 255);
    max-width: 20vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.main-image-container img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px 8px 0 0px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-content-top {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 8px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    unicode-bidi: plaintext;
    direction: auto;
    line-height: 1.4;
    max-width: 100%;
    text-align: center;
}

.lightbox-content-bottom {
    margin-top: 20px;
    padding: 15px;
    color: rgb(0, 0, 0);
    border-radius: 8px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    unicode-bidi: plaintext;
    direction: auto;
    line-height: 1.4;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.gallery-content {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    unicode-bidi: plaintext;
    direction: auto;
    line-height: 1.4;
    text-align: center;
}

/* Thumbnail Styles */
.thumbnails-left,
.thumbnails-right {
    display: flex;
    gap: 10px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 10px 0;
}

.thumbnails-left {
    justify-content: flex-start;
}

.thumbnails-right {
    justify-content: flex-start;
}

.thumbnail {
    width: 80px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.thumbnail:hover {
    opacity: 1;
    border-color: #fff;
    transform: scale(1.1);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-left {
    margin-right: 10px;
}

.thumbnail-right {
    margin-left: 10px;
}

/* Navigation Arrows */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.nav-arrow:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
}

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

.nav-arrow:disabled:hover {
    transform: translateY(-50%);
}

.nav-left {
    left: 20px;
}

.nav-right {
    right: 20px;
}

/* Close Button */
.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 20;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.close-btn:hover {
    background: white;
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {
.main-image-container {
    max-width: 80vw;
    }

    .hadis-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .lightbox-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .thumbnails-left,
    .thumbnails-right {
        flex-direction: row;
        max-height: none;
        max-width: 80vw;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0 10px;
    }
    
    .thumbnail {
        width: 60px;
        height: 45px;
        flex-shrink: 0;
    }
    
    .thumbnail-left {
        margin-right: 5px;
        margin-bottom: 0;
    }
    
    .thumbnail-right {
        margin-left: 5px;
        margin-bottom: 0;
    }
    

    
    .nav-arrow {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .nav-left {
        left: 10px;
    }
    
    .nav-right {
        right: 10px;
    }
}

@media (max-width: 480px) {
    .hadis-grid {
        grid-template-columns: 1fr;
    }
    
    .thumbnail {
        width: 50px;
        height: 35px;
    }

    
}

/* Scrollbar Styling */
.thumbnails-left::-webkit-scrollbar,
.thumbnails-right::-webkit-scrollbar {
    width: 6px;
}

.thumbnails-left::-webkit-scrollbar-track,
.thumbnails-right::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.thumbnails-left::-webkit-scrollbar-thumb,
.thumbnails-right::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.thumbnails-left::-webkit-scrollbar-thumb:hover,
.thumbnails-right::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}
