/* ─── Global Body & Background ───────────────────────────────────────────────── */

body {
    font-family: 'Segoe UI', sans-serif;
    /* solid blue background */
    background-color: #4A90E2;
    /* Or use a gradient:
    background: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%);
    */
    color: #fff;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}
body.dark-mode {
    background-color: #121212;
    color: #eee;
}

/* ─── Homepage Container & Centering ────────────────────────────────────────── */

.container {
    max-width: 480px;
    margin: 100px auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    color: #333;
}

/* ─── Logo & Headings for Homepage ─────────────────────────────────────────── */

.logo {
    width: 80px;
    margin-bottom: 20px;
}
h1, h2 {
    margin: 0 0 15px;
    color: #1e87f0;
}

/* ─── Buttons on Homepage ──────────────────────────────────────────────────── */

.buttons {
    margin-top: 25px;
}
.buttons .btn {
    margin: 0 10px;
    padding: 10px 20px;
    font-size: 16px;
    background: #1e87f0;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.2s ease;
}
.buttons .btn:hover {
    background: #0e6fd8;
    transform: translateY(-2px);
}

/* ─── Global Form Styles (Login & Register) ───────────────────────────────── */

form {
    display: flex;
    flex-direction: column;
}
input, button {
    padding: 12px;
    margin: 8px 0;
    border: 1px solid #ccc;
    border-radius: 6px;
}
button {
    background-color: #1e87f0;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}
button:hover {
    background-color: #0e6fd8;
    transform: translateY(-2px);
}
a {
    text-align: center;
    display: block;
    margin-top: 15px;
    color: #1e87f0;
    text-decoration: none;
}

/* ─── Password Toggle Icon ─────────────────────────────────────────────────── */

.password-wrapper {
    position: relative;
    width: 100%;
}
.password-wrapper input {
    width: 100%;
    padding-right: 40px;
}
.toggle-password {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 18px;
    color: #555;
}

/* ─── Messages ──────────────────────────────────────────────────────────────── */

.message {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 5px;
    font-size: 14px;
}
.error {
    background-color: #f8d7da;
    color: #721c24;
}
.success {
    background-color: #d4edda;
    color: #155724;
}

/* ─── Dark Mode Overrides ──────────────────────────────────────────────────── */

body.dark-mode .container {
    background-color: #1f1f1f;
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.05);
}
body.dark-mode button {
    background-color: #2196f3;
}
body.dark-mode button:hover {
    background-color: #0e6fd8;
}

/* ─── Theme Toggle Switch ──────────────────────────────────────────────────── */

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
}
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    background-color: #ccc;
    top: 0; left: 0; right: 0; bottom: 0;
    transition: .4s;
    border-radius: 34px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: #fff;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: #1e87f0;
}
input:checked + .slider:before {
    transform: translateX(24px);
}

/* ─── Admin Card Container (overrides .container) ─────────────────────────── */

.container.card {
    width: 95%;
    max-width: 1200px;
    margin: 40px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    overflow: hidden;
    color: #333;
    text-align: left;
    padding: 0;
}

/* ─── Card Header & Stats ─────────────────────────────────────────────────── */

.card-header {
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
}
.card-header h2 {
    margin: 0;
    color: #1e87f0;
    font-size: 24px;
}
.card-header .stats {
    margin-top: 8px;
    font-size: 14px;
    color: #444;
}

/* ─── Search Form (Admin) ──────────────────────────────────────────────────── */

.search-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 20px 30px;
}
.search-form input[type="text"] {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
}
.search-form button[type="submit"],
.search-form .btn {
    flex: 0 0 auto;
    padding: 8px 16px;
    margin: 0;
}
.search-form .right {
    margin-left: auto;
}

/* ─── Table Wrapper & Styles ───────────────────────────────────────────────── */

.table-wrapper {
    overflow-x: auto;
    padding: 0 30px 20px;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}
thead th {
    background: #1e87f0;
    color: #fff;
    padding: 12px 16px;
    font-weight: 600;
}
thead th:first-child {
    border-top-left-radius: 8px;
}
thead th:last-child {
    border-top-right-radius: 8px;
}
tbody tr {
    border-bottom: 1px solid #eee;
}
tbody tr:hover {
    background: #f9f9f9;
}
td {
    padding: 12px 16px;
    vertical-align: middle;
}
.admin td {
    background: #f1f9ff;
}

/* ─── Buttons ───────────────────────────────────────────────────────────────── */

.btn {
    display: inline-block;
    background: #1e87f0;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.3s;
    font-size: 14px;
    text-align: center;
}
.btn:hover {
    background: #0e6fd8;
}
.btn.success {
    background-color: #28a745;
}
.btn.success:hover {
    background-color: #218838;
}
.btn.danger {
    background-color: #dc3545;
}
.btn.danger:hover {
    background-color: #c82333;
}
.btn.small {
    padding: 6px 12px;
    font-size: 13px;
}
.btn.back {
    margin: 20px 30px;
    background: transparent;
    color: #1e87f0;
    border: 1px solid #1e87f0;
}
.btn.back:hover {
    background: #1e87f0;
    color: #fff;
}

