/* General Body Style */
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
}

/* Centering the Login Container */
.login-container {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px; /* Limit the container width */
    margin: 100px auto;
    text-align: center;
    box-sizing: border-box;
}

/* Adjust Heading */
.login-container h2 {
    margin-bottom: 20px;
}

/* Style Input Fields */
.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Button Style */
button.btn {
    width: 100%;
    padding: 10px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
}

button.btn:hover {
    background-color: #218838;
}

/* Error Message Style */
.error-message {
    color: red;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    flex-wrap: wrap; /* Ensure wrapping on smaller screens */
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background-color: #343a40;
    color: white;
    padding: 20px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    box-sizing: border-box;
    overflow-y: auto; /* Allow scrolling in the sidebar */
}

.sidebar h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar ul li {
    margin-bottom: 10px;
}

.sidebar ul li a {
    color: white;
    font-size: 18px;
    display: block;
    padding: 10px;
    border-radius: 4px;
}

.sidebar ul li a:hover {
    background-color: #495057;
}

/* Main content */
.main-content {
    flex-grow: 1;
    padding: 40px;
    margin-left: 270px; /* Space for sidebar */
    box-sizing: border-box;
    width: calc(100% - 270px); /* Adjust width for sidebar */
}

.search-form {
    display: flex;
    flex-wrap: wrap; /* Ensure wrapping */
    margin-bottom: 20px;
}

.search-form input[type="text"] {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
    min-width: 0; /* Prevent overflow */
}

.search-form button {
    padding: 10px 20px;
    border: none;
    background-color: #007bff;
    color: white;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.search-form button:hover {
    background-color: #0056b3;
}

.people-table {
    width: 100%;
    border-collapse: collapse;
}

.people-table th, .people-table td {
    border: 1px solid #ccc;
    padding: 10px;
    text-align: left;
}

.people-table th {
    background-color: #007bff;
    color: white;
}

.people-table tr:nth-child(even) {
    background-color: #f2f2f2;
}

.people-table tr:hover {
    background-color: #ddd;
}

.people-table td a {
    display: inline-block; /* Ensures buttons are inline-block */
    padding: 8px 12px; /* Reduced padding to make buttons more compact */
    text-align: center;
    margin-bottom: 5px; /* Adds space between buttons */
    width: auto; /* Do not take up full width, just fit content */
}

/* Pagination Styles */
.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination a {
    padding: 10px 15px;
    border: 1px solid #ddd;
    margin: 0 5px;
    text-decoration: none;
    color: #007bff;
}

.pagination a.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination a:hover {
    background-color: #0056b3;
    color: white;
}

/* Buttons */
.btn {
    padding: 5px 10px;
    border-radius: 4px;
    text-decoration: none;
    color: black;
    font-weight: bold;
    border: none;
}

.btn.green {
    background-color: green;
}

.btn.green:hover {
    background-color: darkgreen;
}

.btn.red {
    background-color: red;
}

.btn.red:hover {
    background-color: darkred;
}

.btn.orange {
    background-color: orange;
}

.btn.orange:hover {
    background-color: darkorange;
}

/* Camera Stream */
#cameraContainer {
    margin-top: 20px;
    text-align: center;
}

#cameraStream {
    width: 100%;
    max-width: 320px;
    height: auto;
    margin-bottom: 10px;
}

#capturePhoto {
    padding: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#capturePhoto:hover {
    background-color: #0056b3;
}

/* Error and Success Messages */
.error-message {
    color: red;
    font-weight: bold;
    margin-top: 10px;
}

.success-message {
    color: green;
    font-weight: bold;
    margin-top: 10px;
}

/* Responsive Adjustments */
@media (max-width: 767px) {
    .dashboard {
        flex-direction: column; /* Stack sidebar and content */
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .search-form {
        flex-direction: column; /* Stack input and button */
    }

    .search-form input[type="text"] {
        border-radius: 4px;
        margin-bottom: 10px; /* Add spacing */
    }

    .search-form button {
        border-radius: 4px;
    }

    .people-table td {
        padding: 10px 5px; /* Add some padding to table cells */
    }

    /* Stack buttons vertically on mobile but limit width */
    .people-table td .btn {
        display: block;
        width: 80%; /* Reduce the button width to 80% */
        margin: 5px auto; /* Center the button and add space */
        text-align: center; /* Center the text inside the button */
    }

    /* Optional: Limit the width of buttons to prevent them from being too wide */
    .people-table td .btn.green,
    .people-table td .btn.red,
    .people-table td .btn.orange {
        max-width: 130px; /* Set a maximum width for buttons */
        padding: 6px 10px; /* Reduce padding further to make buttons smaller */
    }
}
