/* admin/admin.css */
/* Admin Panel Styles */

/* Base Styles */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #f5f5f5; /* Light grey background */
    margin: 0;
    padding: 0;
    color: #333;
}

/* Login Modal Background Overlay */
body.login-modal-open {
    overflow: hidden;
}

body.login-modal-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}
/* Add this to your existing CSS */
.category-description {
    color: #666;
    font-size: 0.9rem;
    margin: -15px 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    font-style: italic;
}

/* For RTL languages */
body.rtl .category-description {
    direction: rtl;
    text-align: right;
}
/* Add this to your existing CSS */
.category-description {
    color: #666;
    font-size: 0.9rem;
    margin: -15px 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    font-style: italic;
}

/* For RTL languages */
body.rtl .category-description {
    direction: rtl;
    text-align: right;
}
/* Admin Container */
.admin-container {
    display: none;
}

/* Admin Header */
.admin-header {
    background-color: #007bff; /* Blue header */
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.admin-header h1 {
    margin: 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
}

.admin-header h1 i {
    margin-right: 10px;
}

/* Admin Navigation (Sidebar) */
.admin-nav {
    background-color: #2c3e50; /* Darker blue/charcoal sidebar */
    color: white;
    width: 250px;
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    padding: 20px 0;
    overflow-y: auto;
    z-index: 900;
}

.admin-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-nav ul li a {
    display: block;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s ease, border-left-color 0.3s ease;
    border-left: 5px solid transparent;
}

.admin-nav ul li a:hover {
    background-color: #34495e; /* Slightly lighter hover for sidebar */
}

.admin-nav ul li a.active {
    background-color: #34495e; /* Active sidebar item background */
    border-left-color: #007bff; /* Blue active border */
}

.admin-nav ul li a i {
    margin-right: 10px;
}

/* Main Content Area */
.admin-main {
    margin-left: 250px;
    padding: 80px 20px 20px 20px;
    min-height: calc(100vh - 60px);
}

/* Sections within Main Content */
.admin-section {
    display: none;
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.admin-section.active {
    display: block;
}

.admin-section h2 {
    color: #007bff; /* Blue heading */
    margin-bottom: 25px;
    font-weight: 600;
}

/* Dashboard Stats Cards */
.stat-card {
    background-color: #f8f9fa; /* Light background for cards */
    border: 1px solid #e9ecef; /* Light border */
    text-align: center;
    border-radius: 8px;
    padding: 20px;
}

.stat-card h3 {
    color: #2c3e50; /* Darker text for card titles */
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #007bff; /* Blue stat numbers */
}

/* Tables */
.table th {
    background-color: #f2f2f2;
    color: #333;
    font-weight: 600;
    border-bottom: 2px solid #ddd;
}

.table td {
    vertical-align: middle;
}

.table img {
    border-radius: 4px;
    max-width: 50px;
    max-height: 50px;
    object-fit: cover;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.3em 0.6em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.status-available {
    background-color: #28a745; /* Green for available */
}

.status-unavailable {
    background-color: #dc3545; /* Red for unavailable */
}

.status-active {
    background-color: #28a745; /* Green for active */
}

.status-inactive {
    background-color: #6c757d; /* Grey for inactive */
}

/* Forms and Modals */
.modal-header {
    background-color: #007bff; /* Blue modal header */
    color: white;
    border-bottom: 1px solid #0056b3; /* Darker blue border */
}

.modal-header .modal-title {
    color: white;
}

.modal-header .btn-close {
    filter: invert(1) brightness(200%); 
}

.form-label {
    font-weight: 500;
    color: #555;
}

/* Add asterisk for required fields */
.form-label .text-danger {
    margin-left: 4px;
}


.form-control,
.form-select {
    border-radius: 4px;
    border: 1px solid #ccc;
    padding: 0.75rem 1rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #007bff; /* Blue focus border */
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25); /* Blue focus shadow */
}

.image-upload-container {
    border: 2px dashed #ddd;
    padding: 15px;
    text-align: center;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.image-upload-container img {
    max-width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    display: block;
    margin: 0 auto 10px auto;
}

/* Item Type/Variation Containers */
.item-type-container,
.sizes-only-container {
    background-color: #f8f9fa; /* Light background for these containers */
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.item-type-container h5,
.sizes-only-container h5 {
    color: #007bff; /* Blue headings for these sections */
}

/* Size Items */
.size-item {
    background-color: #f1f1f1;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
}

/* Option Items */
.option-item {
    background-color: #f5f5f5;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #eee;
}

.option-item input[type="text"],
.option-item input[type="number"] {
    flex-grow: 1;
    min-width: 0;
}

.option-item .remove-option {
    flex-shrink: 0;
}

/* Progress bar for image upload */
#uploadProgress {
    height: 10px;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #666;
    z-index: 10;
}

.password-container {
    position: relative;
}

/* Login Error Message */
.login-error {
    color: #dc3545; /* Red for error messages */
    font-size: 0.9rem;
    margin-top: 10px;
    display: none;
}

/* Alerts */
.alert {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1100;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* --- Responsive Adjustments --- */

/* For devices smaller than 992px */
@media (max-width: 991.98px) {
    .admin-nav {
        width: 100%;
        height: auto;
        position: static;
        padding: 0;
        z-index: 800;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    .admin-nav ul {
        display: flex;
        justify-content: space-around;
        flex-wrap: wrap;
    }

    .admin-nav ul li {
        flex: 1 1 auto;
        text-align: center;
    }

    .admin-nav ul li a {
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 10px 15px;
    }

    .admin-nav ul li a.active {
        border-left-color: transparent;
        border-bottom-color: #007bff; /* Blue active border for mobile nav */
    }

    .admin-main {
        margin-left: 0;
        padding-top: 20px;
    }

    .admin-header {
        position: static;
    }
}

/* For devices smaller than 768px */
@media (max-width: 768px) {
    /* Hide image and status columns for menu items table */
    #menu-items .table th:nth-child(1),
    #menu-items .table td:nth-child(1),
    #menu-items .table th:nth-child(6),
    #menu-items .table td:nth-child(6) {
        display: none;
    }
    /* Hide icon class and items columns for categories table */
    #categories .table th:nth-child(3),
    #categories .table td:nth-child(3),
    #categories .table th:nth-child(5),
    #categories .table td:nth-child(5) {
        display: none;
    }
    
    .stat-card {
        padding: 15px;
    }
    .stat-card h3 {
        font-size: 1rem;
    }
    .stat-card .stat-number {
        font-size: 2rem;
    }
}

/* For devices smaller than 576px */
@media (max-width: 576px) {
    .admin-header h1 {
        font-size: 1.2rem;
    }
    
    .btn {
        padding: 5px 8px;
        font-size: 0.8rem;
    }
    
    /* Further hide columns for menu items table */
    #menu-items .table th:nth-child(3), /* Category */
    #menu-items .table td:nth-child(3),
    #menu-items .table th:nth-child(4), /* Types */
    #menu-items .table td:nth-child(4) {
        display: none;
    }
    
    .modal-content {
        border-radius: 0;
        border: none;
    }
    
    .modal-fullscreen-sm-down { /* This class is not directly used but good to keep if Bootstrap adds it */
        width: 100%;
        max-width: 100%;
        height: 100%;
        margin: 0;
    }
    
    .option-item {
        flex-wrap: wrap;
        gap: 5px;
        padding: 5px;
    }
    
    .option-item input[type="text"],
    .option-item input[type="number"] {
        width: calc(50% - 10px);
        flex-grow: 0;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 0.2em solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-left: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}