/* ===== Base & Reset ===== */
body {
    font-family: 'Cairo', sans-serif;
    line-height: 1.9;
    color: #3d2f1f;
    margin: 0;
    padding: 0;
    background: #f9f5f0;
    /* Warm beige background */
}

/* ===== Typography ===== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Cairo', sans-serif;
}

/* ===== Layout ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ===== Header ===== */
.header {
    background: rgba(249, 245, 240, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(140, 107, 61, 0.15);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.5rem;
    color: #3d2f1f;
    font-family: 'Cairo', sans-serif;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: #5e482d;
    font-weight: 600;
    font-family: 'Cairo', sans-serif;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #b08d55;
}

/* ===== Book Header (Hero) ===== */
.book-header {
    background: linear-gradient(135deg, #5e482d 0%, #8c6b3d 50%, #b08d55 100%);
    padding: 5rem 0;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.book-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 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='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
}

.book-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    color: #f0e6d6;
    position: relative;
}

.book-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin: 0 0 0.75rem;
    line-height: 1.2;
    position: relative;
    text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.2);
}

.book-subtitle {
    font-size: 1.5rem;
    opacity: 0.9;
    margin: 0 0 2rem;
    font-weight: 300;
    position: relative;
}

.book-meta {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    font-size: 1.05rem;
    opacity: 0.85;
    flex-wrap: wrap;
    position: relative;
    font-family: 'Cairo', sans-serif;
}

.book-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== Content Area ===== */
.content {
    max-width: 900px;
    margin: 3rem auto 5rem;
    padding: 0 1.5rem;
    font-size: 1.25rem;
}

.content p {
    margin-bottom: 1.75rem;
    text-align: justify;
}

/* ===== Intro Box ===== */
.intro-box {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(240, 230, 214, 0.7) 100%);
    backdrop-filter: blur(8px);
    border-right: 6px solid #b08d55;
    padding: 2rem;
    margin-bottom: 3rem;
    border-radius: 0 16px 16px 0;
    font-size: 1.2rem;
    line-height: 2;
    box-shadow: 0 10px 30px rgba(140, 107, 61, 0.1);
}

.intro-box p {
    margin: 0;
}

/* ===== Table of Contents ===== */
.toc-box {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(140, 107, 61, 0.2);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 4rem;
    box-shadow: 0 15px 35px rgba(140, 107, 61, 0.08);
}

.toc-box h3 {
    margin: 0 0 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(140, 107, 61, 0.15);
    color: #3d2f1f;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(140, 107, 61, 0.1);
}

.toc-list li:last-child {
    border-bottom: none;
}

.toc-list a {
    text-decoration: none;
    color: #5e482d;
    font-size: 1.1rem;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s;
    display: inline-block;
}

.toc-list a:hover {
    color: #b08d55;
    padding-right: 0.5rem;
}

/* ===== Section Headings ===== */
section {
    margin-bottom: 5rem;
    scroll-margin-top: 100px;
}

section h2 {
    font-size: 2.25rem;
    margin: 0 0 2rem;
    color: #3d2f1f;
    font-weight: 800;
    border-bottom: 4px solid #b08d55;
    padding-bottom: 0.75rem;
    display: inline-block;
}

section h3 {
    font-size: 1.5rem;
    margin: 2.5rem 0 1rem;
    color: #5e482d;
    font-weight: 700;
}

/* ===== Blockquotes (Hadith & Athar) ===== */
.hadith-box,
.athar-box {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(240, 230, 214, 0.9) 100%);
    backdrop-filter: blur(8px);
    border: 2px solid rgba(140, 107, 61, 0.25);
    border-radius: 16px;
    padding: 2rem 2.5rem;
    margin: 2rem 0 2.5rem;
    position: relative;
    box-shadow:
        0 10px 25px rgba(140, 107, 61, 0.1),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    transition: transform 0.3s, box-shadow 0.3s;
}

.hadith-box:hover,
.athar-box:hover {
    transform: translateY(-3px);
    box-shadow:
        0 15px 35px rgba(140, 107, 61, 0.15),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.hadith-box::before {
    content: '❝';
    position: absolute;
    top: -10px;
    right: 20px;
    font-size: 3rem;
    color: #b08d55;
    opacity: 0.4;
}

.hadith-box p,
.athar-box p {
    font-size: 1.4rem;
    margin: 0 0 1rem;
    text-align: center;
    color: #3d2f1f;
    font-weight: 600;
}

.hadith-box cite,
.athar-box cite {
    display: block;
    text-align: left;
    font-style: normal;
    font-size: 0.95rem;
    color: #8c6b3d;
    font-family: 'Cairo', sans-serif;
}

.athar-box {
    border-color: rgba(93, 64, 55, 0.25);
}

.athar-box::before {
    color: #5d4037;
}

/* ===== Highlight Boxes ===== */
.highlight-box {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-right: 6px solid #22c55e;
    padding: 2rem;
    margin: 2.5rem 0;
    border-radius: 0 16px 16px 0;
}

.highlight-box.warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-right-color: #f59e0b;
}

