/* Hadith Card - Side by Side Layout with Islamic Design */

/* WIDER CARDS - Full Width Layout */
.hadiths-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: stretch;
}

/* Hadith Card Container */
.hadith-card {
    display: flex;
    flex-direction: column;
    background: #f8f6f3;
    border: 2px solid #d4c5b0;
    border-radius: 8px;
    overflow: visible;
    position: relative;
    padding: 2rem;
    min-height: 200px;
    transition: all 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.hadith-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Islamic Corner Decorations */
.hadith-corner-decoration {
    position: absolute;
    width: 40px;
    height: 40px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath fill='%2323DE00' d='M0,0 L40,0 L40,20 Q40,0 20,0 L0,0 Z'/%3E%3Cpath fill='%2323DE00' opacity='0.5' d='M0,0 L20,0 Q0,0 0,20 L0,0 Z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.6;
    pointer-events: none;
}

.hadith-corner-decoration.top-left {
    top: 0;
    left: 0;
}

.hadith-corner-decoration.top-right {
    top: 0;
    right: 0;
    transform: rotate(90deg);
}

.hadith-corner-decoration.bottom-left {
    bottom: 0;
    left: 0;
    transform: rotate(-90deg);
}

.hadith-corner-decoration.bottom-right {
    bottom: 0;
    right: 0;
    transform: rotate(180deg);
}

/* Narrator Badge at Top */
.hadith-narrator-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: rgba(35, 222, 0, 0.1);
    border-radius: 20px;
    font-size: 0.9rem;
    color: #0F9B00;
    margin-bottom: 1.5rem;
    align-self: flex-start;
    font-weight: 500;
}

.hadith-narrator-badge i {
    font-size: 1rem;
}

/* Content Container */
.hadith-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Dual Layout - Side by Side */
.hadith-dual-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
    padding: 1rem 0;
}

/* English Side */
.hadith-english-side {
    padding-right: 2rem;
    border-right: 1px solid #d4c5b0;
    overflow: visible;
}

.hadith-english-side .hadith-text-wrapper {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1rem;
    line-height: 1.8;
    color: #2c2c2c;
}

.hadith-english-side .hadith-text-full {
    margin: 0;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Arabic Side */
.hadith-arabic-side {
    padding-left: 2rem;
    direction: rtl;
    overflow: visible;
}

.hadith-arabic-text {
    font-family: 'Amiri', 'Traditional Arabic', 'Arabic Typesetting', serif;
    font-size: 1.3rem;
    line-height: 2.2;
    color: #2c2c2c;
    text-align: right;
    margin: 0;
    font-weight: 500;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Footer Section */
.hadith-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #d4c5b0;
}

.hadith-reference-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

/* Reference Left Side */
.reference-left {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.reference-label {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

.reference-value {
    font-size: 0.9rem;
    color: #2c2c2c;
}

.reference-value strong {
    color: #23DE00;
    font-weight: 600;
}

.ref-separator {
    margin: 0 0.3rem;
    color: #999;
}

/* Reference Right Side */
.reference-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.hadith-authenticity-badge {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: capitalize;
}

.hadith-authenticity-badge.sahih {
    background: rgba(35, 222, 0, 0.15);
    color: #0F9B00;
}

.hadith-authenticity-badge.hassan,
.hadith-authenticity-badge.hasan {
    background: rgba(255, 184, 0, 0.15);
    color: #c66900;
}

.hadith-authenticity-badge.daif,
.hadith-authenticity-badge.da-if {
    background: rgba(255, 51, 0, 0.15);
    color: #cc2900;
}

.hadith-authenticity-badge.mawdu {
    background: rgba(255, 0, 0, 0.15);
    color: #cc0000;
}

/* Action Buttons */
.hadith-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.hadith-action-btn {
    background: none;
    border: none;
    font-size: 0.85rem;
    color: #4a90e2;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    transition: color 0.3s ease;
    font-family: inherit;
}

.hadith-action-btn:hover {
    color: #23DE00;
}

.action-separator {
    color: #999;
    font-size: 0.85rem;
}

/* Notification Toast */
.hadith-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #23DE00;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.hadith-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Dark Theme Support */
[data-theme="dark"] .hadith-card {
    background: #1e1e1e;
    border-color: #333;
}

[data-theme="dark"] .hadith-english-side {
    border-right-color: #333;
}

[data-theme="dark"] .hadith-english-side .hadith-text-wrapper,
[data-theme="dark"] .hadith-arabic-text {
    color: #e0e0e0;
}

[data-theme="dark"] .hadith-footer {
    border-top-color: #333;
}

[data-theme="dark"] .reference-label {
    color: #999;
}

[data-theme="dark"] .reference-value {
    color: #e0e0e0;
}

[data-theme="dark"] .hadith-narrator-badge {
    background: rgba(35, 222, 0, 0.2);
    color: #84FF69;
}

[data-theme="dark"] .hadith-expand-btn {
    border-color: #333;
    color: #84FF69;
}

[data-theme="dark"] .hadith-expand-btn:hover {
    background: rgba(35, 222, 0, 0.2);
    border-color: #84FF69;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hadith-dual-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .hadith-english-side {
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid #d4c5b0;
        padding-bottom: 1.5rem;
    }
    
    .hadith-arabic-side {
        padding-left: 0;
        padding-top: 1.5rem;
    }
    
    [data-theme="dark"] .hadith-english-side {
        border-bottom-color: #333;
    }
}

@media (max-width: 768px) {
    .hadith-card {
        padding: 1.5rem;
    }
    
    .hadith-reference-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .reference-right {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
    
    .hadith-corner-decoration {
        width: 30px;
        height: 30px;
    }
    
    .hadith-arabic-text {
        font-size: 1.15rem;
        line-height: 2;
    }
}

/* Print Styles */
@media print {
    .hadith-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    .hadith-action-link {
        display: none;
    }
}

/* Smooth Transitions */
.hadith-text-excerpt,
.hadith-text-full {
    transition: opacity 0.3s ease;
}

/* No Content Warning */
.no-content-warning {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

/* Ensure proper text wrapping and no cutting */
.hadith-text-wrapper,
.hadith-arabic-text,
.hadith-text-full {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    overflow: visible;
}

/* Prevent text overflow in all text containers */
.hadith-dual-layout,
.hadith-english-side,
.hadith-arabic-side {
    overflow: visible;
}

.hadith-text-container {
    overflow: visible;
    width: 100%;
}
