/* General Body and Container Styles */
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    margin: 0;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 20px auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

h1, h2, h3 {
    color: #0056b3;
    text-align: center;
    margin-bottom: 20px;
}

hr {
    border: 0;
    height: 1px;
    background-color: #eee;
    margin: 40px 0;
}

/* Navigation Bar */
nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0 0 20px 0;
    background-color: #e9e9e9;
    overflow: hidden;
    border-radius: 5px;
    display: flex;
    justify-content: center; /* Center the nav items */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

nav li {
    float: left;
}

nav li a {
    display: block;
    color: #333;
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
}

nav li a:hover {
    background-color: #ddd;
    color: #000;
}

/* Forms and Inputs */
form {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.05);
}

form label {
    display: inline-block;
    width: 150px;
    margin-bottom: 10px;
    font-weight: bold;
}

form input[type="text"],
form input[type="number"],
form select,
form textarea {
    width: calc(100% - 170px);
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Include padding in width */
    vertical-align: middle;
}

form button {
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
    margin-left: 160px; /* Align with inputs */
}

form button:hover {
    background-color: #0056b3;
}

.btn-add {
    background-color: #28a745;
}
.btn-add:hover {
    background-color: #218838;
}

.btn-edit {
    background-color: #ffc107;
    color: #333;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}
.btn-edit:hover {
    background-color: #e0a800;
}

.btn-delete {
    background-color: #dc3545;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}
.btn-delete:hover {
    background-color: #c82333;
}

.btn-logout {
    background-color: #f44336; /* Red */
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    margin-left: 10px; /* Space from username */
    transition: background-color 0.3s ease;
}

.btn-logout:hover {
    background-color: #da190b;
}

.clear-search-btn {
    background-color: #6c757d;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    margin-left: 10px;
    transition: background-color 0.3s ease;
}
.clear-search-btn:hover {
    background-color: #5a6268;
}


/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table, th, td {
    border: 1px solid #ddd;
}

th, td {
    padding: 12px;
    text-align: left;
}

th {
    background-color: #f2f2f2;
    color: #555;
    font-weight: bold;
}

tr:nth-child(even) {
    background-color: #f8f8f8;
}

tr:hover {
    background-color: #f1f1f1;
}

/* Messages (Success/Error) */
p {
    margin-top: 10px;
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 4px;
}
p[style*="color:green"] {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}
p[style*="color:red"] {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Specific Section Styles */
.room-summary {
    background-color: #eaf6ff;
    border: 1px solid #cce5ff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}
.room-summary h3 {
    color: #007bff;
    margin-top: 0;
    text-align: left;
}
.room-summary ul {
    list-style: none;
    padding: 0;
}
.room-summary li {
    padding: 5px 0;
    border-bottom: 1px dotted #e0e0e0;
}
.room-summary li:last-child {
    border-bottom: none;
}


/* Chart Section */
.chart-section {
    margin-top: 30px;
    text-align: center;
}

.charts-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 30px; /* Space between chart boxes */
    margin-top: 20px;
}

.chart-box {
    background-color: #f0f8ff; /* Light blue background */
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    flex: 1; /* Allow boxes to grow and shrink */
    min-width: 300px; /* Minimum width for responsiveness */
    max-width: 45%; /* Max width to allow two columns */
    height: 350px; /* Fixed height for charts */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.chart-box canvas {
    max-width: 100%;
    max-height: 100%;
}

/* Settings Menu */
.settings-menu {
    text-align: center;
    margin-top: 50px;
}

.settings-menu ul {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 0; /* Override default nav margin */
}

.settings-menu li {
    display: inline-block;
}

.settings-menu .btn-primary {
    display: block;
    padding: 20px 30px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.2em;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.settings-menu .btn-primary:hover {
    background-color: #0056b3;
}

/* Admin Dashboard Specific Styles */
.admin-summary {
    background-color: #e9f7ef; /* Light green background */
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}
.admin-summary h2 {
    color: #28a745; /* Green color */
    margin-top: 0;
}
.admin-summary p {
    font-size: 1.1em;
    color: #333;
}

.admin-options ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    margin-bottom: 30px;
}
.admin-options li {
    display: inline-block;
}
.admin-options .btn-admin {
    display: block;
    padding: 15px 25px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.3s ease;
}
.admin-options .btn-admin:hover {
    background-color: #0056b3;
}

.latest-actions table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
.latest-actions th, .latest-actions td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}
.latest-actions th {
    background-color: #f2f2f2;
}

/* Manage Users/Rooms/Species forms specific styles */
.settings-section form label {
    display: inline-block;
    width: 120px;
    margin-bottom: 8px;
    font-weight: bold;
    text-align: right;
    padding-right: 10px;
}
.settings-section form input[type="text"],
.settings-section form input[type="password"],
.settings-section form select {
    width: calc(100% - 140px);
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    display: inline-block;
    vertical-align: middle;
}
.settings-section form button {
    margin-top: 10px;
    margin-left: 130px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .charts-container {
        flex-direction: column;
        align-items: center;
    }
    .chart-box {
        max-width: 90%;
        min-width: unset;
    }
    nav ul {
        flex-direction: column;
    }
    nav li {
        float: none;
        width: 100%;
    }
    nav li a {
        padding: 10px;
    }
    form label {
        width: 100%;
        text-align: left;
        padding-right: 0;
    }
    form input[type="text"],
    form input[type="number"],
    form select,
    form textarea {
        width: 100%;
        margin-left: 0;
    }
    form button {
        margin-left: 0;
        width: 100%;
    }
    .settings-section form label,
    .settings-section form input[type="text"],
    .settings-section form input[type="password"],
    .settings-section form select,
    .settings-section form button {
        width: 100%;
        margin-left: 0;
        text-align: left;
        display: block;
    }
    .settings-section form input[type="text"],
    .settings-section form input[type="password"],
    .settings-section form select {
        padding-right: 0;
    }
}
.login-container form input[type="text"],
.login-container form input[type="password"],
.login-container form button {
    margin-left: auto;  /* ทำให้จัดกึ่งกลาง */
    margin-right: auto; /* ทำให้จัดกึ่งกลาง */
    display: block;     /* ทำให้กินพื้นที่ทั้งบรรทัด */
}