/* Wannan shi ne babban bangon da zai rufe shafin */
/* 1. Gyaran :root (Dole ya zauna shi kadai) */
/* 1. CSS VARIABLES & BASE */
:root {
    --main: #3fb950;
    --main2: #58a6ff;
    --bg: #0d1117;
    --card-bg: rgba(22, 27, 34, 0.8);
    --gold: #f1c40f;
    --red: #ff4d4d;
    --purple: #d2a8ff;
    --orange: #ff9f43;
    --cyan: #00d2d3;
    --deep-green: #1b4d3e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 2. Loader Wrapper */
/* 1. Babban Bangon Loader */
.loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0d1117;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    /* Bacewa cikin santsi */
    animation: bacewa 0.8s ease-in 3.5s forwards;
}

/* 2. Loader Mai Kalar Cyan/Green Gradient */
.loader {
    width: 80px;
    height: 80px;
    border: 3px solid transparent;
    border-top: 3px solid var(--cyan);
    border-right: 3px solid var(--main);
    /* Green */
    border-radius: 50%;
    animation: juyawa 1s cubic-bezier(0.5, 0.1, 0.4, 0.9) infinite;
    box-shadow: 0 0 20px rgba(0, 210, 211, 0.2);
}

/* 3. Rubutu Mai Walƙiya (Neon Glow) */
.loader-title {
    margin-top: 30px;
    letter-spacing: 7px;
    font-weight: 300;
    color: white;
    text-align: center;
    animation: haske-text 2s ease-in-out infinite;
}

.loader-title span {
    color: var(--main);
    font-weight: 900;
}

