/* General Styles */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #FFF8E7;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navigation Bar */
nav {
    background-color: #064e3b;
    padding: 0rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-left,
.nav-right {
    flex: 1;
}

.nav-center {
    flex: 2;
    text-align: center;
}

.nav-right ul {
    justify-content: flex-end;
}

.bismillah {
    color: #fbbf24;
    font-weight: bold;
    margin: 0;
    font-size: 1.2rem;
}

nav .logo {
    color: #fbbf24;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}

nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    align-items: center;
}

nav ul li {
    margin-left: 15px;
    position: relative;
    padding: 10px 0;
}

nav ul li a {
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 8px 10px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

nav ul li a:hover,
nav ul li a.active {
    background-color: #d4af37;
    color: #064e3b;
}

/* The Dropdown Menu */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #064e3b;
    min-width: 180px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0;
    z-index: 1001;
    border-top: none;
    overflow: hidden;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li {
    margin: 0;
    display: block;
    width: 100%;
    padding: 0;
}

.dropdown-menu li a {
    border-radius: 0;
    padding: 12px 20px;
    display: block;
    color: white;
    text-decoration: none;
    transition: 0.2s;
}

.dropdown-menu li a:hover {
    background-color: #d4af37;
    color: #064e3b;
}

/* --- MOBILE NAVIGATION --- */
.mobile-nav {
    display: none;
}

@media (max-width: 768px) {
    nav {
        display: none !important;
    }

    .mobile-nav {
        display: block !important;
        background-color: #064e3b;
        position: sticky;
        top: 0;
        z-index: 1000;
        border-bottom: 2px solid #d4af37;
    }

    .mobile-top-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 15px;
        height: 60px;
    }

    .m-left,
    .m-right {
        flex: 1;
    }

    .m-center {
        flex: 1;
        text-align: center;
    }

    .m-right {
        display: flex;
        justify-content: flex-end;
    }

    .mobile-bismillah {
        color: #fbbf24;
        font-weight: bold;
        font-size: 1.2rem;
        margin: 0;
        padding: 0;
    }

    .hamburger {
        background: none;
        border: none;
        color: #fbbf24;
        font-size: 1.8rem;
        cursor: pointer;
        padding: 0;
        margin: 0;
        display: flex;
        align-items: center;
    }

    #mobile-menu-list {
        display: none;
        list-style: none;
        padding: 0;
        margin: 0;
        background-color: #064e3b;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
    }

    #mobile-menu-list.show {
        display: block;
    }

    #mobile-menu-list li a {
        color: white;
        text-decoration: none;
        display: block;
        padding: 15px 20px;
        border-bottom: 1px solid rgba(212, 175, 55, 0.1);
    }

    .mobile-sub-menu {
        background-color: #043a2c;
        display: none;
        list-style: none;
        padding: 0;
        padding-left: 20px;
    }
}

/* Hero / Header Section */
header {
    text-align: center;
    color: white;
}

/* Specific Header Backgrounds */
header.index-hero {
    padding: 60px 20px;
    background: url('../media/po.jpg') center/cover;
}

header.index-hero h1 {
    font-size: 3rem;
    margin-bottom: 10px;
}

header.index-hero p {
    font-style: italic;
    font-size: 1.2rem;
}

header.db-hero {
    padding: 70px 20px;
    background: url('../media/lo.png') center/cover;
    box-shadow: inset 0 0 0 1000px rgba(0, 0, 0, 0.3);
}

header.db-hero h1 {
    font-size: 3rem;
    margin: 0;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.6);
}

header.fact-hero {
    padding: 70px 20px;
    background: url('../media/cal.png') center/cover;
    box-shadow: inset 0 0 0 1000px rgba(0, 0, 0, 0.3);
}

header.fact-hero h1 {
    font-size: 3rem;
    margin: 0;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.6);
}

