@font-face {
    font-family: "Noracle";
    src: url(./Noracle.otf);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.title {
    font-family: "Noracle";
    font-weight: 900;
}

h2,
h3,
h4,
h5,
h6,
p,
li,
a {
    font-family: "PT Sans", sans-serif;
}

body {
    margin: 0;
    display: flex;
    min-height: 100vh;
    perspective: 2000px;
    color: hsl(180 68% 5%);
    background-image: radial-gradient(circle farthest-corner at 50% 50%, hsl(187 20% 88%) 30%, hsl(149 20% 94%) 100%);
    overflow: hidden;
}

.book {
    position: relative;
    display: flex;
    margin: 0 auto;
    width: 35vw;
    max-width: 600px;
    min-width: 250px;
    height: 100vh;
    max-height: 900px;
    pointer-events: none;
    transform-style: preserve-3d;
    transition: translate 1s;
    translate: calc(min(var(--c), 1) * 50%) 0%;
    counter-reset: page -1;

}

.page {
    --thickness: 4;
    flex: none;
    display: flex;
    width: 100%;
    height: 100%;
    font-size: clamp(14px, 2vw, 16px);
    pointer-events: all;
    user-select: none;
    transform-style: preserve-3d;
    transform-origin: left center;
    transition:
        transform 1s,
        rotate 1s ease-in calc((min(var(--i), var(--c)) - max(var(--i), var(--c))) * 50ms);
    translate: calc(var(--i) * -100%) 0px 0px;
    transform: translateZ(calc((var(--c) - var(--i) - 0.5) * calc(var(--thickness) * .23cqmin)));
    rotate: 0 1 0 calc(clamp(0, var(--c) - var(--i), 1) * -180deg);
    box-shadow: 0em .5em 1em -.2em #00000020;
}

.front,
.back {
    position: relative;
    flex: none;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    overflow: hidden;
    background-color: #fff;
    padding: 1em;
    border: 1px solid #0002;
}

.back {
    translate: -100% 0;
    rotate: 0 1 0 180deg;
}

.front {
    /* background-image: url(./coveer2.jpg);
    background-position: center;
    background-size: cover; */
    border-radius: .1em .5em .5em .1em;
}

.back {
    /* background-image: url(./coveer2.jpg);
    background-position: center;
    background-size: cover; */
    border-radius: .5em .1em .1em .5em;
}

.cover {
    background: radial-gradient(circle farthest-corner at 80% 20%, hsl(150 80% 20% / .3) 0%, hsl(170 60% 10% / .1) 100%),
        hsl(231, 32%, 29%) url("./MADDDD.png") 50% / cover;
    color: hsl(200 30% 98%);
    /* font-family: "pf-regular", sans-serif; */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.cover2 {
    background: radial-gradient(circle farthest-corner at 80% 20%, hsl(150 80% 20% / .3) 0%, hsl(170 60% 10% / .1) 100%),
        hsl(231, 32%, 29%) url("./coveer2.jpg") 50% / cover;
    color: hsl(200 30% 98%);
    /* font-family: "pf-regular", sans-serif; */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.cover-content2 {
    position: absolute;
    top: 60%;
    left: 50%;
    width: 90%;
    transform: translate(-50%, -50%);
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.logo-img {
    position: absolute;
    top: 30%;
    left: 50%;
    width: 100%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.cover h1 {
    font-size: clamp(1.2rem, 5vw, 2rem);
    margin: 1rem;
}

.cover h2 {
    margin-top: 15rem;
    font-size: clamp(1.2rem, 3vw, 1rem);
}


.logo-img {
    width: clamp(130px, 30vw, 200px);
    height: auto;
    margin: 1rem 0;
}

.logo-img img {
    width: 100%;
    height: auto;
}

/* Make images scale nicely */
.home-page img {
    max-width: 100%;
    height: auto;
    display: block;
}

.content-box {
    text-align: center;
    margin-bottom: 1rem;
}

.bottom-box {
    position: absolute;
    bottom: 0;
    display: flex;
    justify-content: center;
    flex-direction: column-reverse;
    gap: 1rem;
    flex-wrap: wrap;
}

.main-content {
    text-align: center;
    display: flex;
    flex-direction: column;
}

.logo-img1 {
    max-width: clamp(150px, 30vw, 180px);
    margin: 0 auto 1rem auto;
}

.details-home .title {
    font-size: clamp(1.5rem, 5vw, 1.8rem);
    margin-bottom: 0.5rem;
}

.details-home .ayat {
    font-size: clamp(1.1rem, 3vw, 1.2rem);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.details-home .trjma {
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    color: #333;
}

/* Content styles */
.title {
    font-size: clamp(1.8rem, 5vw, 2rem);
    font-weight: 900;
    margin-bottom: 1rem;
    text-align: center;
    margin-top: 1rem;
}

.animate-fade-in {
    margin-bottom: 1rem;
}

.about-content .text {
    font-size: clamp(14px, 3vw, 16px);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.stat-box {
    padding: 1rem;
    text-align: center;
    border: 1px solid rgba(162, 167, 163, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-box img {
    width: clamp(40px, 8vw, 50px);
    height: clamp(40px, 8vw, 50px);
    margin-bottom: 0.5rem;
}

.stat-box h3 {
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    margin-bottom: 0.5rem;
}

.stat-box p {
    font-size: clamp(1rem, 3vw, 1.2rem);
    font-weight: bold;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: clamp(12px, 2vw, 14px);
}

th,
td {
    padding: 0.5rem;
    text-align: left;
    border: 1px solid #ddd;
}

th {
    background-color: #f4f4f4;
}

tr:hover {
    background-color: #f0f8ff;
}

.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.service-box {
    padding: 1rem;
    border-radius: 4px;
}

.service-box h3 {
    color: #000;
    margin-bottom: 0.5rem;
    font-size: clamp(1rem, 3vw, 1.2rem);
}

.legacy-content h2 {
    margin: 1rem 0 .3rem 0;
    font-size: 1.2rem;
    font-weight: 700;
}

.service-box p,
.legacy-content p,
.objectives-list li {
    font-size: 1rem;
}

.objectives-list {
    list-style: disc;
}

.objectives-list li {
    padding: .5rem;
    margin-bottom: 0.5rem;
    margin-left: .5rem;
    border-radius: 4px;
    font-size: clamp(14px, 3vw, 16px);
}

.objectives-list li>p {
    margin-top: .3rem;
}


.role-text li {
    margin: .8rem 0;
    margin-left: .5rem;
}

/* FORM STYLING */
.registration-form {
    border-radius: 12px;
    padding: 20px;
    max-width: 100%;
    width: 100%;
}

.registration-form form {
    display: flex;
    flex-direction: column;
}

.registration-form input {
    border-bottom: 1px solid #000;
}

.registration-form input,
.registration-form select,
.registration-form textarea {
    padding: 12px;
    font-size: 1rem;
    margin-bottom: 15px;
    border-radius: 6px;
    transition: border-color 0.3s ease;
    outline: none;
    background-color: transparent;
}

.registration-form input:focus,
.registration-form select:focus,
.registration-form textarea:focus {
    border-color: #fff;
    outline: none;
}

.registration-form button {
    padding: 12px;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    background-color: #fff;
    color: #666;
    transition: background-color 0.3s ease;
}

.registration-form button:hover {
    background-color: #ccc;
}

/* RESPONSIVENESS */
@media (max-width: 480px) {
    .registration-form {
        padding: 20px;
    }

    .registration-form h2 {
        font-size: 1.5rem;
    }
}



.madrasa-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.madrasa-project-link {
    text-decoration: none;
    color: #000;
}

.madrasa-project {
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.madrasa-project-img img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.madrasa-project-content {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
}

/* Lightbox Styles */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.lightbox.show {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.lightbox-image {
    width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 0 10px #000;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 1.5rem;
}

/* ✅ RESPONSIVE STYLES */
@media (min-width: 768px) {
    .main-content {
        position: absolute;
        top: 5%;
        left: 50%;
        transform: translate(-50%, 0%);
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        text-align: center;
    }

    .logo-img {
        flex: 0 0 auto;
        max-width: 250px;
    }

    .details-home {
        flex: 1;
    }

    .services-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}

@media (min-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(1, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile-first adjustments */
@media (max-width: 767px) {
    .book {
        width: 100vw;
        height: 100vh;
        max-height: none;
    }

    .cover h1 {
        margin: 0.5rem;
    }

    .cover p {
        margin: 0.25rem 0.5rem;
    }

    .content-box {
        margin-bottom: 0.5rem;
    }

    .bottom-box {
        gap: 0.5rem;
    }

    .stat-box {
        padding: 0.5rem;
    }

    .objectives-list li {
        padding: 0.75rem;
    }

    .madrasa-project-content {
        padding: 0.75rem;
    }


}

@media (max-width: 480px) {
    .page {
        padding: 0.5em;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .madrasa-projects-grid {
        grid-template-columns: 1fr;
    }

    .objectives-list li {
        padding: 0.5rem;
        font-size: 14px;
    }

    .service-box {
        padding: 0.75rem;
    }

    th,
    td {
        padding: 0.25rem;
        font-size: 12px;
    }

    body {
        overflow: scroll;
    }
}

/* Orientation-specific styles */
@media (orientation: portrait) {
    .book {
        max-height: 100vh;
        max-width: 45vw;
    }

    .main-content {
        flex-direction: column;
    }
}

@media (orientation: landscape) and (max-height: 600px) {
    .book {
        max-height: 100vh;
        max-width: 45vw;
    }

    .cover h1 {
        font-size: 1.2rem;
        margin: 0.5rem;
    }

    .cover p {
        font-size: 0.8rem;
        margin: 0.25rem 0.5rem;
    }

    .logo-img {
        width: 120px;
    }
}

@media (orientation: landscape) and (min-height: 915px) {
    .book {
        max-height: 100vh;
        max-width: 45vw;
    }
}

@media (orientation: portrait) and (max-height: 450px) {
    .book {
        max-height: 100vh;
        max-width: 20vw;
    }
}


/* Navigation buttons styling */
.page-navigation {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 10;
}

.nav-btn {
    padding: 5px;
    background-color: rgb(76, 175, 79);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background-color: rgb(76, 175, 79);
    transform: scale(1.1);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.animate-slide-up {
    margin-bottom: 1rem;
}


@media (max-width:768px) {

    /* Navigation buttons styling */
    .page-navigation {
        position: absolute;
        bottom: 20px;
        left: 0;
        width: 100%;
    }
}