/* ===================================
   Restaurant & Kitchen Module Styles
   =================================== */

/* Restaurant Dashboard */
.restaurant-dashboard {
    padding: 20px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.page-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 28px;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

/* Statistics Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.stat-card.available {
    border-left: 4px solid #28a745;
}

.stat-card.occupied {
    border-left: 4px solid #dc3545;
}

.stat-card.orders {
    border-left: 4px solid #007bff;
}

.stat-card.revenue {
    border-left: 4px solid #ffc107;
}

.stat-icon {
    font-size: 40px;
    color: #6c757d;
}

.stat-details h3 {
    margin: 0;
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
}

.stat-details p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

/* Filter Section */
.filter-section {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.filter-section label {
    font-weight: 600;
    margin-right: 10px;
    color: #2c3e50;
}

/* Tables Section */
.tables-section,
.orders-section,
.kitchen-section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.tables-section h4,
.orders-section h4,
.kitchen-section h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 20px;
}

/* Tables Grid */
.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.table-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.table-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.table-card.status-available {
    border-color: #28a745;
    background: #f1f9f4;
}

.table-card.status-occupied {
    border-color: #dc3545;
    background: #fff5f5;
}

.table-card.status-reserved {
    border-color: #ffc107;
    background: #fffdf0;
}

.table-card.status-cleaning {
    border-color: #17a2b8;
    background: #f0f9fb;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.table-number {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

.table-status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: #6c757d;
    color: white;
}

.table-body {
    font-size: 14px;
}

.table-info,
.table-section,
.guest-info,
.time-info {
    margin-bottom: 8px;
    color: #495057;
}

.table-info i,
.table-section i,
.guest-info i,
.time-info i {
    margin-right: 8px;
    color: #6c757d;
}

/* Orders List */
.orders-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.order-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.order-card:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.2);
}

.order-card.status-new {
    border-left: 4px solid #17a2b8;
}

.order-card.status-inprogress {
    border-left: 4px solid #ffc107;
}

.order-card.status-ready {
    border-left: 4px solid #28a745;
}

.order-card.status-served {
    border-left: 4px solid #6c757d;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.order-number {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin-right: 10px;
}

.order-type-badge {
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    background: #6c757d;
    color: white;
}

.order-status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.order-info {
    margin-bottom: 8px;
    color: #495057;
}

.order-details {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: #6c757d;
}

.order-details i {
    margin-right: 5px;
}

/* Kitchen Grid */
.kitchen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.kitchen-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #dee2e6;
}

.kitchen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.kitchen-header h5 {
    margin: 0;
    font-size: 16px;
    color: #2c3e50;
}

.kitchen-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.stat-label {
    color: #6c757d;
}

.stat-value {
    font-weight: bold;
}

/* Restaurant Order Page */
.restaurant-order-page {
    padding: 20px;
}

.order-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.menu-panel,
.order-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
}

.panel-header {
    margin-bottom: 20px;
}

.panel-header h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
}

.category-filter,
.search-box {
    margin-bottom: 15px;
}

/* Menu Grid */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    max-height: 800px;
    overflow-y: auto;
}

.menu-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    transition: all 0.3s ease;
}

.menu-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.2);
}

.menu-item.unavailable {
    opacity: 0.5;
    cursor: not-allowed;
}

.menu-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 10px;
}

.menu-item-header h5 {
    margin: 0;
    font-size: 16px;
    color: #2c3e50;
}

.menu-item-header .price {
    font-size: 18px;
    font-weight: bold;
    color: #28a745;
}

.menu-item-description {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 10px;
}