.loader-subtitle {
    margin-top: 10px;
    color: var(--cyan);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 2px;
    opacity: 0.8;
    text-transform: uppercase;
}
@keyframes juyawa { /* ----------------------------------Loader Animations------------------------------------ */
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes haske-text {

    0%,
    100% {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
        opacity: 0.8;
    }

    50% {
        text-shadow: 0 0 25px var(--cyan);
        opacity: 1;
    }
}

@keyframes bacewa {
    to {
        opacity: 0;
        visibility: hidden;
        transform: scale(1.1);
    }
}

* {/* ----------------------------------General Setup------------------------------------ */
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

body {
    background: radial-gradient(circle at 0% 0%, rgba(63, 185, 80, 0.15) 0%, transparent 35%),
        radial-gradient(circle at 100% 0%, rgba(88, 166, 255, 0.15) 0%, transparent 35%),
        #0d1117;
    /* Tushen baƙi don rubutu ya fito radau */
    height: auto;
    display: block;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.6;
}
/* Babban Container */
.app-container {
  display: grid;
  height: 100vh;
  grid-template-areas: 
    "header header"
    "main main"
    "footer footer";
  grid-template-columns: 1fr ; /* Sidebar tana da 330px */
  grid-template-rows: 60px 1fr 40px; /* Header da Footer heights */
}

/* Sanya kowane bangare a mazauninsa */
.app-header { grid-area: header; position: sticky; top: 15px; z-index: 100; }
.app-main   { grid-area: main; overflow-y: auto; scrollbar-width: none; padding: 20px; }
.app-sidebar { grid-area: sidebar; border-left: 1px solid rgba(255,255,255,0.1); }
.app-footer { grid-area: footer; text-align: center; font-size: 0.8rem; }


header {
    position: sticky;
    top: 15px;
    z-index: 999;
    padding: 0 10%;
}

.modern-nav {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 50px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    letter-spacing: 1px;
}

.logo-text span {
    color: var(--main);
    /* Kalar Cyber Green dinmu */
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 25px;
}

.nav-links a {
    color: var(--main2);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

/* Hover Effect: Layi mai haske a kasa */
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--main);
    box-shadow: 0 0 10px var(--main);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a:hover {
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Button na musamman a Navbar */
.btn-contact {
    background: var(--main);
    color: black !important;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 700 !important;
    box-shadow: 0 0 15px rgba(63, 185, 80, 0.4);
}

.btn-contact:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(63, 185, 80, 0.6);
}

/* HERO SECTION */
.hero-text {
    text-align: center;
    padding: 100px 20px 50px;
    background: radial-gradient(circle at center, rgba(63, 185, 80, 0.05), transparent 70%);
}

.hero-text h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    /* Mun kara girma kadan */
    font-weight: 900;
    margin-bottom: 20px;
    letter-spacing: -1px;
    /* Salon zamani na matse rubutu kadan */

    /* Gradient Text */
    background: linear-gradient(135deg, #ffffff, var(--main) 60%, var(--main2) 100%);
    background-size: 200% auto;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;

    /* Animation mai santsi don gradient din ya rika yawo */
    animation: shine-text 5s linear infinite;
}

.hero-text p {
    color: #8b949e;
    /* Mun sa kalar da ba ta gajiyar da ido */
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgb(0, 0, 0);

}

/* Animation na Gradient din h1 */
@keyframes shine-text {
    to {
        background-position: 200% center;
    }
}



main {
    padding-top: 40px;
    /* Sarari tsakanin Header da Katuna */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;

}

.surah-grid-container {/* ----------------------------------grid css---------------------- */

    display: block;
    justify-content: center;
    gap: 30px;
    padding: 20px 5% 60px;
    padding: 20px;
    text-align: center;

}

.grid-title {
    color: var(--main);
    font-size: 0.8rem;
    letter-spacing: 5px;
    margin-bottom: 20px;
}

.surah-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    max-width: 1000px;
    margin: 0 auto;
}

.surah-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 12px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.surah-item:hover {
    background: var(--main);
    color: black;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(63, 185, 80, 0.4);
}

/* 2. Salon kowane Button (Chip) */
.surah-chip {
    background: rgba(255, 255, 255, 0.05); /* Kalar glassmorphism */
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 50px;       /*zagayayyu (Capsule style) */
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(5px);
    white-space: nowrap;      /* Don rubutu kar ya karye */
}


.surah-chip:hover {
    background: var(--main);   /* Green dinmu */
    color: black;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(63, 185, 80, 0.4);
    border-color: var(--main);
}

/* 4. Active State: Idan mutum ya danna */
.surah-chip:active {
    transform: scale(0.95);
}
/* ----------------------------------main section---------------------- */

.card-section {
    position: relative;
    display: flex; 
    height: 35vw;

    flex-direction: column; /* Su jera a tsaye */
    align-items: center;    /* Su dawo tsakiya */
    width: 100%;
    gap: 20px;
}
.sura-scroll {/*--------------------------------------card setup-------------------------------------------, */
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Don ya fara daga sama saboda tsawo */
    text-align: left;
    /* Hausa tana farawa daga hagu */
}

.translation-header {
    font-size: 0.7rem;
    letter-spacing: 3px;
    color: rgba(0, 0, 0, 0.5);
    /* Inuwa kadan a kan kalar katin */
    margin-bottom: 15px;
    font-weight: 900;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    width: 100%;
    padding-bottom: 5px;
}

.hausa-text {
    font-size: 0.9rem;
    line-height: 1.8;
    color: #000;
    font-weight: 500;
}

.aya-num {
    display: inline-flex;
    width: 18px;
    height: 18px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    font-size: 0.6rem;
    justify-content: center;
    align-items: center;
    margin-right: 5px;
    font-weight: 900;
}

.hifz-card.full-sura {

    height: auto;       /* Kar a sa fixed height */
    min-height: 250px;  /* Amma kar ya gaza haka */
}

.arabic-text-full {
    font-family: 'Amiri', serif;
    font-size: 1.8rem;
    font-weight: 1000;
    line-height: 2.1;
    text-align: center;
    direction: rtl;
    padding: 10px;
    background: linear-gradient(135deg, #3fb950, #58a6ff, #d2a8ff);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    height: auto;       /* Kar a sa fixed height */
    min-height: 250px;  /* Amma kar ya gaza haka */
}

.sura-scroll {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--main) transparent;
}

.sura-title {
    color: var(--main2);
    font-size: 0.8rem;
    letter-spacing: 3px;
    margin-top: 10px;
    text-transform: uppercase;
}
/* 3. The 3D Cyber-Card */
.hifz-card{
    position: relative;
    width: 90%;   
    max-width: 600px;      /* Ya tsaya a nan a computer */
    flex-shrink: 0; 
    margin: 20px auto; 
    height: auto;
    min-height: 250px; 
    perspective: 1000px;
    /* Hangen nesa na 3D */
    animation: fadeInUp 0.8s ease-out forwards;
    display: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* card inner iphone style */
.card__inner {
    position: relative;
    width:auto;
    height: auto;
    display: flex;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    gap: 5px;
}

.hifz-card.flipped .card__inner {
    transition: transform 0.8s cubic-bezier(0.68, -0.6, 0.32, 1.55);
    transform: rotateY(180deg);
}



.card-front,
.card-back {
    position: absolute;
    width: auto;
    height: auto;
    backface-visibility: hidden;
    /* Boye dayan bangon idan an juya */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 15px;
    background: rgba(22, 27, 34, 0.9);
    /* Duhu kadan don kariya ga rubutu */
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
    padding: 10px;
}

.card-front {
    background: black;
    border: 2px solid var(--main);
}
.audio--btn {/*--------------------------------------svg botton-------------------------------------------, */
    position: absolute;
    top: 8px;
    right: 8px;
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.05); /* Glass effect */
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 100;
    color: var(--main); /* Kalar Green dinmu */
}

.audio--btn svg {
    padding: 2px;
    width: 18px;
    height: 18px;
}
.audio--btn:hover {
    background: var(--main);
    color: #000;
    transform: scale(1.2) rotate(5deg);
    box-shadow: 0 0 15px var(--main);
}
.close-btn {/*--------------------------------------close x botton-------------------------------------------, */
    position: absolute;
    top: 8px;
    left: 8px;
    width: 33px;
    height: 33px;
    background: var(--red); /* Ko kalar da kake so */
    color: var(--main2);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 0 10px rgba(42, 250, 70, 0.5);
    transition: 0.3s;
}

.close-btn:hover {
    transform: scale(1.2);
    background: var(--main2);
    color: var(--red);
}


.card-back {
    background: var(--main);
    color: #000;
    transform: rotateY(180deg);
    text-align: center;
    font-weight: 700;
}

.small-text {
    font-size: clamp(1.4rem, 4.5vw, 1.8rem) !important;
    line-height: 2;
    /* Mun ƙara sararin layi don haruffan su buɗe */
    font-weight: 700;
    letter-spacing: 0.5px;
    width: 100%;
    text-align: center;
    display: block;
}



.arabic-text {/*--------------------------------------Arabic clip text-------------------------------------------, */
    font-family: 'Amiri', serif;
    /* 2. Girman Rubutu */
    font-size: clamp(1.7rem, 4vw, 1.8rem);
    line-height: 1.8;
    font-weight: 700;
    background: linear-gradient(135deg, #3fb950, #58a6ff, #d2a8ff);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    direction: rtl;
    text-align: center;
    padding: 10px;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    /* Domin ya zauna a tsakiyar katin */
    filter: drop-shadow(0 0 10px rgba(63, 185, 80, 0.4));
}

/* Kwarin gwiwa: gyara wa small shima */
small {
    font-size: 0.9rem;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2px;
}

/* 7. COLOR CODES */
.card-gold .card-front {
    border-color: var(--gold);
}

.card-gold .card-back {
    background: var(--gold);
}

.card-red .card-front {
    border-color: var(--red);
}

.card-red .card-back {
    background: var(--red);
    color: white;
}

.card-blue .card-front {
    border-color: var(--main2);
}

.card-blue .card-back {
    background: var(--main2);
    color: white;
}

.card-purple .card-front {
    border-color: var(--purple);
}

.card-purple .card-back {
    background: var(--purple);
}

.card-orange .card-front {
    border-color: var(--orange);
}

.card-orange .card-back {
    background: var(--orange);
}

.card-cyan .card-front {
    border-color: var(--cyan);
}

.card-cyan .card-back {
    background: var(--cyan);
}

.card-deep-green .card-front {
    border-color: var(--deep-green);
}

.card-deep-green .card-back {
    background: var(--deep-green);
    color: white;
}




.badge-section {
    text-align: center;
    padding: 50px 20px;
    background: rgba(255, 255, 255, 0.02);
    margin-top: 50px;
    border-top: 2px dashed rgba(255, 255, 255, 0.1);
}

.medal {
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, #f1c40f, #d4af37);
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    box-shadow: 0 0 30px rgba(241, 196, 15, 0.5);
    border: 5px solid #fff;
    animation: shine 2s infinite, bounce 3s infinite;
}

@keyframes shine {
    0% {
        filter: brightness(1);
        transform: scale(1);
    }

    50% {
        filter: brightness(1.3);
        transform: scale(1.05);
    }

    100% {
        filter: brightness(1);
        transform: scale(1);
    }
}

/* 9. BADGE SECTION */
.badge-section {
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.02);
    margin: 50px 5%;
    border-radius: 40px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.medal {
    width: 130px;
    height: 130px;
    background: radial-gradient(circle, #f1c40f, #d4af37);
    border-radius: 50%;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 3.5rem;
    border: 6px solid #fff;
    box-shadow: 0 0 40px rgba(241, 196, 15, 0.4);
    cursor: pointer;
    transition: 0.3s;
    animation: pulse 2s infinite;
}

.medal:hover {
    transform: scale(1.1) rotate(10deg);
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.badge-text {
    color: var(--gold);
    margin-top: 20px;
    font-weight: 900;
    font-size: 1.5rem;
    text-transform: uppercase;
}



footer p {
    color: #8b949e;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

/* 4. Footer */
footer {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    padding: 30px;
    border-top: 1px solid var(--main);
    margin-top: 50px;
    text-align: center;
    bottom: 0;
    width: 100%;
}
                   /*=======================================================
                      RESPONSIVE DESIGN (MEDIA QUERIES)
                     ======================================================= */

/* 1. TABLETS & SMALL LAPTOPS (Kasa da 992px) */
@media (max-width: 992px) {
    header {
        padding: 0 5%;
    }
    
    .modern-nav {
        padding: 10px 30px;
    }
    
    .hero-text h1 {
        font-size: 3rem;
    }
}

/* 2. MOBILE PHONES (Kasa da 768px) - Mafi Muhimmanci */
@media (max-width: 768px) {
    /* Navbar: Boye Links, bar Logo da Button shiga kawai */
    .nav-links li:not(:last-child) {
        display: none; 
    }
    
    .modern-nav {
        padding: 10px 20px;
        top: 10px;
    }

    .hero-text {
        padding: 60px 15px 30px;
    }

    .hero-text h1 {
        font-size: 2.2rem;
        line-height: 1.2;
    }

    .hero-text p {
        font-size: 1rem;
        letter-spacing: 1px;
    }

     .surah-grid {
        /* Wannan layin zai raba su guda 5 tabbatattu */
        grid-template-columns: repeat(5, 1fr); 
        gap: 8px; /* Mun rage sararin tsakani don su samu wuri */
        padding: 5px;
    }

    .surah-chip {
        padding: 8px 5px; /* Rage fadin ciki */
        font-size: 13px;   /* Rage girman rubutu don sunayen su shiga */
        border-radius: 10px; /* rage zagayen don su fi zama a fili */
        text-align: center;
        letter-spacing: 0; /* cire sararin haruffa */
    }
    /* Katunan Surori: Su cika allon waya */
    .hifz-card {
        display: block;
        width: 100%;
        max-width: 380px;
        height: 250px; /* Mun dan kara tsayi kadan don waya */
    }

    .arabic-text-full {
        font-size: 1.4rem;
        line-height: 1.8;
    }
    
    .hausa-text {
        font-size: 0.85rem;
    }
}

/* 3. VERY SMALL PHONES (Kasa da 480px) */
@media (max-width: 480px) {
    .logo-text {
        font-size: 1.2rem;
    }

    .hero-text h1 {
        font-size: 1.8rem;
    }

    .surah-grid {
        grid-template-columns: repeat(2, 1fr); /* Layi biyu kacal */
    }
}
