/* RESET & BASE STYLES */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    background-color: #f0f2f5;
    color: #333;
    padding-bottom: 60px; /* space for footer */
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
}

/* HEADER - Sticky Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #004080;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    align-items: center;
    color: white;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand h1 {
    font-size: 26px;
    margin: 0;
    color: white;
}

.nav-menu {
    margin-top: 10px;
}

.nav-menu a {
    color: white;
    margin: 0 15px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
}

.nav-menu a:hover {
    text-decoration: underline;
}

/* DASHBOARD LAYOUT */
.dashboard {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 40px 20px;
    flex-wrap: wrap;
}

/* CARDS */
.card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    padding: 25px;
    width: 280px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.card h3 {
    color: #004080;
    margin-bottom: 10px;
    font-size: 20px;
}

.card p {
    font-size: 15px;
    color: #555;
    margin-bottom: 15px;
}

.card a {
    display: inline-block;
    background-color: #004080;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
}

.card a:hover {
    background-color: #0066cc;
}

/* FORM STYLING */
form {
    width: 300px;
    margin: 50px auto;
    padding: 25px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

form label {
    display: block;
    margin-bottom: 6px;
    font-weight: bold;
}

form input[type="text"],
form input[type="password"],
select,
button {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 1rem;
}

form button {
    background-color: #004080;
    color: white;
    border: none;
    font-weight: bold;
    cursor: pointer;
}

form button:hover {
    background-color: #0066cc;
}

/* ERROR MESSAGE */
.error {
    color: red;
    text-align: center;
    margin-bottom: 15px;
}

/* FOOTER */
.site-footer {
    background-color: #f4f4f4;
    text-align: center;
    padding: 12px;
    font-size: 14px;
    color: #333;
    border-top: 1px solid #ccc;
    position: relative;
    bottom: 0;
    width: 100%;
}

/* RESPONSIVE STYLES */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .navbar-brand h1 {
        font-size: 1.5rem;
    }

    .nav-menu {
        display: flex;
        flex-direction: column;
        width: 100%;
        margin-top: 10px;
    }

    .nav-menu a {
        margin: 5px 0;
    }

    .dashboard-content {
        padding: 10px;
    }

    .site-footer {
        font-size: 12px;
    }
}

/* SCROLLABLE TABLES ON SMALL SCREENS */
.responsive-table {
    overflow-x: auto;
    display: block;
}
.styled-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 16px;
    background-color: white;
    border: 1px solid #ccc;
}

.styled-table thead {
    background-color: #004080;
    color: white;
}

.styled-table th, .styled-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.styled-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.styled-table tr:hover {
    background-color: #f1f1f1;
}

.btn {
    display: inline-block;
    padding: 10px 15px;
    margin: 15px 0;
    background-color: #004080;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
}

.btn:hover {
    background-color: #0066cc;
}
.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 12px;
    margin: 15px 0;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
}
.btn-back {
    display: inline-block;
    margin-bottom: 20px;
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
}

.btn-back:hover {
    background-color: #0056b3;
}

/* SUBJECTS PAGE TWEAKS */
form h3 {
    margin-bottom: 15px;
    color: #004080;
    font-size: 20px;
    text-align: center;
}

input[type="number"] {
    width: 60px;
    padding: 6px;
    font-size: 14px;
    text-align: center;
}

/* Form inside a section */
form.responsive-table {
    width: 100%;
    max-width: 500px;
    margin: 30px auto;
    padding: 20px;
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-radius: 8px;
}

/* Improve subject lessons input layout */
.styled-table td input[type="number"] {
    width: 60px;
    padding: 5px;
    text-align: center;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* Compact the lesson inputs table */
.styled-table td, .styled-table th {
    vertical-align: middle;
    text-align: center;
}

/* Success message spacing fix */
.success-message {
    margin-top: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Ensure save button is centered */
form button[name="update_lessons"] {
    display: block;
    margin: 20px auto;
    width: auto;
    padding: 10px 25px;
}

/* Responsive tweak */
@media (max-width: 768px) {
    .styled-table thead {
        display: none;
    }

    .styled-table, .styled-table tbody, .styled-table tr, .styled-table td {
        display: block;
        width: 100%;
    }

    .styled-table tr {
        margin-bottom: 15px;
        border: 1px solid #ccc;
        border-radius: 6px;
        background-color: #fff;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    .styled-table td {
        text-align: right;
        padding: 10px 15px;
        position: relative;
    }

    .styled-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        top: 10px;
        font-weight: bold;
        text-align: left;
    }
}
.back-button-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}
/* Optional Subjects Table */
.optional-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-family: Arial, sans-serif;
}

.optional-table th {
    background-color: #007BFF;
    color: white;
    padding: 10px;
    text-align: left;
}

.optional-table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.optional-table .no-records {
    text-align: center;
    padding: 10px;
}

.delete-btn {
    background-color: red;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    cursor: pointer;
}

