/* Enhanced Hadith Page Styles */
.hadith-container {
    padding: 2em 0;
}

.hadith-sidebar {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    height: 100%;
    overflow-y: auto;
}

#hadithList {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.hadith-item {
    border-bottom: 1px solid #eee;
}

.hadith-item:last-child {
    border-bottom: none;
}

.hadith-item a {
    display: flex;
    align-items: center;
    padding: 1rem;
    color: #333;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.hadith-item a:hover {
    background-color: #f8f9fa;
    text-decoration: none;
}

.hadith-item a.active {
    background-color: #c41e3a;
    color: #fff;
}

.hadith-number {
    min-width: 2rem;
    margin-right: 1rem;
    font-weight: bold;
}

.hadith-title {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
}

.search-box {
    margin-bottom: 2em;
}

.search-box input {
    width: 100%;
    margin-bottom: 0.5em;
}

.collections-nav,
.books-nav,
.chapters-nav {
    margin-bottom: 1.5em;
}

.collections-nav h3,
.books-nav h3,
.chapters-nav h3 {
    margin-bottom: 0.5em;
    color: #3d4449;
    font-size: 1.2em;
}

.form-control {
    width: 100%;
    padding: 0.5em;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 1em;
}

.hadith-content {
    background: white;
    padding: 2em;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.loading-spinner {
    text-align: center;
    padding: 2em;
    color: #666;
}

.collection-title {
    margin-bottom: 2em;
    padding-bottom: 1em;
    border-bottom: 1px solid #eee;
}

.arabic-title {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 0.8em;
    margin-left: 0.5em;
    color: #666;
}

.collection-info {
    color: #666;
    font-style: italic;
}

.hadith-entry {
    margin-bottom: 2em;
    padding: 1.5em;
    background: #f8f9fa;
    border-radius: 4px;
}

.hadith-number {
    font-weight: bold;
    color: #f56a6a;
    margin-bottom: 1em;
}

.arabic-text {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 1.8em;
    line-height: 2;
    direction: rtl;
    margin-bottom: 1.5em;
    padding: 1em;
    background: white;
    border-radius: 4px;
}

.quote-translation {
    font-style: italic;
    color: #666;
    text-align: center;
    margin-top: 1em;
}

.navigation-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 2em;
    padding-top: 1em;
    border-top: 1px solid #eee;
}

.navigation-controls .button {
    min-width: 150px;
}

.navigation-controls .button i {
    margin: 0 0.5em;
}

/* Responsive Adjustments */
@media screen and (max-width: 736px) {
    .hadith-sidebar {
        margin-bottom: 1em;
    }

    .hadith-content {
        padding: 1em;
    }

    .arabic-text {
        font-size: 1.5em;
    }

    .navigation-controls {
        flex-direction: column;
        gap: 1em;
    }

    .navigation-controls .button {
        width: 100%;
    }
}

/* Quote Box Styles */
.quote-box {
    background: #f8f9fa;
    padding: 2em;
    border-radius: 4px;
    margin-top: 2em;
    text-align: center;
}

.quote-box .arabic-text {
    font-size: 1.5em;
    margin-bottom: 1em;
    background: white;
    padding: 1em;
    border-radius: 4px;
}

.quote-box .quote-translation {
    font-style: italic;
    color: #666;
}

.hadith-entry .translation {
    font-size: 1.2em;
    line-height: 1.6;
    color: #2c3e50;
    margin-bottom: 15px;
}

.hadith-entry .hadith-footer {
    text-align: right;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.error {
    color: #e74c3c;
    padding: 1rem;
    background: #fdf3f2;
    border-radius: 4px;
    margin: 1rem 0;
}

.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: #666;
}

.reference {
    font-size: 0.9em;
    font-style: italic;
    color: #666;
}

/* Banner Styles */
#banner {
    background-color: #f5f6f7;
    padding: 4em 0;
    text-align: center;
    margin-bottom: 2em;
}

#banner .content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2em;
}

#banner h1 {
    font-size: 2.5em;
    margin: 0 0 0.5em 0;
    color: #3d4449;
}

#banner h2 {
    font-size: 1.75em;
    margin: 0 0 1em 0;
    color: #7f888f;
}

#banner p {
    font-size: 1.1em;
    line-height: 1.65;
    color: #7f888f;
}

.quote-box {
    margin-top: 2em;
    padding: 2em;
    background: #ffffff;
    border-radius: 0.375em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Main Content Styles */
.wrapper {
    padding: 4em 0;
}

.inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2em;
}

