* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background-color: white;
    color: #333;
    line-height: 1.6;
}

/* Header */
header {
    color: white;
    width: 100%;
}

#topbar {
    background-color: #4158A6;
    width: 100%;
}

#headerbar {
    width: 100%;
    max-width: 1200px; /* Use max-width instead of fixed width */
    margin: auto;
    padding: 5px 10px;
    text-align: right; /* Align text properly */
}

.header {
    color: white;
    text-decoration: none;
    font-size: 14px;
    margin-left: 5px;
    display: inline-block;
}

#logo {
    text-align: center;
    background-color: #5769B3;
    margin: auto;
    width: 100%;
}

#bihar-logo {
    max-width: 100%; /* Make image responsive */
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Navigation */
#navbar {
    background-color: #CFE2FF;
    width: 100%;
}

#nav {
    width: 100%;
    max-width: 1200px;
    margin: auto;
    padding: 10px;
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    gap: 15px;
}

.menu {
    color: rgb(9, 3, 121);
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
}

/* Main */
#hero {
    text-align: center;
    margin: auto;
    background-color: white;
    width: 100%;
}

#heroimg {
    max-width: 100%; /* Responsive Image */
    height: auto;
    padding: 20px 0;
}

.notifications {
    padding: 0 10px;
}

#note1 {
    padding: 10px;
    margin: 10px auto;
    text-align: center;
    background-color: #EB5B00;
    font-weight: bold;
    color: white;
    width: 100%;
    max-width: 850px; /* Responsive width */
    border-radius: 10px;
    font-size: 18px;
}

#note2 {
    padding: 5px;
    margin: auto;
    text-align: center;
    color: #ff0000;
    font-weight: bold;
    font-size: 18px;
    width: 100%;
    max-width: 1000px;
}

/* Boxes Layout */
.box {
    width: 100%;
    max-width: 1200px;
    margin: 20px auto;
    display: flex;
    flex-wrap: wrap; /* IMPORTANT: Allows stacking on mobile */
    gap: 20px;
    padding: 0 15px; /* Add side padding */
    justify-content: center;
}

/* Common style for all boxes */
.link-box, .link-box-b, #link-box-a {
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    flex: 1; /* Grow to fill space */
    min-width: 250px; /* Minimum width before wrapping */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.link-box {
    background-color: #135D66;
}

#link-box-a {
    background-color: #e3621c;
    color: white;
    font-weight: bold;
}

.link-box-b {
    background-color: #4158A6;
}

.apply p, .login p, #status p {
    color: white;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 10px;
}

.links-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.applylink {
    color: #fff;
    text-decoration: underline;
    font-size: 15px;
    font-weight: bold;
}

/* Table Section */
#title {
    text-align: center;
    margin: auto;
    padding: 20px 10px;
    font-size: 18px;
    font-weight: bold;
    color: #ff0000;
}

/* Wrapper to allow table scrolling on mobile */
.table-responsive {
    width: 100%;
    max-width: 1200px;
    margin: auto;
    padding: 0 10px;
    overflow-x: auto; /* Enable horizontal scroll */
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    border: rgb(211, 206, 206) solid 2px;
    min-width: 600px; /* Ensures table doesn't get too squished */
}

td {
    border: 1px solid rgb(211, 206, 206);
    padding: 12px;
    font-size: 15px;
}

/* Footer */
footer {
    background-color: #4158A6;
    color: white;
    padding: 20px 0;
    margin-top: auto;
}

#footerbox {
    width: 100%;
    max-width: 1200px;
    margin: auto;
    display: flex;
    flex-wrap: wrap; /* Stack on mobile */
    gap: 20px;
    padding: 0 15px;
}

.footer {
    padding: 10px;
    flex: 1;
    min-width: 200px; /* Stack if smaller than this */
}

.footer h3 {
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    padding-bottom: 5px;
}

/* Mobile Specific Tweaks (Media Queries) */
@media (max-width: 768px) {
    #headerbar {
        text-align: center;
    }
    
    .box {
        flex-direction: column; /* Stack boxes vertically */
    }

    .link-box, .link-box-b, #link-box-a {
        width: 100%; /* Full width on phone */
    }

    #footerbox {
        flex-direction: column;
        text-align: center;
    }

    #note1, #note2 {
        font-size: 14px; /* Smaller text on phone */
    }
}