/* 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: #f9fafb;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 24px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.restaurant-info {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.restaurant-logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-placeholder svg {
    border-radius: 12px;
}

.restaurant-details h1 {
    font-size: 28px;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 4px;
}

.restaurant-details p {
    color: #6b7280;
    font-size: 16px;
    margin-bottom: 8px;
}

.restaurant-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #059669;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.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;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.demo-actions {
    margin-top: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.analytics-btn {
    background: linear-gradient(135deg, rgb(0, 100, 0) 0%, rgb(0, 120, 0) 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(0, 100, 0, 0.2);
    min-height: 44px;
}

.analytics-btn:hover {
    background: linear-gradient(135deg, rgb(0, 80, 0) 0%, rgb(0, 100, 0) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 100, 0, 0.3);
}

.back-btn {
    background: transparent;
    color: #6b7280;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    border: 1px solid #e5e7eb;
    min-height: 44px;
}

.back-btn:hover {
    color: #1f2937;
    background: #f9fafb;
    border-color: #d1d5db;
}

/* Main Content */
.main-content {
    padding: 32px 0;
}

.ordering-interface {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
    align-items: start;
}

/* Menu Section */
.menu-section {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.section-header {
    padding: 32px;
    border-bottom: 1px solid #e5e7eb;
    text-align: center;
}

.section-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.section-header p {
    color: #6b7280;
    font-size: 16px;
}

.menu-categories {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.category-btn {
    flex: 1;
    padding: 16px 24px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-btn:hover {
    background: white;
    color: #1f2937;
}

.category-btn.active {
    background: white;
    color: rgb(0, 100, 0);
    border-bottom-color: rgb(0, 100, 0);
}

.menu-items {
    padding: 24px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 16px;
    background: white;
    transition: all 0.2s;
}

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

.item-image {
    flex-shrink: 0;
}

.image-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-photo {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.2s;
}

.menu-item:hover .menu-photo {
    transform: scale(1.05);
}

.item-details {
    flex-grow: 1;
}

.item-details h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.item-details p {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.item-price {
    font-size: 18px;
    font-weight: 700;
    color: rgb(0, 100, 0);
}

.item-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.quantity-btn {
    width: 44px;
    height: 44px;
    border: 2px solid rgb(0, 100, 0);
    background: transparent;
    color: rgb(0, 100, 0);
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
}

.quantity-btn:hover {
    background: rgb(0, 100, 0);
    color: white;
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    min-width: 24px;
    text-align: center;
}

/* Order Summary */
.order-summary {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 24px;
    position: sticky;
    top: 120px;
    height: fit-content;
}

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

.summary-header h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 16px;
}

.order-type {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.order-type label {
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.order-type select {
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    color: #1f2937;
}

.customer-info {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

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

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input: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;
}

.order-items {
    margin-bottom: 24px;
    max-height: 300px;
    overflow-y: auto;
}

.empty-cart {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.empty-cart p:first-child {
    font-weight: 600;
    margin-bottom: 4px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

.order-item:last-child {
    border-bottom: none;
}

.order-item-info {
    flex-grow: 1;
}

.order-item-name {
    font-weight: 500;
    color: #1f2937;
    font-size: 14px;
}

.order-item-quantity {
    font-size: 12px;
    color: #6b7280;
}

.order-item-price {
    font-weight: 600;
    color: #1f2937;
    font-size: 14px;
}

.order-totals {
    margin-bottom: 24px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
}

.total-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.total-line:last-child {
    margin-bottom: 0;
}

.final-total {
    font-weight: 700;
    font-size: 18px;
    color: #1f2937;
    border-top: 1px solid #e5e7eb;
    padding-top: 8px;
    margin-top: 8px;
}

.place-order-btn {
    width: 100%;
    background: rgb(0, 100, 0);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

.place-order-btn:hover:not(:disabled) {
    background: rgb(0, 80, 0);
    transform: translateY(-1px);
}

.place-order-btn:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* Message Modal */
.message-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

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

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

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

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

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

.modal-body {
    padding: 24px;
}

.message-tabs {
    display: flex;
    margin-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.message-tab {
    flex: 1;
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.message-tab.active {
    color: rgb(0, 100, 0);
    border-bottom-color: rgb(0, 100, 0);
}

.message-content {
    margin-bottom: 32px;
}

.sms-message {
    background: #f3f4f6;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #3b82f6;
    position: relative;
}

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

.sms-icon {
    width: 32px;
    height: 32px;
    background: #3b82f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.sms-info h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.sms-info p {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

.telegram-message {
    background: #f0f9ff;
    border-radius: 12px;
    padding: 20px;
    border-left: 4px solid #0ea5e9;
    position: relative;
}

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

.telegram-icon {
    width: 32px;
    height: 32px;
    background: #0ea5e9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
}

.telegram-info h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.telegram-info p {
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

.message-text {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #1f2937;
    white-space: pre-line;
}

.success-message {
    text-align: center;
    padding: 24px;
    background: #f0fdf4;
    border-radius: 12px;
    border: 1px solid #bbf7d0;
}

.success-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.success-message h4 {
    font-size: 20px;
    font-weight: 700;
    color: #166534;
    margin-bottom: 8px;
}

.success-message p {
    color: #16a34a;
    font-size: 14px;
}

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

.btn-primary {
    background: rgb(0, 100, 0);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
    min-width: 44px;
}

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

.btn-secondary {
    background: transparent;
    color: #6b7280;
    border: 2px solid #e5e7eb;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
    min-width: 44px;
}

.btn-secondary:hover {
    border-color: #d1d5db;
    color: #374151;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.hamburger-line {
    display: block;
    height: 3px;
    width: 100%;
    background-color: #1f2937;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    background-color: white;
    z-index: 1001;
    padding: 80px 24px 24px;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu .nav-link {
    display: block;
    padding: 16px 0;
    border-bottom: 1px solid #e5e7eb;
    font-size: 18px;
    color: #1f2937;
    text-decoration: none;
    min-height: 54px;
    display: flex;
    align-items: center;
}

.mobile-menu .nav-link:hover {
    color: rgb(0, 100, 0);
}

/* Responsive Design - Mobile First Approach */
@media (max-width: 480px) {
    .mobile-menu-btn {
        display: flex;
    }
    
    .demo-actions {
        display: none;
    }
    
    .container {
        padding: 0 12px;
    }
    
    .header {
        padding: 16px 0;
    }
    
    .restaurant-info {
        padding: 0 12px;
        gap: 12px;
    }
    
    .restaurant-details h1 {
        font-size: 24px;
    }
    
    .restaurant-details p {
        font-size: 14px;
    }
    
    .main-content {
        padding: 24px 0;
    }
    
    .section-header {
        padding: 24px 20px;
    }
    
    .section-header h2 {
        font-size: 28px;
    }
    
    .menu-categories {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0;
    }
    
    .category-btn {
        font-size: 14px;
        padding: 14px 12px;
    }
    
    .menu-items {
        padding: 16px;
    }
    
    .menu-item {
        padding: 16px;
        margin-bottom: 12px;
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .menu-photo {
        width: 120px;
        height: 120px;
    }
    
    .item-details h3 {
        font-size: 18px;
    }
    
    .item-details p {
        font-size: 13px;
    }
    
    .item-price {
        font-size: 16px;
    }
    
    .order-summary {
        padding: 20px;
        margin-top: 0;
    }
    
    .summary-header h3 {
        font-size: 20px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }
    
    .modal-header h3 {
        font-size: 20px;
    }
    
    .message-tabs {
        margin-bottom: 16px;
    }
    
    .message-tab {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 8px;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding: 14px 20px;
    }
    
    /* Optimize form inputs for mobile */
    .form-group input,
    .form-group textarea,
    .order-type select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 14px 12px;
    }
    
    /* Improve quantity controls spacing */
    .quantity-btn {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .quantity {
        font-size: 20px;
        min-width: 32px;
    }
    
    /* Better spacing for mobile order summary */
    .order-items {
        max-height: 250px;
    }
    
    .order-item {
        padding: 14px 0;
    }
    
    .order-item-name {
        font-size: 15px;
    }
    
    .order-item-price {
        font-size: 15px;
    }
    
    /* Optimize restaurant status for mobile */
    .restaurant-status {
        font-size: 13px;
        justify-content: center;
    }
    
    /* Improve demo badge positioning */
    .demo-badge {
        font-size: 11px;
        padding: 6px 12px;
    }
}

@media (max-width: 968px) {
    .ordering-interface {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .order-summary {
        position: static;
    }
    
    .restaurant-info {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .menu-categories {
        flex-wrap: wrap;
    }
    
    .category-btn {
        flex: 1 1 50%;
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }
    
    .demo-actions {
        display: none;
    }
    
    .mobile-menu-overlay.active,
    .mobile-menu {
        display: block;
    }
    
    .container {
        padding: 0 16px;
    }
    
    .menu-item {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .item-controls {
        justify-content: center;
    }
    
    .restaurant-info {
        padding: 0 16px;
    }
    
    .restaurant-logo {
        flex-direction: column;
        gap: 12px;
    }
    
    .category-btn {
        flex: 1 1 100%;
        font-size: 15px;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .section-header h2 {
        font-size: 30px;
    }
    
    .restaurant-details h1 {
        font-size: 26px;
    }
    
    .main-content {
        padding: 28px 0;
    }
}