.about-header {
    background-color: #064e3b;
    padding: 60px 20px 90px 20px;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.about-header h1 {
    font-size: 2.8rem;
    color: #ffffff;
    margin-bottom: 15px;
    font-weight: bold;
}

.about-header p {
    font-size: 1.35rem;
    color: #ffffff;
    max-width: 700px;
    margin: 0 auto;
    font-weight: 500;
    line-height: 1.6;
}

.about-header::after {
    content: '';
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 80px solid transparent;
    border-right: 80px solid transparent;
    border-bottom: 70px solid #fbbf24;
    z-index: 9;
}

.header {
    /* for leaf pages */
    border: 2px solid #d4af37;
    background-color: #147a3e;
    border-radius: 20px;
    padding: 40px 20px;
    width: 90%;
    max-width: 1000px;
    margin: 20px auto;
    color: rgb(255, 255, 255);
    font-size: 4rem;
    font-weight: bold;
    letter-spacing: 1px;
    text-align: center;
}

@media (max-width: 768px) {
    .header {
        font-size: 2.5rem;
        padding: 25px 15px;
    }
}

/* Container Style */
.container {
    max-width: 1200px;
    width: 90%;
    margin: 50px auto;
    padding: 0 20px;
    flex: 1;
}

/* For boxed containers (sub pages & about page) */
.container.boxed {
    max-width: 1200px;
    width: 90%;
    padding: 30px 40px;
    background-color: white;
    border-radius: 15px;
    border: 1.5px solid #d4af37;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    margin: 40px auto;
    flex: none;
}

.section-title {
    font-size: 1.8rem;
    color: #064e3b;
    margin-bottom: 40px;
    font-weight: bold;
    text-align: center;
    position: relative;
    padding-bottom: 12px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: #fbbf24;
    border-radius: 2px;
}

/* Subjects Grid (index.html) */
.subjects-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    margin-top: 35px;
}

