/* ==========================================================================
   HADITH MODULE STYLES
   Uses the site's existing design tokens (--gold, --cream, --charcoal, etc.)
   defined globally in assets/css/style.css -- no colors are redefined here.
   ========================================================================== */

/* ---- Controls bar (Dark Mode toggle -- shares logic with quran-controls.js) ---- */
.controls-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.control-btn {
    padding: 8px 18px;
    border-radius: 50px;
    border: 2px solid var(--gold);
    background: transparent;
    color: var(--gold);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
}
.control-btn:hover {
    background: var(--gold);
    color: #fff;
}
html[data-theme="dark"] .control-btn {
    background: #26231e;
    border-color: rgba(212, 180, 131, 0.25);
    color: #c9c2b4;
}

/* ---- Hero (matches .about-hero / .quran-hero pattern) ---- */
.hadith-hero {
    padding: 160px 0 40px;
    background: linear-gradient(135deg, var(--cream) 0%, var(--beige) 60%, rgba(212, 180, 131, 0.3) 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hadith-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.06;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%238B6B4A' fill-opacity='1'%3E%3Cpath d='M30 0l8.66 5v10L30 20l-8.66-5V5zm0 40l8.66 5v10L30 60l-8.66-5V45z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hadith-hero .container {
    position: relative;
    z-index: 2;
}

/* ---- Search bar on hero ---- */
.hadith-search-form {
    display: flex;
    max-width: 560px;
    margin: 28px auto 0;
    gap: 8px;
}
.hadith-search-form input {
    flex: 1;
    padding: 14px 20px;
    border-radius: 50px;
    border: 1px solid rgba(212, 180, 131, 0.4);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    background: #fff;
    color: var(--charcoal);
}
.hadith-search-form button {
    padding: 14px 28px;
    border-radius: 50px;
    border: none;
    background: linear-gradient(135deg, var(--gold), #e6b830);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(201, 162, 39, 0.35);
}

/* ---- Daily / Random Hadith card ---- */
.hadith-daily-section {
    padding: 40px 0;
    background: var(--white);
}
.hadith-daily-card {
    max-width: 720px;
    margin: 0 auto;
    background: var(--cream);
    border: 1px solid rgba(212, 180, 131, 0.3);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow);
}
.hadith-daily-label {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gold);
    margin-bottom: 14px;
}
.hadith-daily-text {
    font-family: 'Playfair Display', serif;
    font-size: 19px;
    line-height: 1.7;
    color: var(--charcoal);
    margin-bottom: 16px;
}
.hadith-daily-source {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 20px;
}
.hadith-btn-outline {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 50px;
    border: 2px solid var(--gold);
    color: var(--gold);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
}
.hadith-btn-outline:hover {
    background: var(--gold);
    color: #fff;
}

/* ---- Book grid ---- */
.hadith-books-section {
    padding: 20px 0 80px;
    background: var(--white);
}
.hadith-book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 32px;
}
.hadith-book-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px;
    background: #fff;
    border: 1px solid rgba(212, 180, 131, 0.3);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--charcoal);
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.hadith-book-card:hover {
    transform: translateY(-2px);
    border-color: var(--gold);
    box-shadow: 0 8px 32px rgba(139, 107, 74, 0.18);
}
.hadith-book-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(201, 162, 39, 0.12);
    border: 1px solid rgba(201, 162, 39, 0.4);
    color: var(--gold);
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}
.hadith-book-name {
    font-weight: 600;
    font-size: 15px;
}

/* ---- Chapter list (book.php) ---- */
.hadith-chapter-list {
    list-style: none;
    padding: 0;
    margin: 32px 0 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.hadith-chapter-list a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid rgba(212, 180, 131, 0.3);
    border-radius: 12px;
    text-decoration: none;
    color: var(--charcoal);
    transition: var(--transition);
}
.hadith-chapter-list a:hover {
    border-color: var(--gold);
    background: var(--cream);
}
.hadith-chapter-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 16px;
    background: rgba(201, 162, 39, 0.12);
    border: 1px solid rgba(201, 162, 39, 0.4);
    color: var(--gold);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.hadith-chapter-title {
    font-weight: 500;
    font-size: 15px;
}

