/* General styles */
body {
    font-family: Arial, sans-serif;
    background: #f4f4f4;
    text-align: center;
    margin: 0;
    padding: 0;
}

/* Add user container */
.add-user-container {
    width: 100%;
    max-width: 1000px;
    margin: 50px auto;
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
    text-align: left;
}

/* Header styles */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Back button */
.back-button {
    text-decoration: none;
    background: #dc3545;
    color: white;
    padding: 8px 12px;
    border-radius: 5px;
}

.back-button:hover {
    background: #c82333;
}

/* Form styles */
input, select, button {
    width: 90%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Add User Button */
button[type="submit"] {
    background: #007bff;
    color: white;
    border: none;
}

button[type="submit"]:hover {
    background: #0056b3;
}

/* Table styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    table-layout: fixed;
}

th, td {
    border: 1px solid #ddd;
    padding: 10px;
    text-overflow: ellipsis;
    word-wrap: break-word;
}

th {
    background: #28a745;
    color: white;
}

/* Action buttons (Edit and Delete) */
button, a {
    width: auto; /* Allow buttons to adapt to content size */
    padding: 6px 12px; /* Ensure same padding for both buttons */
    border-radius: 5px;
    text-decoration: none;
    margin-right: 10px;
    display: inline-block;
    font-size: 14px; /* Consistent font size */
    text-align: center;
    box-sizing: border-box; /* Ensures padding doesn't affect width */
}

/* Add User Button */
.add-user-btn {
    width: 100%;
    background: #007bff;
    color: white;
    border: none;
}

.add-user-btn:hover {
    background: #0056b3;
}

/* Edit Button */
.edit-btn {
    background: #ffc107;
    color: white;
    border: none;
}

.edit-btn:hover {
    background: #e0a800;
}

/* Delete Button */
.delete-button {
    background: #dc3545;
    color: white;
    text-align: center;
}

.delete-button:hover {
    background: #c82333;
}

/* Pagination styles */
.pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.pagination a {
    padding: 8px 12px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
}

.pagination a:hover {
    background: #0056b3;
}

.pagination a.active {
    background: #28a745;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background: white;
    padding: 20px;
    width: 300px;
    margin: 15% auto;
    border-radius: 10px;
}

.close {
    float: right;
    font-size: 20px;
    cursor: pointer;
}

/* Responsive styles */

/* Phones (<= 375px) */
@media (max-width: 375px) {
    table {
        font-size: 10px;
    }
    .add-user-container {
        padding: 10px;
        margin: 10px;
    }
    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Center buttons */
    .add-user-btn, .edit-btn, .delete-button {
        width: 100%;
        max-width: 300px; /* Limit width for mobile screens */
        margin: 10px auto; /* Center horizontally */
    }
}

/* Tablets (<= 768px) */
@media (max-width: 768px) {
    table {
        font-size: 12px;
    }
    .add-user-container {
        padding: 15px;
        margin: 20px;
    }

    /* Buttons centered with max-width 500px */
    .add-user-btn, .edit-btn, .delete-button {
        width: 100%;
        max-width: 500px; /* Limit width for tablets */
        margin: 10px auto; /* Center horizontally */
    }
}

/* Desktop screens (>= 769px) */
@media (min-width: 769px) {
    .add-user-container {
        padding: 25px;
        margin: 50px auto;
    }

    /* Buttons centered with max-width 1000px */
    .add-user-btn, .edit-btn, .delete-button {
        width: auto;
        max-width: 1000px; /* Limit width for desktop */
        margin: 10px auto; /* Center horizontally */
    }
}
