/* /public/css/styles.css */
body,
html {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f6fa;
    color: #2c3e50;
    font-size: medium;
}

.admin-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background-color: #2a73dd;
    color: white;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar .logo {
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: bold;
}

.sidebar .nav {
    list-style: none;
    padding: 0;
    width: 100%;
}

.sidebar .nav li {
    width: 100%;
}

.sidebar .nav li a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: white;
    transition: background 0.3s;
}

.sidebar .nav li a:hover {
    background-color: #e7f1fe;
    color: black;
}

.sidebar .nav li.active > a {
    background-color: #e7f1fe;
    color: black;
    font-weight: bold;
}

.sidebar .nav li.active.has-submenu > a {
    background-color: #e7f1fe;
    color: black;
    font-weight: bold;
}

.sidebar .nav li.active .submenu {
    display: block;
}

.sidebar .nav li.active.has-submenu > a::after {
    transform: rotate(90deg);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.top-bar {
    background-color: #ffffff;
    padding: 15px 25px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid #ddd;
}

.content {
    padding: 25px;
    flex: 1;
    /*overflow-y: auto;*/
}

.footer {
    padding: 15px;
    text-align: center;
    font-size: 14px;
    color: #888;
    background-color: #fff;
    border-top: 1px solid #ddd;
}

/* Hamburger Button */
.hamburger {
    font-size: 24px;
    background: none;
    border: none;
    color: #2c3e50;
    display: none;
    cursor: pointer;
    margin-right: 15px;
}

/* Responsive styles */
@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        left: -220px;
        top: 0;
        height: 100%;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .top-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .hamburger {
        display: inline;
    }

    .content {
        padding: 20px;
    }
}

/* Close Button */
.close-sidebar {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    position: absolute;
    top: 15px;
    right: 20px;
    display: none;
    cursor: pointer;
}

/* Overlay for sidebar */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
    display: none;
}

/* Show close button and overlay when sidebar is active */
@media (max-width: 768px) {
    .close-sidebar {
        display: block;
    }

    .sidebar.active + .sidebar-overlay {
        display: block;
    }
}

.has-submenu > a {
    cursor: pointer;
    position: relative;
}

.has-submenu > a::after {
    content: "▸";
    position: absolute;
    right: 20px;
    transition: transform 0.3s ease;
}

.has-submenu.open > a::after {
    transform: rotate(90deg);
}

.submenu {
    list-style: none;
    padding-left: 20px;
    margin: 5px 0 10px;
    display: none;
}

.has-submenu.open .submenu {
    display: block;
}

.submenu li a {
    font-size: 14px;
    padding: 8px 15px;
    display: block;
    color: white;
    background-color: #3a87e3;
    border-radius: 4px;
    margin-bottom: 4px;
    text-decoration: none;
}

.submenu li a:hover {
    background-color: #e7f1fe;
    color: #2a73dd;
}

.login-form {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 800px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
}

.login-form h2 {
    margin-bottom: 20px;
    text-align: center;
}

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

.login-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.login-form input {
    width: 90%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.login-form .btn-login {
    width: 100%;
    padding: 10px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 10px;
}

.login-form .btn-login:hover {
    background: #0056b3;
}

.error-message {
    color: red;
    margin-bottom: 15px;
    text-align: center;
}

.centered-login {
    margin: 100px auto;
}

/*main {*/
/*    padding: 40px;*/
/*    max-width: 1200px;*/
/*    margin: auto;*/
/*    background: #fff;*/
/*    border-radius: 12px;*/
/*    box-shadow: 0 5px 25px rgba(0,0,0,0.05);*/
/*    font-family: "Segoe UI", sans-serif;*/
/*}*/

main h2 {
    font-size: 26px;
    margin-bottom: 20px;
    color: #333;
}

.actions {
    margin-bottom: 20px;
}

.actions a {
    padding: 10px 18px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    /*font-weight: 500;*/
}

.actions a:hover {
    background-color: #0056b3;
}

form {
    margin-bottom: 20px;
}

form button {
    padding: 8px 14px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

form button:hover {
    background: #218838;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

table thead {
    background-color: #f8f9fa;
}

table th,
table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e9ecef;
    text-align: left;
    font-size: 15px;
}

table th {
    color: #495057;
    font-weight: 600;
}

.edit-button,
.delete-button,
.activate-button {
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 5px;
    margin-right: 5px;
    text-decoration: none;
    color: white;
}

.edit-button {
    background-color: #ffc107;
}

.delete-button {
    background-color: #dc3545;
}

.activate-button {
    background-color: #28a745;
}
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 30px;
    font-size: 14px;
}

.pagination a,
.pagination .current-page {
    padding: 6px 10px;
    border-radius: 5px;
    text-decoration: none;
    background: #f1f1f1;
    color: #333;
}

.pagination a:hover {
    background: #007bff;
    color: white;
}

.pagination .current-page {
    background: #007bff;
    color: white;
    font-weight: bold;
}

.goto-page-form {
    display: flex;
    align-items: center;
    gap: 6px;
}
.goto-page-form input[type="number"] {
    width: 60px;
    padding: 6px;
}

.form-container {
    /*max-width: 600px;*/
    /*margin: 50px auto;*/
    /*padding: 0 20px;*/
}

.form-card {
    /*background: #fff;*/
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 30px;
}

.form-card h2 {
    margin-bottom: 20px;
    font-size: 24px;
    color: #333;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #444;
}

form input[type="text"],
form input[type="number"] {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-right: 10px;
    min-width: 250px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 14px;
}

.btn-primary {
    background-color: #007bff;
    color: white;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.alert {
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-danger {
    background-color: #ffe5e5;
    color: #a94442;
    border: 1px solid #f5c6cb;
}
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background-color: #333;
    color: white;
    padding: 12px 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    opacity: 1;
    transition:
        opacity 0.5s ease,
        transform 0.5s ease;
}

.toast-success {
    background-color: #28a745;
}

.toast-error {
    background-color: #dc3545;
}

.toast.fade-out {
    opacity: 0;
    transform: translateX(100%);
}

@media (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    table th,
    table td {
        white-space: nowrap;
    }
}
button,
a {
    font-size: initial;
}

.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Make image preview a positioned container so .remove-btn positions correctly */
.image-preview {
    position: relative;
    display: inline-block;
}

.image-thumbnail {
    position: relative;
    width: 150px;
    height: 150px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.image-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 0, 0, 0.7);
    color: white;
    border: none;
    font-size: 18px;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.remove-btn:hover {
    background: rgba(255, 0, 0, 0.9);
}

.delete-form {
    margin: 0;
    padding: 0;
}

fieldset {
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    padding: 18px 20px 14px 20px;
    margin-bottom: 22px;
    background: #fafbfc;
}

legend {
    font-size: 1.1em;
    font-weight: 600;
    color: #2a73dd;
    padding: 0 8px;
    margin-left: -4px;
}
