/* ======================================================= */
/* 1. GLOBAL RESET & BASE SETUP                            */
/* ======================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image: url("images.jpeg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* Background scroll ke sath kharab nahi hoga */
}

/* ======================================================= */
/* 2. FLEXIBLE NAVBAR SYSTEM                               */
/* ======================================================= */
nav {
    background-color: #2a40e3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap; /* Kam jagah par items ko auto-wrap karega */
    padding: 15px 5%;
    width: 100%;
    gap: 15px;
}

.img1 {
    width: 7rem;
    color: white;
    flex-shrink: 0;
}

/* Links Wrapper */
.links {
    display: flex;
    align-items: center;
    gap: 30px; 
    flex-wrap: wrap;
}

.a1 {
    text-decoration: none;
    color: white;
    font-size: 1rem;
}

/* Search and Buttons Container */
.btn {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Responsive Search Input */
.searchbar {
    height: 35px;
    width: 100%;
    max-width: 17rem; /* Desktop par 17rem rahega, mobile par auto chota hoga */
    padding: 5px 12px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 0.9rem;
    outline: none;
}

/* Login/Action Button */
.a2 {
    padding: 8px 16px;
    text-decoration: none;
    color: white;
    border-radius: 5px;
    border: 1px solid white;
    transition: 0.3s;
    white-space: nowrap; /* Text break nahi hoga */
}

.a2:hover {
    background-color: white;
    color: #2a40e3;
}

/* ======================================================= */
/* 3. MAIN CONTENT & GRID ADJUSTMENT                       */
/* ======================================================= */
main {
    flex: 1;
    width: 100%;
    padding: 40px 20px;
    /* Fixed 100vh height yahan se remove kar di hai taake boxes adjust ho sakein */
}

.main-title {
    text-align: center;
    color: #1b4332;
    margin-bottom: 40px;
    font-size: 2.5rem;
}

/* Responsive Grid Container */
.surah-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
}

/* Card Styling */
.surah-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    border-top: 5px solid #2d6a4f;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    text-align: right;
}

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

.surah-number {
    font-size: 0.85rem;
    color: #888888;
    font-weight: bold;
    margin-bottom: 5px;
}

.surah-name {
    font-size: 1.9rem;
    color: #1b4332;
    margin-bottom: 12px;
    font-weight: 700;
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 8px;
}

.surah-details {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-item {
    font-size: 0.95rem;
    color: #444444;
}

.detail-label {
    font-weight: 600;
    color: #2d6a4f;
}

.ayat-count {
    margin-top: 2px;
    padding-top: 2px;
}

/* ======================================================= */
/* 4. MEDIA QUERIES (Choti screens ke liye)                */
/* ======================================================= */

@media screen and (max-width: 768px) {
    nav {
        flex-direction: column; /* Logo, Links aur Search Bar upar-neeche stack honge */
        text-align: center;
        padding: 15px;
    }

    .links {
        justify-content: center;
        width: 100%;
        gap: 15px;
    }

    .btn {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .searchbar {
        max-width: 100%; /* Mobile par search bar width se baahir nahi jaye gi */
        width: 100%;
    }

    .a2 {
        width: 100%; /* Button poori width par center ho jaye ga */
        text-align: center;
    }
    
    .main-title {
        font-size: 1.8rem; /* Mobile par title chota adjust ho ga */
    }
}
