﻿/* Admin Dashboard Base Styles */
body {
    font-family: 'Lato', sans-serif;
    background-color: #f4f7f6;
    margin: 0;
    display: flex;
    flex-direction: row;
    min-height: 100vh;
}

/* Sidebar Responsive Styles */
.sidebar {
    width: 250px;
    background-color: #333;
    color: #fff;
    padding: 20px;
    transition: all 0.3s;
    z-index: 1000;
}

.sidebar h2 {
    font-size: 1.2rem;
    border-bottom: 1px solid #444;
    padding-bottom: 10px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar li {
    margin-bottom: 15px;
}

.sidebar a {
    color: #ccc;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color 0.3s;
}

.sidebar a:hover,
.sidebar a.active {
    color: #fff;
}

/* Main Content Styles */
.main-content {
    flex: 1;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.header h1 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
}

/* Common Components */
.btn {
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-add {
    background-color: #28a745;
    color: #fff;
}

.btn-edit {
    background-color: #f7b733;
    color: #fff;
}

.btn-delete {
    background-color: #d9534f;
    color: #fff;
}

.btn-danger {
    background-color: #d9534f;
    color: #fff;
}

.btn-save {
    background-color: #28a745;
    color: #fff;
    padding: 12px 25px;
}

.btn-cancel {
    background-color: #ccc;
    color: #333;
    padding: 12px 25px;
}

.logout-btn {
    background-color: #d9534f;
    color: #fff;
}

/* Grid for Dashboard */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.table-card {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    text-align: center;
    text-decoration: none;
    color: #333;
    transition: transform 0.3s, box-shadow 0.3s;
    border-top: 4px solid #0077be;
}

.table-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.table-card i {
    font-size: 2rem;
    color: #0077be;
    margin-bottom: 10px;
    display: block;
}

/* Table Responsive */
.table-responsive {
    overflow-x: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #0077be;
    color: #fff;
    font-weight: bold;
    white-space: nowrap;
}

/* Forms */
.form-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Mobile Toggle */
.menu-toggle {
    display: none;
    background: #333;
    color: #fff;
    border: none;
    padding: 10px 15px;
    font-size: 1.2rem;
    cursor: pointer;
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 1001;
    border-radius: 4px;
}

/* Responsive Media Queries */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
        padding: 10px 20px;
        display: none;
        /* Controlled by JS or simplify for now */
    }

    .sidebar.active {
        display: block;
    }

    .menu-toggle {
        display: block;
    }

    .main-content {
        padding: 60px 15px 20px;
        /* Space for fixed toggle */
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header div {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        width: 100%;
    }

    .btn {
        flex: 1;
        justify-content: center;
        text-align: center;
    }

    /* Table mobile stack */
    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        background: #fff;
    }

    td {
        border: none;
        position: relative;
        padding-left: 50%;
        text-align: right;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    td:before {
        position: absolute;
        left: 15px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        content: attr(data-label);
    }
}

/* Login Page Specific Styles */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background-color: #f4f7f6;
    font-family: 'Lato', sans-serif;
}

.login-container {
    background-color: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-container h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

.login-container .error {
    color: #d9534f;
    text-align: center;
    margin-bottom: 20px;
}

.login-container .form-group {
    margin-bottom: 20px;
}

.login-container label {
    display: block;
    margin-bottom: 5px;
    color: #666;
}

.login-container input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.login-container button {
    width: 100%;
    padding: 12px;
    background-color: #0077be;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.login-container button:hover {
    background-color: #0056b3;
}