/* =======================================
   1. GLOBAL RESET AND BASE STYLES
   ======================================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

body {
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 70px; /* Space for the fixed navigation bar */
}

.container {
    width: 100%;
    max-width: 900px; /* Standard dashboard width */
    margin: 0 auto;
    padding: 20px;
}

h1, h2 {
    color: #007bff; /* Primary blue color */
    margin-bottom: 15px;
}

h1 {
    font-size: 1.8em;
}

h2 {
    font-size: 1.4em;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
    margin-top: 25px;
}

/* =======================================
   2. CARD AND UTILITY STYLES
   ======================================= */

.card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

/* Map Container */
#map {
    height: 400px; /* Standard height for the map view */
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.map-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 5px;
    z-index: 10;
}


/* =======================================
   3. FORM AND INPUT STYLES (Used in Login, Register, Add Student)
   ======================================= */

input[type="text"],
input[type="email"],
input[type="password"],
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1em;
    transition: border-color 0.3s;
}

input:focus, select:focus {
    border-color: #007bff;
    outline: none;
}

/* =======================================
   4. BUTTON STYLES
   ======================================= */

button,
.btn-full {
    display: inline-block;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.3s;
    width: 100%; /* For .btn-full class */
}

/* Primary Blue Button */
.btn-blue {
    background-color: #007bff;
    color: white;
}
.btn-blue:hover {
    background-color: #0056b3;
}

/* Success Green Button (Add Student/In School) */
.btn-green, .btn-add {
    background-color: #28a745;
    color: white;
}
.btn-green:hover, .btn-add:hover {
    background-color: #1e7e34;
}

/* Danger Red Button (Logout/Remove) */
.btn-remove {
    background-color: #dc3545;
    color: white;
}
.btn-remove:hover {
    background-color: #bd2130;
}

.quick-actions button {
    width: auto;
    margin-right: 10px;
    padding: 10px 15px;
}

/* =======================================
   5. DASHBOARD SPECIFIC COMPONENTS
   ======================================= */

/* Student List */
.student-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.student-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    background-color: #fafafa;
}

.student-item strong {
    flex-grow: 1;
}

/* Status Badges */
.status-in-school {
    background-color: #d4edda;
    color: #155724;
    padding: 4px 8px;
    border-radius: 3px;
    font-weight: bold;
    font-size: 0.85em;
}

.status-left-school, .tracking-off {
    background-color: #f8d7da;
    color: #721c24;
    padding: 4px 8px;
    border-radius: 3px;
    font-weight: bold;
    font-size: 0.85em;
}

.status-unknown {
    background-color: #fff3cd;
    color: #856404;
    padding: 4px 8px;
    border-radius: 3px;
    font-weight: bold;
    font-size: 0.85em;
}


/* Alerts Container */
.alert-card {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-left: 5px solid #ffc107; /* Yellow alert indicator */
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.alert-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.alert-item:last-child {
    border-bottom: none;
}

.alert-item i {
    margin-right: 10px;
}

/* =======================================
   6. NAVIGATION BAR (Fixed at the bottom)
   ======================================= */

.nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 65px;
    background-color: #ffffff;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 5px;
    color: #777;
    transition: color 0.3s;
    flex: 1;
    text-align: center;
}

.nav-item i {
    font-size: 1.2em;
    margin-bottom: 2px;
}

.nav-item span {
    font-size: 0.7em;
    white-space: nowrap;
}

.nav-item:hover {
    color: #007bff;
}

.nav-item.active {
    color: #007bff;
    border-top: 3px solid #007bff;
    padding-top: 2px;
}

/* =======================================
   7. STUDENT TRACKER VIEW STYLES
   ======================================= */

/* Used in student.php for the live status */
.tracker-card {
    max-width: 400px;
    margin: 50px auto;
    text-align: center;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.tracking-on {
    background-color: #e6ffe6;
    color: green;
}
.tracking-off {
    background-color: #ffe6e6;
    color: red;
}