.menu-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Order Form */
.order-form {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Order Items */
.order-items-section {
    margin: 20px 0;
    max-height: 400px;
    overflow-y: auto;
}

.order-items-section h5 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.no-items {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.no-items i {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.order-item {
    display: grid;
    grid-template-columns: 2fr 120px 80px 40px;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.item-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.item-name {
    font-weight: 600;
    color: #2c3e50;
}

.item-instructions {
    font-size: 12px;
    color: #6c757d;
}

.item-modifiers input {
    font-size: 12px;
}

.item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.quantity-display {
    font-weight: bold;
    font-size: 16px;
    min-width: 30px;
    text-align: center;
}

.item-price {
    text-align: right;
}

.item-price .total {
    font-weight: bold;
    color: #28a745;
}

/* Order Summary */
.order-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #dee2e6;
}

.summary-row.total {
    border-bottom: none;
    border-top: 2px solid #2c3e50;
    margin-top: 10px;
    padding-top: 15px;
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
}

.summary-row.discount {
    color: #dc3545;
}

/* Order Actions */
.order-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

/* Kitchen Display System */
.kitchen-display {
    padding: 20px;
}

.station-filter {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.kitchen-orders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.kitchen-ticket {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 3px solid #e0e0e0;
    transition: all 0.3s ease;
}

.kitchen-ticket.priority-urgent {
    border-color: #dc3545;
    animation: pulse 2s infinite;
}

.kitchen-ticket.priority-high {
    border-color: #ffc107;
}

.kitchen-ticket.status-new {
    background: #e7f3ff;
}

.kitchen-ticket.status-inprogress {
    background: #fff9e6;
}

.kitchen-ticket.status-ready {
    background: #e8f5e9;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    }
    50% {
        box-shadow: 0 8px 24px rgba(220, 53, 69, 0.6);
    }
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #dee2e6;
}

.ticket-info {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.ticket-number {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.bg-info {
    background: #17a2b8 !important;
}

.status-badge.bg-warning {
    background: #ffc107 !important;
}

.status-badge.bg-success {
    background: #28a745 !important;
}

.ticket-body {
    margin-bottom: 15px;
}

.order-info {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.info-item {
    font-size: 14px;
    color: #495057;
}

.ticket-time {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 14px;
}

.time-elapsed {
    font-weight: bold;
}

.time-elapsed.time-normal {
    color: #28a745;
}

.time-elapsed.time-warning {
    color: #ffc107;
}

.time-elapsed.time-critical {
    color: #dc3545;
}

.ticket-items {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.ticket-items h6 {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.ticket-item {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.ticket-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.item-quantity {
    font-weight: bold;
    color: #007bff;
    margin-right: 8px;
}

.item-name {
    color: #2c3e50;
}

.item-notes,
.item-modifiers {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
    padding-left: 20px;
}

.ticket-notes {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 15px;
}

.ticket-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kitchen-stats-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 15px 20px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-around;
    border-top: 2px solid #e0e0e0;
}

.kitchen-stats-footer .stat-item {
    display: flex;
    gap: 10px;
    align-items: center;
}

.kitchen-stats-footer .stat-label {
    font-weight: 600;
    color: #6c757d;
}

.kitchen-stats-footer .stat-value {
    font-size: 20px;
    font-weight: bold;
}

/* Menu Management */
.menu-management,
.table-management {
    padding: 20px;
}

.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.no-data i {
    font-size: 64px;
    margin-bottom: 20px;
    display: block;
    opacity: 0.5;
}

/* Table Management */
.view-toggle {
    display: flex;
    justify-content: flex-end;
}

.tables-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.table-card-manage {
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    border: 2px solid #e0e0e0;
}

.table-card-manage.status-available {
    border-color: #28a745;
}

.table-card-manage.status-occupied {
    border-color: #dc3545;
}

.table-card-manage.status-reserved {
    border-color: #ffc107;
}

.table-card-manage.status-cleaning {
    border-color: #17a2b8;
}

.table-card-manage .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.table-card-manage .card-header h4 {
    margin: 0;
    font-size: 24px;
    color: #2c3e50;
}

.table-card-manage .card-body {
    padding: 15px;
}

.table-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #495057;
}

.detail-item i {
    color: #6c757d;
}

.card-actions {
    padding: 15px;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

/* Modal Styles */
.modal.show {
    display: block;
    background: rgba(0,0,0,0.5);
}

.modal-backdrop.show {
    opacity: 0.5;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .order-container {
        grid-template-columns: 1fr;
    }
    
    .kitchen-orders-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .tables-grid {
        grid-template-columns: 1fr;
    }
    
    .menu-grid {
        grid-template-columns: 1fr;
    }
    
    .order-item {
        grid-template-columns: 1fr;
    }
    
    .kitchen-orders-grid {
        grid-template-columns: 1fr;
    }
    
    .kitchen-stats-footer {
        flex-direction: column;
        gap: 10px;
    }
}

/* Payment Page */
.payment-page {
    padding: 20px;
}

.payment-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.order-summary-panel,
.payment-form-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 25px;
}

.order-summary-panel h4,
.payment-form-panel h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 20px;
}

.summary-details .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.items-summary {
    margin: 20px 0;
}

.items-summary h5 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.item-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
}

.financial-summary {
    margin-top: 20px;
}

.financial-summary .summary-row.total {
    border-top: 2px solid #2c3e50;
    margin-top: 10px;
    padding-top: 15px;
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
}

.financial-summary .summary-row.tip {
    color: #28a745;
    font-weight: 600;
}

.form-section {
    margin-bottom: 25px;
}

.form-section .form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
    display: block;
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.payment-method-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
}

.payment-method-btn:hover {
    border-color: #007bff;
    background: #f0f7ff;
}

.payment-method-btn.active {
    border-color: #007bff;
    background: #007bff;
    color: white;
}

.payment-method-btn i {
    font-size: 24px;
}

.payment-method-btn span {
    font-size: 13px;
    font-weight: 600;
}

.tip-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.change-display {
    margin-top: 15px;
    padding: 15px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    text-align: center;
    color: #155724;
}

.change-display strong {
    font-size: 20px;
}

.payment-actions {
    margin-top: 30px;
}

/* Print Styles for Kitchen Tickets */
@media print {
    .kitchen-ticket {
        page-break-inside: avoid;
        box-shadow: none;
        border: 2px solid black;
    }
    
    .header-actions,
    .station-filter,
    .filter-section,
    .kitchen-stats-footer {
        display: none;
    }
}

@media (max-width: 992px) {
    .payment-container {
        grid-template-columns: 1fr;
    }
    
    .payment-methods {
        grid-template-columns: repeat(2, 1fr);
    }
}