.subject-card {
    flex: 0 1 calc(33.333% - 18px);
    min-width: 0;
    background: white;
    padding: 40px 30px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.subject-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.subject-card h3 {
    color: #064e3b;
    margin-bottom: 10px;
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
}

.subject-card p {
    font-size: 0.82rem;
    color: #888;
    line-height: 1.6;
    margin: 0;
}

/* Topics Grid (sub pages) */
.topic-label-section {
    font-size: 1.8rem;
    color: #064e3b;
    margin-bottom: 35px;
    font-weight: bold;
    display: inline-block;
}

/* Topics Grid */
.topics-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.topic-card {
    flex: 0 1 calc(33.333% - 14px);
    min-width: 0;
    background: white;
    padding: 22px 25px;
    border-radius: 12px;
    text-decoration: none;
    color: #064e3b;
    display: flex;
    align-items: center;
    gap: 18px;
    border: 1.5px solid #d4af37;
    transition: all 0.3s ease;
}

.topic-card:hover {
    transform: translateY(-5px);
    background-color: #fffdf7;
    box-shadow: 0 8px 20px rgba(212, 175, 55, 0.15);
}

.topic-index {
    background-color: #064e3b;
    color: white;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    flex-shrink: 0;
}

.topic-icon {
    font-size: 2.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.topic-text {
    font-size: 1.4rem;
    font-weight: 600;
}

@media (max-width: 600px) {
    .topic-text {
        font-size: 1.3rem;
    }

    .topic-card {
        min-height: 90px;
        padding: 15px 20px;
        gap: 15px;
        flex: 0 1 100%;
    }

    .topic-icon {
        font-size: 1.8rem;
    }

    .topic-index {
        width: 40px;
        height: 40px;
    }
}

/* About Page Styles */
.about-container {
    max-width: 900px;
    width: 90%;
    margin: -50px auto 50px auto;
    position: relative;
    z-index: 10;
}

.about-container .main-card {
    background: white;
    padding: 40px 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    border: none;
    margin-bottom: 40px;
    text-align: center;
}

.about-container .main-card .section-title {
    font-size: 1.8rem;
    color: #064e3b;
    margin-bottom: 25px;
    font-weight: bold;
    padding-bottom: 0;
}

.about-container .main-card .section-title::after {
    display: none;
}

.about-container .bio-text {
    line-height: 1.8;
    color: #374151;
    font-size: 1.1rem;
    text-align: center;
    margin: 0;
}

.about-container .profile-section {
    max-width: 650px;
    margin: 0 auto 30px auto;
    padding: 0;
}

.about-container .info-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px 20px;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    border: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.about-container .info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.about-container .info-card .text-content h2 {
    margin: 0 0 10px 0;
    color: #064e3b;
    font-size: 1.8rem;
    font-weight: bold;
}

.about-container .info-card .text-content p {
    margin: 6px 0;
    color: #4b5563;
    font-size: 1.05rem;
    line-height: 1.5;
}

.about-container .links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 50px;
}

.about-container .link-card {
    background: white;
    padding: 25px 20px;
    border-radius: 15px;
    text-align: center;
    text-decoration: none;
    color: #333;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    border: none;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.about-container .link-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.about-container .link-card .icon {
    font-size: 2rem;
    background: #f3f4f6;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.about-container .link-card:hover .icon {
    background-color: #064e3b;
    color: #ffffff;
    transform: scale(1.1);
}

.about-container .link-card span {
    font-weight: bold;
    color: #064e3b;
    font-size: 1.1rem;
}

.about-container .link-card small {
    color: #6b7280;
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .about-container .links-grid {
        grid-template-columns: 1fr;
    }
}

/* Master/Dua Container (for Leaf Pages) */
.master-container {
    max-width: 1050px;
    width: 90%;
    margin: 30px auto;
    padding: 30px 35px;
    background-color: white;
    border: 1.5px solid #d4af37;
    border-radius: 15px;
    flex: none;
}

.dua-card {
    margin-bottom: 40px;
    border-left: 5px solid #e1be4c;
    padding-left: 15px;
}

.section {
    padding: 18px 25px;
    margin-bottom: 10px;
    border-radius: 10px;
    line-height: 1.8;
    border: 1px solid #f0f0f0;
}

.arabic-verse {
    background-color: #ffffff;
    color: #064e3b;
    font-size: 1.8rem;
    text-align: right;
    direction: rtl;
}

.english-translation {
    background-color: #f8f9fa;
    color: #555;
    font-style: italic;
}

.bangla-translation {
    background-color: #f4f9f4;
    color: #064e3b;
    font-weight: 500;
}

.reference-bar {
    background-color: #064e3b;
    color: #fbbf24;
    text-align: right;
    font-weight: bold;
    border-radius: 8px;
    padding: 12px 20px;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background: #064e3b;
    color: white;
    margin-top: auto;
}

/* Responsiveness overrides for smartphone and tablet devices */
@media (max-width: 992px) {
    .subject-card {
        flex: 0 1 calc(50% - 13px);
    }
    .topic-card {
        flex: 0 1 calc(50% - 10px);
    }
}

@media (max-width: 768px) {
    .subject-card {
        flex: 0 1 100%;
    }
    .topic-card {
        flex: 0 1 100%;
    }

    .container.boxed, .master-container {
        width: 95%;
        padding: 20px 15px;
        margin: 20px auto;
    }

    header.index-hero h1, header.db-hero h1, header.fact-hero h1, .about-header h1 {
        font-size: 2rem;
    }

    header.index-hero p, .about-header p {
        font-size: 1.1rem;
    }

    .about-header::after {
        border-left-width: 40px;
        border-right-width: 40px;
        border-bottom-width: 35px;
    }

    .about-container {
        margin-top: -30px;
    }

    .about-container .main-card, 
    .about-container .info-card {
        padding: 20px 15px;
    }
}

@media (max-width: 480px) {
    .arabic-verse {
        font-size: 1.5rem;
    }

    .section {
        padding: 12px 15px;
        font-size: 0.95rem;
    }

    .reference-bar {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}