.highlight-box h4 {
    margin: 0 0 1rem;
    color: #166534;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.highlight-box.warning h4 {
    color: #92400e;
}

.highlight-box p {
    margin: 0;
}

.highlight-box ul {
    margin: 1rem 0 0;
    padding-right: 1.5rem;
}

.highlight-box li {
    margin-bottom: 0.5rem;
}

/* ===== Key Points Box ===== */
.key-points-box {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(140, 107, 61, 0.2);
    border-radius: 16px;
    padding: 2rem;
    margin: 2.5rem 0;
    box-shadow: 0 10px 30px rgba(140, 107, 61, 0.08);
}

.key-points-box h4 {
    margin: 0 0 1.25rem;
    color: #3d2f1f;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.key-points-box ul {
    margin: 0;
    padding-right: 1.5rem;
}

.key-points-box li {
    margin-bottom: 0.6rem;
    line-height: 1.8;
}

/* ===== Data Tables ===== */
.data-table-container {
    margin: 3rem 0;
    overflow-x: auto;
}

.data-table-container h3 {
    margin-bottom: 1rem;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(140, 107, 61, 0.1);
}

.data-table th {
    background: linear-gradient(135deg, #5e482d 0%, #8c6b3d 100%);
    color: white;
    padding: 1.25rem 1rem;
    text-align: right;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(140, 107, 61, 0.1);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background: rgba(240, 230, 214, 0.5);
}

/* ===== Effects Grid ===== */
.effects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2.5rem 0;
}

.effect-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(140, 107, 61, 0.15);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 8px 25px rgba(140, 107, 61, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.effect-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(140, 107, 61, 0.15);
    border-color: #b08d55;
}

.effect-icon {
    font-size: 2.5rem;
    color: #b08d55;
    margin-bottom: 1rem;
}

.effect-card h4 {
    margin: 0 0 0.75rem;
    color: #3d2f1f;
    font-size: 1.15rem;
}

.effect-card p {
    margin: 0;
    font-size: 1rem;
    color: #5e482d;
    line-height: 1.7;
}

/* ===== End Section ===== */
.end-section {
    text-align: center;
    padding: 4rem 0;
    border-top: 2px solid rgba(140, 107, 61, 0.15);
    margin-top: 4rem;
}

.end-content i {
    font-size: 3rem;
    color: #b08d55;
    margin-bottom: 1.5rem;
}

.end-content h3 {
    margin: 0 0 1rem;
    font-size: 1.75rem;
    color: #3d2f1f;
}

.end-content p {
    max-width: 500px;
    margin: 0 auto 2rem;
    color: #5e482d;
}

.read-more-btn {
    display: inline-block;
    background: linear-gradient(135deg, #8c6b3d 0%, #b08d55 100%);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    font-family: 'Cairo', sans-serif;
    box-shadow: 0 10px 30px rgba(140, 107, 61, 0.3);
    transition: all 0.3s;
}

.read-more-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(140, 107, 61, 0.4);
}

/* ===== Footer ===== */
.footer {
    background: #3d2f1f;
    color: #f0e6d6;
    padding: 4rem 0 2rem;
    margin-top: 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
    color: white;
}

.footer-subtitle {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #b08d55;
}

.footer-description {
    opacity: 0.8;
    line-height: 1.8;
    font-size: 1rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    color: #f0e6d6;
    text-decoration: none;
    opacity: 0.8;
    transition: all 0.3s;
    font-family: 'Cairo', sans-serif;
}

.footer-links a:hover {
    opacity: 1;
    padding-right: 0.5rem;
    color: #b08d55;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #f0e6d6;
    font-size: 1.2rem;
    transition: all 0.3s;
    text-decoration: none;
}

.social-links a:hover {
    background: #b08d55;
    color: white;
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-text {
    opacity: 0.6;
    font-size: 0.95rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .book-title {
        font-size: 2.25rem;
    }

    .book-subtitle {
        font-size: 1.15rem;
    }

    .book-meta {
        gap: 1.5rem;
        font-size: 0.9rem;
    }

    .content {
        font-size: 1.1rem;
    }

    section h2 {
        font-size: 1.75rem;
    }

    .hadith-box p,
    .athar-box p {
        font-size: 1.2rem;
    }

    .nav-links {
        display: none;
        /* Consider hamburger menu for mobile */
    }

    .toc-box {
        padding: 1.5rem;
    }

    .effects-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== Smooth Scroll ===== */
html {
    scroll-behavior: smooth;
}