@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap');

:root {
    --primary-color: #4FC3F7;
    /* Light Blue */
    --primary-dark: #0288D1;
    --secondary-color: #FFF176;
    /* Sunshine Yellow */
    --accent-color: #81C784;
    /* Soft Green */
    --bg-color: #F0F4F8;
    --text-color: #37474F;
    --card-bg: #FFFFFF;
    --radius: 15px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

/* Navbar */
.navbar {
    background-color: var(--primary-dark);
    padding: 1rem 2rem;
    color: white;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: auto;
    /* Pushes everything else to the right, but we want center */
    /* Better strategy: */
}

/* We want brand on left, menu centered. */
.navbar-menu {
    flex-grow: 1;
    display: flex;
    justify-content: center;
}

.navbar-menu a {
    color: white;
    text-decoration: none;
    margin: 0 15px;
    /* balanced spacing */
    font-weight: 600;
    transition: color 0.3s;
}

.navbar-menu a:hover {
    color: var(--secondary-color);
}

/* Container */
.container {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    border-left: 5px solid var(--primary-color);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    border-top: 5px solid var(--accent-color);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-dark);
}

.stat-label {
    font-size: 1.1rem;
    color: #666;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-color);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: white;
    transform: translateY(-2px);
}

.btn-success {
    background-color: var(--accent-color);
    color: white;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-family: inherit;
}

input:focus {
    border-color: var(--primary-color);
    outline: none;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: var(--primary-color);
    color: var(--text-color);
}

/* Utility */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.btn-delete {
    color: #dc3545;
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    text-decoration: none;
    padding: 5px;
}

.btn-delete:hover {
    color: #a71d2a;
}

/* Attendance Toggle Buttons */
.attendance-toggle {
    display: flex;
    background: #e0e0e0;
    border-radius: 25px;
    padding: 3px;
    width: fit-content;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.attendance-toggle input[type="radio"] {
    display: none;
}

.toggle-option {
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    user-select: none;
    color: #666;
}

.attendance-toggle input[type="radio"]:checked+.toggle-option {
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Specific Colors for States */
.attendance-toggle input[value="Present"]:checked+.toggle-option {
    background-color: #22c55e;
    /* Green */
}

.attendance-toggle input[value="Absent"]:checked+.toggle-option {
    background-color: #ef4444;
    /* Red */
}

.attendance-toggle input[value="Excused"]:checked+.toggle-option {
    background-color: #eab308;
    /* Yellow/Orange */
}

/* Mobile Responsiveness for Table */
@media (max-width: 600px) {

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        margin-bottom: 1rem;
        border: 1px solid #ccc;
        border-radius: 10px;
        padding: 10px;
        background: #fff;
    }

    td {
        border: none;
        position: relative;
        padding-left: 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}