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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1f2937;
    background-color: #f8fafc;
    overflow-x: hidden;
}

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

/* Sidebar */
.sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.logo span {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

.restaurant-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.restaurant-info p {
    font-size: 14px;
    color: #6b7280;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 0;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item {
    display: block;
    padding: 12px 24px;
    color: #6b7280;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    border-right: 3px solid transparent;
}

.nav-item:hover {
    background: #f9fafb;
    color: #1f2937;
}

.nav-item.active {
    background: #f0fdf4;
    color: rgb(0, 100, 0);
    border-right-color: rgb(0, 100, 0);
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid #e5e7eb;
}

.demo-badge {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    background: #f8fafc;
}

.dashboard-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 24px 32px;
}

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

.page-title h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.page-title p {
    color: #6b7280;
    font-size: 16px;
}

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

.btn-primary {
    background: rgb(0, 100, 0);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: rgb(0, 80, 0);
}

.btn-secondary {
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: rgb(0, 100, 0);
    color: rgb(0, 100, 0);
}

.publish-btn {
    background: linear-gradient(135deg, rgb(0, 100, 0) 0%, rgb(0, 120, 0) 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 100, 0, 0.2);
}

.publish-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 100, 0, 0.3);
}

/* Menu Management Grid */
.menu-management-grid {
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    gap: 24px;
    padding: 32px;
    min-height: calc(100vh - 100px);
}

.menu-management-grid.preview-hidden {
    grid-template-columns: 250px 1fr;
}

/* Categories Panel */
.categories-panel {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    height: fit-content;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.panel-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.add-category-btn {
    width: 32px;
    height: 32px;
    background: rgb(0, 100, 0);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.add-category-btn:hover {
    background: rgb(0, 80, 0);
    transform: scale(1.05);
}

.categories-list {
    padding: 16px 0;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.category-item:hover {
    background: #f9fafb;
}

.category-item.active {
    background: #f0fdf4;
    border-left-color: rgb(0, 100, 0);
}

.category-item.active .category-name {
    color: rgb(0, 100, 0);
    font-weight: 600;
}

.category-name {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.category-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
}

.category-item:hover .category-actions {
    opacity: 1;
}

.edit-category,
.delete-category {
    background: none;
    border: none;
    font-size: 12px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.edit-category:hover {
    background: #f3f4f6;
}

.delete-category:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* Menu Items Panel */
.menu-items-panel {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bulk-actions-btn {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.bulk-actions-btn:hover {
    background: #e5e7eb;
}

.sort-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 12px;
    cursor: pointer;
}

.menu-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 24px;
}

.menu-item-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    transition: all 0.2s;
    position: relative;
}

.menu-item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.menu-item-card.unavailable {
    opacity: 0.6;
    border-color: #fca5a5;
}

.item-image {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s;
}

.menu-item-card:hover .item-image img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.menu-item-card:hover .image-overlay {
    opacity: 1;
}

.change-image-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.change-image-btn:hover {
    background: white;
}

.item-content {
    padding: 20px;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.item-header h4 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.edit-item,
.delete-item {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.edit-item:hover {
    background: #f3f4f6;
}

.delete-item:hover {
    background: #fef2f2;
    color: #dc2626;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.2s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.2s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: rgb(0, 100, 0);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

.item-description {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 12px;
    line-height: 1.5;
}

.item-pricing {
    margin-bottom: 12px;
}

.price {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    display: block;
}

.cost-info {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.item-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
}

.popularity {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.sales {
    color: #6b7280;
}

.add-item-prompt {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.add-item-large {
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 40px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #6b7280;
    width: 100%;
    max-width: 400px;
}

.add-item-large:hover {
    border-color: rgb(0, 100, 0);
    background: #f0fdf4;
    color: rgb(0, 100, 0);
}

.add-icon {
    font-size: 32px;
    font-weight: 300;
}

/* Preview Panel */
.preview-panel {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    height: fit-content;
    max-height: calc(100vh - 150px);
    overflow: hidden;
}

.preview-panel.hidden {
    display: none;
}

.preview-controls {
    display: flex;
    gap: 8px;
}

.device-toggle,
.close-preview {
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.device-toggle:hover,
.close-preview:hover {
    background: #f3f4f6;
}

.preview-content {
    height: 600px;
    overflow: hidden;
}

.preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    transform-origin: top left;
    transition: transform 0.3s;
}

.preview-iframe.mobile {
    transform: scale(0.4);
    width: 250%;
    height: 250%;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.close-modal {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.close-modal:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.modal-body {
    padding: 24px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgb(0, 100, 0);
    box-shadow: 0 0 0 3px rgba(0, 100, 0, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.price-input {
    position: relative;
    display: flex;
    align-items: center;
}

.currency {
    position: absolute;
    left: 12px;
    font-weight: 500;
    color: #6b7280;
    z-index: 1;
}

.price-input input {
    padding-left: 28px;
}

.image-upload {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.image-upload:hover {
    border-color: rgb(0, 100, 0);
    background: #f9fafb;
}

.image-upload input[type="file"] {
    display: none;
}

.upload-preview {
    position: relative;
}

.upload-placeholder {
    color: #6b7280;
    font-size: 14px;
}

#image-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 6px;
}

.pricing-calculator {
    margin-top: 24px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.pricing-calculator h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 16px;
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.calc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.calc-item label {
    font-weight: 500;
    color: #6b7280;
}

.calc-item span {
    font-weight: 600;
    color: #1f2937;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* Bulk Actions Panel */
.bulk-actions-panel {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 999;
    min-width: 400px;
}

.bulk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.bulk-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.close-bulk {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #6b7280;
    padding: 4px;
    border-radius: 4px;
}

.close-bulk:hover {
    background: #f3f4f6;
}

.bulk-content {
    padding: 20px;
}

.bulk-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.selected-count {
    font-size: 12px;
    color: #6b7280;
}

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

.bulk-btn {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.bulk-btn:hover {
    background: #f9fafb;
    border-color: rgb(0, 100, 0);
    color: rgb(0, 100, 0);
}

.bulk-btn.danger:hover {
    background: #fef2f2;
    border-color: #dc2626;
    color: #dc2626;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .menu-management-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .categories-panel {
        order: 1;
    }
    
    .menu-items-panel {
        order: 2;
    }
    
    .preview-panel {
        order: 3;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-items-grid {
        grid-template-columns: 1fr;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .calculator-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header {
        padding: 16px 20px;
    }
    
    .menu-management-grid {
        padding: 20px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
}

/* Animation Classes */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}