/* General Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
    color: #333;
    font-size: 16px; /* Base font size */
}

h1 {
    text-align: center;
    color: #444;
    margin-top: 20px;
    font-size: 2em;
}

nav ul {
    list-style-type: none;
    padding: 0;
    text-align: center;
    background-color: #333;
    margin: 0;
}

nav ul li {
    display: inline;
}

nav ul li a {
    text-decoration: none;
    font-weight: bold;
    color: white;
    padding: 14px 20px;
    display: inline-block;
}

nav ul li a:hover {
    background-color: #575757;
    border-radius: 4px;
}

form {
    max-width: 400px;
    margin: 30px auto;
    padding: 10px; /* Reduced from 20px to minimize space around inputs */
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}
form label {
    font-weight: bold;
    margin-bottom: 1px; /* Reduced from 5px/2px to minimize gap below labels */
    font-size: 1em;
}

form input, form select {
    display: block;
    width: 100%;
    padding: 6px; /* Kept as is; can reduce to 4px if desired */
    margin: 1px 0; /* Reduced from 2px to bring inputs closer together */
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
}

form input[type="submit"] {
    background-color: #4CAF50;
    color: white;
    border: none;
    cursor: pointer;
    padding: 14px;
    font-size: 1.1em;
    border-radius: 4px;
    transition: background-color 0.3s;
}

form input[type="submit"]:hover {
    background-color: #45a049;
}

/* Responsive Styles */
@media (max-width: 600px) {
    form {
        width: 90%;
        padding: 10px; /* Match general padding for consistency */
    }

    form input, form select {
        width: calc(100% - 18px);
        margin: 2px 0; /* Reduced from 8px for smaller gaps on mobile */
        padding: 10px; /* Reduced from 14px for a more compact look */
    }
}

form label {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 1em;
}
p {
    text-align: center;
    margin-top: 20px;
    color: #555;
}

/* Table Styles */
table {
    width: 90%;
    margin: 20px auto;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    font-size: 1em;
}

th {
    background-color: #f2f2f2;
}

tr:hover {
    background-color: #f1f1f1;
}

/* Responsive Styles */
@media (max-width: 600px) {
    body {
        font-size: 18px; /* Increased base font size for mobile */
    }

    nav ul li {
        display: block;
        margin: 10px 0;
    }

    form {
        width: 90%;
        padding: 15px;
    }

    form input, form select {
        width: calc(100% - 18px);
        margin: 8px 0;
        padding: 14px;
    }

    table, th, td {
        display: block;
        width: 100%;
    }

    th, td {
        text-align: right;
        padding: 10px;
    }

    th {
        background-color: #f9f9f9;
        position: relative;
    }

    th::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        text-align: left;
        padding-left: 10px;
    }

    td::before {
        content: attr(data-label);
        float: left;
        font-weight: bold;
        padding-left: 10px;
    }
}