.hadith-container {
    background: #ffffff;
    padding: 2em;
    border-radius: 0.375em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Sidebar Styles */
.hadith-nav {
    margin-bottom: 2em;
}

.hadith-nav h3 {
    color: #3d4449;
    margin-bottom: 1em;
}

.nav-buttons {
    display: flex;
    gap: 1em;
    margin-top: 1em;
}

.button {
    display: inline-block;
    padding: 0.75em 1.5em;
    background-color: #f56a6a;
    color: #ffffff;
    border: none;
    border-radius: 0.375em;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.button:hover {
    background-color: #f67878;
}

.button.alt {
    background-color: transparent;
    border: 2px solid #f56a6a;
    color: #f56a6a;
}

.button.alt:hover {
    background-color: #f56a6a;
    color: #ffffff;
}

.button.small {
    font-size: 0.9em;
    padding: 0.5em 1em;
}

/* Hadith Content Styles */
.hadith-content {
    background: #ffffff;
    padding: 2em;
    border-radius: 0.375em;
}

.hadith-title {
    margin-bottom: 2em;
    text-align: center;
}

.hadith-title h2 {
    color: #3d4449;
    margin: 0;
}

.hadith-title span {
    color: #7f888f;
    font-size: 0.9em;
}

.hadith-text {
    margin: 2rem 0;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hadith-text .arabic-text {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 1.5rem;
    line-height: 2.5;
    text-align: right;
    direction: rtl;
    margin-bottom: 2rem;
    color: #333;
}

.hadith-text .english-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    margin-top: 1.5rem;
}

.content-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.content-section h2 {
    color: #c41e3a;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.topics-list, .benefits-list {
    list-style-type: none;
    padding-left: 0;
}

.topics-list li, .benefits-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    line-height: 1.6;
}

.topics-list li:last-child, .benefits-list li:last-child {
    border-bottom: none;
}

.explanation {
    line-height: 1.8;
    color: #333;
}

/* Citation styles */
.citation {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 0.9em;
    font-style: italic;
}

.citation i {
    margin-right: 0.5rem;
    color: #4a4a4a;
}

.citation span {
    vertical-align: middle;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 1.2em;
    color: #666;
}

.loading-spinner::after {
    content: '';
    width: 30px;
    height: 30px;
    margin-left: 10px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 2em;
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}

/* Active State for Sidebar Links */
.hadith-item a.active {
    background-color: #f0f0f0;
    border-left: 4px solid #3498db;
    padding-left: calc(1em - 4px);
}

/* Topics and Benefits Layout */
.topics-benefits {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2em;
    margin: 2em 0;
}

.topics ul, .benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.topics li, .benefits li {
    margin: 0.5em 0;
    padding: 0.5em;
    background: #f8f9fa;
    border-radius: 4px;
}

/* Responsive Design */
@media screen and (max-width: 736px) {
    #banner {
        padding: 2em 0;
    }

    .wrapper {
        padding: 2em 0;
    }

    .inner {
        padding: 0 1em;
    }

    .hadith-container {
        padding: 1em;
    }

    .hadith-content {
        padding: 1em;
    }

    .arabic-text {
        font-size: 1.5em;
    }
}

/* Form Controls */
select.form-control {
    width: 100%;
    padding: 0.75em;
    border: 1px solid #e5e5e5;
    border-radius: 0.375em;
    background-color: #ffffff;
    font-size: 1em;
    color: #3d4449;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

select.form-control:hover {
    border-color: #f56a6a;
}

select.form-control:focus {
    outline: none;
    border-color: #f56a6a;
    box-shadow: 0 0 0 2px rgba(245,106,106,0.2);
}

/* Topics and Benefits Lists */
.hadith-topics,
.hadith-benefits {
    margin-bottom: 2em;
}

.hadith-topics h3,
.hadith-benefits h3 {
    color: #3d4449;
    margin-bottom: 1em;
}

#topicsList,
#benefitsList {
    list-style: none;
    padding: 0;
    margin: 0;
}

#topicsList li,
#benefitsList li {
    padding: 0.5em 0;
    border-bottom: 1px solid #e5e5e5;
    color: #7f888f;
}

#topicsList li:last-child,
#benefitsList li:last-child {
    border-bottom: none;
}

/* Hadith Title Styles */
.hadith-title {
    color: #3d4449;
    margin-bottom: 1.5em;
    padding-bottom: 0.5em;
    border-bottom: 1px solid #eee;
}

/* Hadith List Styles */
.hadith-item {
    margin-bottom: 0.5em;
}

.hadith-item a {
    display: flex;
    align-items: center;
    padding: 0.5em;
    border-radius: 4px;
    text-decoration: none;
    color: #3d4449;
    transition: background-color 0.2s;
}

.hadith-item a:hover {
    background-color: #e9ecef;
}

.hadith-item a.active {
    background-color: #f56a6a;
    color: white;
}

.hadith-item .hadith-number {
    min-width: 2em;
    text-align: center;
    font-weight: bold;
    margin-right: 0.5em;
    padding: 0.2em 0.5em;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.hadith-item a.active .hadith-number {
    background-color: rgba(255, 255, 255, 0.2);
}

.hadith-item .hadith-title {
    flex-grow: 1;
    margin: 0;
    padding: 0;
    border: none;
}

/* Hadith Navigation */
.hadith-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2em;
    padding: 1em 0;
    border-bottom: 1px solid #eee;
}

.hadith-navigation a.button {
    display: inline-flex;
    align-items: center;
    padding: 0.5em 1em;
    background-color: #f8f1f1;
    border: 1px solid #d63031;
    color: #000000;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-weight: 500;
    min-width: 120px;
    justify-content: center;
}

.hadith-navigation a.button:hover {
    background-color: #d63031;
    color: #ffffff;
    text-decoration: none;
}

.hadith-navigation .hadith-actions {
    display: flex;
    gap: 0.75em;
}

.hadith-navigation .icon-button {
    background: none;
    border: none;
    color: #d63031;
    cursor: pointer;
    padding: 0.4em;
    font-size: 1em;
    transition: color 0.2s ease;
}

.hadith-navigation .icon-button i {
    font-size: 0.9em;
}

.hadith-navigation .icon-button:hover {
    color: #b71c1c;
}

/* Hadith Dropdown Styles */
.hadith-select-container {
    margin: 20px;
    padding: 15px;
    background: #f5f6f7;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#hadithSelect {
    width: 100%;
    padding: 12px;
    font-size: 1em;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    color: #3d4449;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

#hadithSelect:focus {
    outline: none;
    border-color: #f56a6a;
    box-shadow: 0 0 0 2px rgba(245, 106, 106, 0.2);
}

#hadithSelect option {
    padding: 12px;
}

@media screen and (max-width: 736px) {
    .hadith-select-container {
        margin: 10px;
        padding: 10px;
    }
    
    #hadithSelect {
        padding: 10px;
        font-size: 0.9em;
    }
}