/* Hadis Action Buttons */
.View-Hadis-btn, .View-Sanad-btn {
    padding: 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: white;
    position: relative;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.View-Hadis-btn:hover, .View-Sanad-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Hadis Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    background: linear-gradient(135deg, #007cde 0%, #00a3ff 100%);
    margin: 50px auto;
    padding: 30px;
    width: 90%;
    max-width: 800px;
    border-radius: 15px;
    position: relative;
    color: white;
}

/* Hadis Content Styles */
.hadis-title {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.hadis-title h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 500;
}

.hadis-reference {
    font-size: 14px;
    opacity: 0.8;
}

.hadis-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.hadis-arabic {
    text-align: center;
    direction: rtl;
    padding: 25px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.hadis-arabic p {
    font-family: 'Amiri', serif;
    font-size: 32px;
    line-height: 1.8;
    margin: 0;
}

.hadis-description {
    background: rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 10px;
}

.hadis-description h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 500;
}

.hadis-description p {
    margin: 0 0 15px 0;
    line-height: 1.6;
}

.modal-footer {
    text-align: center;
    margin-top: 20px;
}

.close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 12px 35px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Sanad Chain Styles */
.sanad-chain-container {
    margin: 30px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow-x: auto;
    max-height: 500px;
}

.sanad-chain {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 20px;
    min-width: fit-content;
}

.narrator {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.narrator-box {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px 30px;
    border-radius: 10px;
    text-align: center;
    min-width: 200px;
    transition: transform 0.3s ease;
}

.narrator-box:hover {
    transform: scale(1.05);
}

.narrator-box h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 500;
}

.narrator-box p {
    margin: 5px 0 0 0;
    font-size: 14px;
    opacity: 0.8;
}

.chain-connector {
    width: 2px;
    height: 30px;
    background: rgba(255, 255, 255, 0.3);
    margin-top: 10px;
}

/* Special styling for first and last narrators */
.narrator:first-child .narrator-box {
    background: rgba(0, 255, 0, 0.2);
}

.narrator-box.last {
    background: rgba(255, 255, 255, 0.3);
}

/* Scrollbar styling for the chain container */
.sanad-chain-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.sanad-chain-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.sanad-chain-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.sanad-chain-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .modal-content {
        margin: 20px auto;
        padding: 20px;
    }

    .hadis-arabic p {
        font-size: 26px;
    }

    .hadis-title h2 {
        font-size: 20px;
    }
}