* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    background-color: #16263F;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: #FFC107;
    backdrop-filter: blur(8px);
    padding: 0.7rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand-box {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.brand-img {
    width: 50px;
}

.brand {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #1E2F4D;
}

nav ul {
    display: flex;
    gap: 1rem;
    list-style: none;
}

nav ul li a {
    color: #1E2F4D;
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 0.8rem;
    border-radius: 40px;
    transition: all 0.25s ease;
    font-size: 1rem;
}

nav ul li a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: blue;
    transform: translateY(-2px);
}

main {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    width: 100%;
}

.head {
    text-align: center;
    margin: 0.5rem 0 2rem;
    font-size: 2.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1e2a5e, #3852B4);
    background-clip: text;
    -webkit-background-clip: text;
    color: #FFFFFF;
    position: relative;
    display: inline-block;
    width: 100%;
}

.head::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: #3852B4;
    margin: 0.5rem auto 0;
    border-radius: 4px;
}

.filter-section {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.filter-btn {
    background: white;
    border: 2px solid #3852B4;
    padding: 0.6rem 1.5rem;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: 600;
    color: #3852B4;
    cursor: pointer;
    transition: all 0.25s ease;
}

.filter-btn:hover {
    background: #3852B4;
    color: white;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: #3852B4;
    color: white;
}

.pyqs-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 2rem 0 3rem;
}

.pyq-card {
    width: 280px;
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.pyq-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.card-header {
    padding: 1.2rem;
    text-align: center;
    color: white;
}

.card-header h2 {
    font-size: 2rem;
    margin-bottom: 0.3rem;
}

.card-body {
    padding: 1.2rem;
}

.semester-text {
    font-size: 1rem;
    color: #1e2a5e;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.exam-type {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.8rem;
}

.questions-count {
    font-size: 0.8rem;
    color: #3852B4;
    font-weight: 500;
}

.download-btn {
    display: inline-block;
    margin-top: 0.8rem;
    padding: 0.4rem 1rem;
    background: #3852B4;
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: center;
}

.download-btn:hover {
    background: #2a3f94;
    transform: scale(1.02);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 550px;
    border-radius: 28px;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
    max-height: 85vh;
    overflow-y: auto;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: #FFC107;
    padding: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h2 {
    color: #1E2F4D;
    font-size: 1.3rem;
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #1E2F4D;
    transition: all 0.2s;
}

.close-modal:hover {
    transform: scale(1.1);
}

.semester-section {
    margin: 1rem;
    border: 1px solid #eee;
    border-radius: 16px;
    overflow: hidden;
}

.semester-title {
    background: #3852B4;
    color: white;
    padding: 0.8rem 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.subjects-list {
    padding: 0.5rem;
}

.subject-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #eee;
    transition: all 0.2s ease;
    gap: 1rem;
    flex-wrap: nowrap;
}

.subject-item:hover {
    background: #f5f5f5;
}

.subject-name {
    font-size: 1rem;
    color: #1e2a5e;
    font-weight: 500;
    flex: 1;
    min-width: 0;
    word-break: break-word;
    text-transform: uppercase;
}

.download-subject {
    background: #3852B4;
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
    min-width: 100px;
    text-align: center;
    flex-shrink: 0;
}

.download-subject:hover {
    background: #2a3f94;
    transform: scale(1.02);
}


/* Modal Body - Scrollbar INSIDE */
.modal-body {
    max-height: 65vh;
    overflow-y: auto;
    padding: 0.5rem;
}

/* Custom Scrollbar inside modal body */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #3852B4;
    border-radius: 10px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #2a3f94;
}

/* For Firefox */
.modal-body {
    scrollbar-width: thin;
    scrollbar-color: #3852B4 #f1f1f1;
}


.why-pyqs {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(120deg, #e9efff, #ffffff);
    border-radius: 48px;
    margin: 2rem 0 1rem;
    box-shadow: 0 8px 20px rgba(56, 82, 180, 0.1);
    border: 1px solid rgba(56, 82, 180, 0.15);
}

.why-pyqs h2 {
    font-size: 1.9rem;
    color: #1e2a5e;
    margin-bottom: 1rem;
    font-weight: 700;
}

.why-pyqs ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 1rem;
}

.why-pyqs li {
    font-size: 1.1rem;
    background: #3852B4;
    color: white;
    padding: 0.6rem 1.4rem;
    border-radius: 60px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.why-pyqs li:hover {
    transform: translateY(-3px);
    background: #2a3f94;
    box-shadow: 0 6px 12px rgba(56, 82, 180, 0.3);
}

footer {
    background: #FFC107;
    text-align: center;
    padding: 0.5rem;
    color: #1E2F4D;
    font-weight: 500;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.social {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.social a {
    color: #1E2F4D;
    font-size: 1.5rem;
}

hr {
    margin-top: 0.5rem;
    border: 1px solid white;
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    header {
        padding: 0.8rem 1.2rem;
    }

    .brand {
        font-size: 1.4rem;
    }

    nav ul {
        gap: 1rem;
    }

    .head {
        font-size: 1.9rem;
    }

    .pyq-card {
        width: 240px;
    }

    .subject-item {
        flex-wrap: nowrap;
        gap: 0.8rem;
    }

    .download-subject {
        min-width: 90px;
        padding: 0.35rem 0.8rem;
        font-size: 0.7rem;
    }

    .why-pyqs ul {
        flex-direction: column;
        align-items: center;
    }

    .why-pyqs li {
        width: 80%;
    }
}

@media (max-width: 480px) {
    header {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .head {
        font-size: 1.5rem;
    }

    main {
        padding: 1rem;
    }

    .pyq-card {
        width: 100%;
        max-width: 300px;
    }

    .filter-section {
        gap: 0.7rem;
    }

    .filter-btn {
        padding: 0.4rem 0.9rem;
        font-size: 0.85rem;
    }

    .subject-name{
        font-size: 0.75rem;
    }
    
    .subject-item {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .download-subject {
        align-self: flex-start;
        min-width: 80px;
    }

    .why-pyqs {
        padding: 1.5rem;
    }

    .why-pyqs h2 {
        font-size: 1.3rem;
    }

    .why-pyqs ul {
        gap: 1rem;
    }

    .why-pyqs li {
        width: 90%;
        font-size: 0.9rem;
    }

    footer {
        font-size: 0.9rem;
    }
}