/* Admin CSS - The Italian Pantry Admin Panel */

:root {
    --primary-color: #8b0000; /* Dark Red */
    --primary-light: #b22222; /* Firebrick */
    --secondary-color: #d4af37; /* Gold */
    --success-color: #2c5530; /* Italian Green */
    --success-light: #4a7c59;
    --danger-color: #d32f2f;
    --dark-bg: #121212;
    --dark-card: #1e1e1e;
    --dark-sidebar: #181818;
    --border-color: #2d2d2d;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --text-white: #ffffff;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--text-white);
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--text-white);
}

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

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

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

/* Login Screen Layout */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #2b0000 0%, #0c0000 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.login-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-card {
    background: rgba(30, 30, 30, 0.75);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    padding: 3rem;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.login-logo {
    width: 80px;
    height: auto;
    margin-bottom: 1rem;
}

.login-card h2 {
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.login-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.login-form input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-white);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    outline: none;
    transition: border-color 0.3s ease;
    text-align: center;
    letter-spacing: 0.2rem;
}

.login-form input:focus {
    border-color: var(--secondary-color);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-white);
}

.btn-primary:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #333333;
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: #444444;
    color: var(--text-white);
}

.btn-danger {
    background-color: var(--danger-color);
    color: var(--text-white);
}

.btn-danger:hover {
    background-color: #ff3333;
}

.btn-success {
    background-color: var(--success-color);
    color: var(--text-white);
}

.btn-success:hover {
    background-color: var(--success-light);
}

.login-form .btn-submit {
    width: 100%;
}

.login-feedback {
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-top: 1rem;
    min-height: 20px;
}

/* Dashboard Panel Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    background-color: var(--dark-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.sidebar-logo {
    width: 45px;
    height: auto;
}

.sidebar-header h1 {
    font-size: 1.3rem;
    line-height: 1.2;
}

.sidebar-header span {
    color: var(--secondary-color);
    font-size: 0.75rem;
    font-style: italic;
    display: block;
}

.sidebar-menu {
    list-style: none;
    flex-grow: 1;
}

.sidebar-menu li {
    margin-bottom: 0.5rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0.8rem 1rem;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.sidebar-menu a:hover, .sidebar-menu li.active a {
    color: var(--text-white);
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-menu li.active a {
    border-left: 3px solid var(--secondary-color);
    background-color: rgba(255, 255, 255, 0.08);
}

.sidebar-menu a i {
    width: 20px;
    font-size: 1.1rem;
    text-align: center;
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 1.5rem;
}

.btn-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.btn-logout:hover {
    color: var(--text-white);
    background-color: rgba(211, 47, 47, 0.1);
    border-color: var(--danger-color);
}

/* Content Area Layout */
.content-area {
    flex-grow: 1;
    margin-left: 280px;
    padding: 2rem 3rem;
    min-height: 100vh;
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.header-bar h2 {
    font-size: 2rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.tab-section {
    display: none;
    animation: fadeIn 0.4s ease;
}

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

/* Widgets Grid (Overview) */
.widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.widget-card {
    background-color: var(--dark-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 20px;
}

.widget-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: rgba(212, 175, 55, 0.1);
    color: var(--secondary-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
}

.widget-details h4 {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.widget-details p {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-white);
}

/* Dashboard Info Section */
.info-card {
    background-color: var(--dark-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.info-card h3 {
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.info-card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Forms Styling */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-white);
    font-size: 0.9rem;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--secondary-color);
    background-color: rgba(0, 0, 0, 0.4);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* File Upload Field */
.file-upload-wrapper {
    display: flex;
    gap: 15px;
    align-items: center;
}

.file-upload-input {
    display: none;
}

.file-upload-btn {
    padding: 0.75rem 1.25rem;
    background-color: #333333;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.file-upload-btn:hover {
    background-color: #444444;
    color: var(--text-white);
}

.image-preview-box {
    width: 80px;
    height: 80px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-box i {
    font-size: 1.5rem;
    color: #444444;
}

/* CRUD Section Layout */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h3 {
    font-size: 1.5rem;
}

.item-list-container {
    background-color: var(--dark-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

/* Elegant Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background-color: rgba(255, 255, 255, 0.02);
    font-family: 'Open Sans', sans-serif;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.01);
}

.table-thumb {
    width: 50px;
    height: 50px;
    border-radius: 4px;
    object-fit: cover;
    background-color: rgba(0, 0, 0, 0.2);
}

.food-category-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: rgba(212, 175, 55, 0.15);
    color: var(--secondary-color);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.table-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-icon-edit {
    background-color: rgba(212, 175, 55, 0.15);
    color: var(--secondary-color);
}

.btn-icon-edit:hover {
    background-color: var(--secondary-color);
    color: #000;
}

.btn-icon-delete {
    background-color: rgba(211, 47, 47, 0.15);
    color: var(--danger-color);
}

.btn-icon-delete:hover {
    background-color: var(--danger-color);
    color: var(--text-white);
}

/* Modal Window */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--dark-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: all 0.3s ease;
    overflow: hidden;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--text-white);
}

.modal-body {
    padding: 2rem;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 2000;
}

.toast {
    background-color: #222222;
    border-left: 4px solid var(--secondary-color);
    color: var(--text-white);
    padding: 1rem 1.5rem;
    border-radius: 4px;
    margin-top: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease, fadeOut 0.5s ease 2.5s forwards;
}

.toast-success {
    border-left-color: var(--success-color);
}

.toast-error {
    border-left-color: var(--danger-color);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeOut {
    to { opacity: 0; visibility: hidden; }
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .sidebar {
        width: 80px;
        padding: 2rem 0.5rem;
        align-items: center;
    }
    .sidebar-header h1, .sidebar-header span {
        display: none;
    }
    .sidebar-logo {
        width: 35px;
    }
    .sidebar-menu a span {
        display: none;
    }
    .sidebar-menu a {
        justify-content: center;
        padding: 0.8rem;
    }
    .content-area {
        margin-left: 80px;
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1rem;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .sidebar-header {
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }
    .sidebar-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    .sidebar-menu li {
        margin-bottom: 0;
    }
    .sidebar-menu a span {
        display: inline;
    }
    .content-area {
        margin-left: 0;
        padding: 1.5rem;
    }
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}
