/* General Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #28a745;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background: #218838;
}

.btn.delete {
    background: #dc3545;
}

.btn.delete:hover {
    background: #c82333;
}

.btn.back {
    background: #6c757d;
    margin-right: 10px;
}

.btn.back:hover {
    background: #5a6268;
}

/* Sort By Dropdown */
.sort-form {
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-form label {
    font-weight: bold;
    color: #333;
}

.sort-form select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.sort-form select:hover {
    border-color: #28a745;
}

.sort-form select:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 5px rgba(40, 167, 69, 0.5);
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

table, th, td {
    border: 1px solid #ddd;
}

th, td {
    padding: 12px;
    text-align: left;
}

th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #333;
}

tr:hover {
    background-color: #f1f1f1;
}

/* Form Styles */
.form-container {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.form-container h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

.form-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.form-container input[type="text"],
.form-container input[type="number"],
.form-container input[type="file"] {
    width: 100%; /* Full width */
    padding: 10px 12px; /* Equal padding on left and right */
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box; /* Ensure padding is included in the width */
}

.form-container input[type="text"]:focus,
.form-container input[type="number"]:focus,
.form-container input[type="file"]:focus {
    outline: none;
    border-color: #28a745;
    box-shadow: 0 0 5px rgba(40, 167, 69, 0.5);
}

.form-container .btn {
    display: inline-block;
    padding: 10px 20px;
    background: #28a745;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.form-container .btn:hover {
    background: #218838;
}

.form-container .btn.back {
    background: #6c757d;
    margin-right: 10px;
}

.form-container .btn.back:hover {
    background: #5a6268;
}

/* Image Preview */
#image-preview {
    max-width: 100px;
    margin-top: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    table, thead, tbody, th, td, tr {
        display: block;
    }

    th {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        border: 1px solid #ccc;
    }

    td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50%;
    }

    td:before {
        position: absolute;
        top: 6px;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        content: attr(data-label);
    }

    .pagination {
        margin-top: 20px;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
    }

    .pagination .btn {
        padding: 8px 16px;
        background: #28a745;
        color: #fff;
        text-decoration: none;
        border-radius: 5px;
        transition: background-color 0.3s ease;
    }

    .pagination .btn:hover {
        background: #218838;
    }

    .pagination span {
        font-size: 14px;
        color: #555;
    }
}