/* Daily Hadith Ticker Styles */
.ahms-daily-hadith-ticker {
    display: flex;
    align-items: center;
    background: var(--bg-color, #f8fafc);
    border: 2px solid #000000;
    border-radius: 50px;
    overflow: hidden;
    height: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    direction: rtl;
    font-family: 'default', default;
    max-width: 100%;
    margin: 10px 0;
    cursor: pointer;
}

.ticker-label {
    background: var(--title-bg, #3b82f6);
    color: var(--title-color, #ffffff);
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
    border-left: 2px solid #000000;
    border-radius: 48px 0 0 48px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 2;
    letter-spacing: 0.5px;
}

.ticker-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 100%;
    background: var(--bg-color, #f8fafc);
}

.ticker-content {
    display: inline-block;
    white-space: nowrap;
    animation: ticker var(--ticker-speed, 20s) linear infinite;
    padding: 0 10px;
    line-height: 50px;
}

.ticker-link {
    text-decoration: none;
    color: var(--text-color, #1e293b);
    display: inline-block;
    transition: color 0.3s ease;
}

.ticker-link:hover {
    color: #3b82f6;
}

.ticker-text {
    font-weight: 600;
    font-size: 1rem;
    margin-left: 5px;
}

.ticker-reference {
    font-size: 0.9rem;
    color: #64748b;
    margin-right: 5px;
}

.ticker-link:hover .ticker-reference {
    color: #3b82f6;
}

/* Pause animation on hover */
.ahms-daily-hadith-ticker:hover .ticker-content {
    animation-play-state: paused;
}

@keyframes ticker {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Modal Styles */
.ahms-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    direction: rtl;
    font-family: 'default', default;
}

.ahms-modal.active {
    display: block;
}

.ahms-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.ahms-modal-container {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    margin: 5vh auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.ahms-modal-header {
    padding: 20px 25px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.ahms-modal-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.ahms-modal-close {
    width: 36px;
    height: 36px;
    border: 2px solid #000000;
    border-radius: 50%;
    background: white;
    color: #1e293b;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    line-height: 1;
}

.ahms-modal-close:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
    transform: rotate(90deg);
}

.ahms-modal-body {
    padding: 25px;
    max-height: calc(90vh - 140px);
    overflow-y: auto;
    background: white;
}

.ahms-modal-loading {
    text-align: center;
    padding: 40px;
    color: #64748b;
    font-size: 1rem;
}

.ahms-modal-loading svg {
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    color: #3b82f6;
    margin-bottom: 15px;
}

.ahms-modal-error {
    text-align: center;
    padding: 30px;
    color: #b91c1c;
    background: #fee2e2;
    border-radius: 10px;
    border: 1px solid #fecaca;
    font-size: 1rem;
}

/* Popup Content Styles */
.ahms-popup-content {
    font-family: 'default', default;
}

.popup-header {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.popup-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 5px 0;
}

.popup-hadith-number {
    font-size: 0.9rem;
    color: #3b82f6;
    font-weight: 600;
}

.popup-section {
    margin-bottom: 25px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.popup-section .section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #3b82f6;
    margin: 0 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 2px solid #3b82f6;
}

.arabic-text {
    font-family: 'default', default;
    font-size: 1.2rem;
    line-height: 2;
    color: #1e293b;
    direction: rtl;
    text-align: justify;
}

.urdu-text {
    font-size: 1rem;
    line-height: 1.8;
    color: #475569;
    direction: rtl;
    text-align: justify;
}

.english-text {
    font-family: 'default', default;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #334155;
    direction: ltr;
    text-align: justify;
}

.popup-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.footer-label {
    font-weight: 700;
    color: #64748b;
}

.footer-value {
    color: #1e293b;
    font-weight: 600;
}

.grade-sahih {
    color: #10b981;
}

.grade-hasan {
    color: #f59e0b;
}

.grade-daif {
    color: #ef4444;
}

.grade-mawdu {
    color: #6b7280;
}

.popup-metadata {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 10px;
    border: 1px solid #bae6fd;
}

.metadata-item {
    margin-bottom: 10px;
}

.metadata-item:last-child {
    margin-bottom: 0;
}

.metadata-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0369a1;
    display: block;
    margin-bottom: 3px;
}

.metadata-value {
    font-size: 0.95rem;
    color: #1e293b;
    background: white;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #bae6fd;
}

/* No hadith message */
.ahms-no-hadith {
    background: #fee2e2;
    color: #b91c1c;
    padding: 15px 20px;
    border-radius: 8px;
    text-align: center;
    font-family: 'default', default;
    border: 1px solid #fecaca;
    margin: 10px 0;
}

/* Widget Styles */
.widget_ahms_daily_hadith_ticker_widget .ahms-daily-hadith-ticker {
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ahms-daily-hadith-ticker {
        height: 45px;
        border-radius: 25px;
    }
    
    .ticker-label {
        padding: 0 15px;
        font-size: 0.9rem;
        border-radius: 23px 0 0 23px;
    }
    
    .ticker-content {
        line-height: 45px;
    }
    
    .ticker-text {
        font-size: 0.9rem;
    }
    
    .ticker-reference {
        font-size: 0.8rem;
    }
    
    .ahms-modal-container {
        width: 95%;
        margin: 2.5vh auto;
    }
    
    .ahms-modal-header {
        padding: 15px 20px;
    }
    
    .ahms-modal-title {
        font-size: 1.1rem;
    }
    
    .ahms-modal-body {
        padding: 15px;
    }
    
    .arabic-text {
        font-size: 1rem;
    }
    
    .popup-footer {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .ahms-daily-hadith-ticker {
        height: 40px;
        border-radius: 20px;
    }
    
    .ticker-label {
        padding: 0 12px;
        font-size: 0.85rem;
        border-radius: 18px 0 0 18px;
    }
    
    .ticker-content {
        line-height: 40px;
    }
    
    .ticker-text {
        font-size: 0.85rem;
    }
    
    .ticker-reference {
        font-size: 0.75rem;
    }
}

/* RTL Specific Adjustments */
[dir="rtl"] .ticker-label {
    border-left: 2px solid #000000;
    border-right: none;
    border-radius: 0 48px 48px 0;
}

[dir="rtl"] .ticker-text {
    margin-left: 0;
    margin-right: 5px;
}

[dir="rtl"] .ticker-reference {
    margin-right: 0;
    margin-left: 5px;
}

@media (max-width: 768px) {
    [dir="rtl"] .ticker-label {
        border-radius: 0 23px 23px 0;
    }
}

@media (max-width: 480px) {
    [dir="rtl"] .ticker-label {
        border-radius: 0 18px 18px 0;
    }
}