/* ---- Individual hadith card (chapter.php / search.php) ---- */
.hadith-card {
    background: #fff;
    border: 1px solid rgba(212, 180, 131, 0.25);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 24px;
    margin-bottom: 16px;
}
.hadith-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.hadith-card-num {
    font-size: 12px;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.hadith-card-book {
    font-size: 12px;
    color: #9ca3af;
}
.hadith-card-text {
    font-family: 'Playfair Display', serif;
    font-size: 17px;
    line-height: 1.75;
    color: var(--charcoal);
}
.hadith-card-grade {
    display: inline-block;
    margin-top: 14px;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(92, 124, 90, 0.12);
    color: var(--emerald);
}

/* ---- Chapter Previous/Next navigation ---- */
.hadith-chapter-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 28px;
    gap: 12px;
    flex-wrap: wrap;
}
.hadith-chapter-nav a {
    padding: 10px 22px;
    background: linear-gradient(135deg, var(--gold), #e6b830);
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(201, 162, 39, 0.35);
    transition: var(--transition);
    max-width: 45%;
}
.hadith-chapter-nav a:hover:not(.disabled) {
    transform: translateY(-2px);
}
.hadith-chapter-nav a.disabled {
    background: #e5e7eb;
    color: #9ca3af;
    box-shadow: none;
    pointer-events: none;
}

/* ---- Back link (shared) ---- */
.hadith-back-link {
    display: inline-block;
    margin-bottom: 16px;
    color: var(--gold);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}
.hadith-back-link:hover { text-decoration: underline; }

/* ---- Search results ---- */
.hadith-search-meta {
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 24px;
}
.hadith-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

/* ==========================================================================
   DARK MODE -- reuses the same toggle mechanism as the Quran reader
   (quran-controls.js already handles the localStorage + data-theme logic;
   this section just adds hadith-specific overrides while it's active)
   ========================================================================== */
html[data-theme="dark"] body {
    background: #1c1a17;
    color: #e8e3da;
}
html[data-theme="dark"] .hadith-hero {
    background: linear-gradient(135deg, #22201c 0%, #1c1a17 100%);
}
html[data-theme="dark"] .hadith-daily-section,
html[data-theme="dark"] .hadith-books-section {
    background: #1c1a17;
}
html[data-theme="dark"] .section-header h1,
html[data-theme="dark"] .section-header h2 {
    color: var(--gold-light);
}
html[data-theme="dark"] .hadith-daily-card,
html[data-theme="dark"] .hadith-book-card,
html[data-theme="dark"] .hadith-chapter-list a,
html[data-theme="dark"] .hadith-card {
    background: #26231e;
    border-color: rgba(212, 180, 131, 0.2);
}
html[data-theme="dark"] .hadith-daily-text,
html[data-theme="dark"] .hadith-card-text,
html[data-theme="dark"] .hadith-book-name,
html[data-theme="dark"] .hadith-chapter-title {
    color: #f0ebe1;
}
html[data-theme="dark"] .hadith-daily-source,
html[data-theme="dark"] .hadith-card-book,
html[data-theme="dark"] .hadith-search-meta {
    color: #9c9284;
}
html[data-theme="dark"] .hadith-search-form input {
    background: #26231e;
    border-color: rgba(212, 180, 131, 0.25);
    color: #e8e3da;
}

/* Fixes the SHARED navbar (same issue as the Quran module) -- it has no
   background until scrolled, and its text/logo colors assume a light
   page behind it. Only applied while data-theme="dark" is active. */
html[data-theme="dark"] .nav-logo {
    color: #f0ebe1;
}
html[data-theme="dark"] .nav-links a {
    color: #c9c2b4;
}
html[data-theme="dark"] .navbar.scrolled {
    background: rgba(28, 26, 23, 0.95);
}
html[data-theme="dark"] .nav-icon-btn {
    color: #c9c2b4;
}
html[data-theme="dark"] .hamburger span {
    background: #f0ebe1;
}
