/* Kitchen Display System (KDS) Styles - Consolidated */

/* Base Body Styling */
body {
    background-color: #f5f5f5;
    color: #333333;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    height: 120vh;
}

/* KDS Container */
.kds-container {
    min-height: 120vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

/* Header Styling */
.kds-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    padding: 12px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 0;
    border: none;
}

/* Responsive Header Layout */
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    max-width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    min-width: 0;
}

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

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.header-logo {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    flex-shrink: 0;
}

.header-logo i {
    margin-right: 8px;
}

.current-time-display {
    background: rgba(255,255,255,0.1);
    padding: 6px 12px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.header-buttons .btn {
    padding: 6px 12px;
    font-size: 0.875rem;
    white-space: nowrap;
}

.refresh-indicator {
    background: rgba(255,255,255,0.9);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #333;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Station Tab Styling */
.station-tab {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #ffffff;
    padding: 15px 25px;
    margin: 0 5px;
    border-radius: 10px 10px 0 0;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 16px;
}

.station-tab.active {
    background: rgba(255,255,255,0.2);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Professional Multi-Column Layout with Order Splitting - NO SCROLLING */
.orders-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
    max-width: 100%;
    /* Height will be set dynamically by JavaScript */
    
    align-content: flex-start;
}

.orders-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 360px;
    max-width: 360px;
    flex: 1;
    /* Height will be set dynamically by JavaScript */
   
}

/* Professional Order Card Styling - COMPACT FOR NO SCROLLING */
.order-card {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    margin-bottom: 0;
    transition: all 0.3s ease;
    backdrop-filter: none;
    position: relative;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
    min-height: auto;
    width: 100%;
    max-width: 360px;
    margin: 0 auto 10px 0;
    display: flex;
    flex-direction: column;
    cursor: default;
    break-inside: avoid;
    page-break-inside: avoid;
}

.order-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

/* Order Card Status Styling */
.order-card.new {
    border-left: 5px solid #28a745;
}

.order-card.preparing {
    border-left: 5px solid #17a2b8;
}

.order-card.ready {
    border-left: 5px solid #ffc107;
}

.order-card.served {
    border-left: 5px solid #6c757d;
}

.order-card.urgent {
    border-left: 5px solid #dc3545;
    animation: pulse 2s infinite;
}

.order-card.rush {
    border-left: 5px solid #dc3545;
    animation: blink 1s infinite;
}

.order-card.order-ready {
    background: rgba(40, 167, 69, 0.1) !important;
    border-color: #28a745 !important;
    transform: scale(1.02);
    transition: all 0.3s ease;
}

/* Cancelled Order Styling */
.order-card.cancelled {
    background: rgba(220, 53, 69, 0.1);
    border: 2px solid #dc3545;
    position: relative;
}

.order-card.cancelled::before {
    content: "CANCELLED";
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #dc3545;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    z-index: 10;
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.order-card.cancelled .order-header {
    background: #dc3545 !important;
    color: white !important;
}

.order-card.cancelled .items-list {
    opacity: 0.7;
}

.order-card.cancelled .item-name {
    text-decoration: line-through;
    color: #dc3545;
}

/* Visual indicators for multi-line orders */
.order-card::before {
    content: '';
    position: absolute;
    left: -2px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #007bff 0%, #0056b3 100%);
    border-radius: 2px;
    z-index: 1;
}

.order-card.urgent::before {
    background: linear-gradient(180deg, #dc3545 0%, #c82333 100%);
}

.order-card.rush::before {
    background: linear-gradient(180deg, #ffc107 0%, #e0a800 100%);
    animation: pulse-border 1s infinite;
}

.order-card.new::before {
    background: linear-gradient(180deg, #28a745 0%, #1e7e34 100%);
}

.order-card.preparing::before {
    background: linear-gradient(180deg, #17a2b8 0%, #138496 100%);
}

.order-card.ready::before {
    background: linear-gradient(180deg, #ffc107 0%, #e0a800 100%);
}

/* Continuation indicator for orders that might span */
.order-card::after {
    content: '↴';
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: 16px;
    color: #6c757d;
    opacity: 0.6;
    z-index: 2;
    transition: all 0.3s ease;
}

.order-card:hover::after {
    opacity: 1;
    color: #007bff;
    transform: translateY(2px);
}

/* Professional Header Styling - COMPACT */
.order-header {
    background: #f8f9fa; /* Light blue/gray default color */
    padding: 8px 12px;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #dee2e6;
    color: #333;
    transition: all 0.3s ease;
}

/* Timer-based header colors - Simplified system */
/* Remove green and yellow colors - only use red when time is over */
.order-header.timer-normal {
    /* Keep default light blue/gray color - no change needed */
    background: #f8f9fa;
    color: #333;
    border-bottom-color: #dee2e6;
}

.order-header.timer-warning {
    /* Keep default light blue/gray color - no change needed */
    background: #f8f9fa;
    color: #333;
    border-bottom-color: #dee2e6;
}

.order-header.timer-danger {
    background: #dc3545; /* Red only when time is over */
    color: #ffffff; /* White text for prominence */
    border-bottom-color: #c82333;
}

.order-header.timer-critical {
    background: #dc3545; /* Red only when time is over */
    color: #ffffff; /* White text for prominence */
    border-bottom-color: #c82333;
}

.order-number {
    font-size: 16px;
    font-weight: 600;
    color: #666;
    margin-top: 5px;
}

.table-floor-info {
    font-size: 18px;
    font-weight: bold;
    color: inherit;
    margin-bottom: 3px;
}

.table-floor-info .table-name {
    color: inherit; /* Inherits from parent timer color for prominence */
    font-weight: 800;
}

.table-floor-info .floor-name {
    color: inherit; /* Inherits from parent timer color for prominence */
    font-weight: 600;
}

.order-time {
    font-size: 12px;
    font-weight: bold;
    padding: 3px 6px;
    border-radius: 4px;
    text-align: center;
    min-width: 60px;
    transition: all 0.3s ease;
    margin-top: 5px;
}

.order-time.normal {
    background: transparent; /* No background for countdown timer */
    color: #000000; /* Black text for better visibility */
}

.order-time.warning {
    background: transparent; /* No background for countdown timer */
    color: #000000; /* Black text for better visibility */
}

.order-time.danger {
    background: #dc3545; /* Red only when time is over */
    color: #ffffff; /* White text for prominence */
}

.order-time.critical {
    background: #dc3545; /* Red only when time is over */
    color: #ffffff; /* White text for prominence */
}

/* Professional Body Styling - COMPACT */
.order-body {
    padding: 8px 12px;
    flex-grow: 1;
    color: #333;
}

.item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: nowrap;
    gap: 8px;
}

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

.item-row .d-flex {
    flex: 1;
    min-width: 0;
    flex-wrap: nowrap;
}

.item-quantity {
    background: #007bff;
    color: white;
    padding: 1px 4px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.item-name {
    font-size: 22px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    max-width: 200px;
    flex: 1;
}

/* Item template styling */
.item-template {
    font-size: 13px !important;
    color: #28a745 !important; /* Green for template */
    font-weight: 700 !important; /* Bold for prominence */
    line-height: 1.3;
    margin-top: 4px !important;
    background: rgba(40, 167, 69, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
}

/* Item modifiers styling - Enhanced for better visibility */
.item-modifiers {
    font-size: 13px !important;
    color: #000000 !important; /* Black text for maximum contrast */
    font-weight: 700 !important; /* Bold for prominence */
    line-height: 1.3;
    margin-top: 4px !important;
    padding: 4px 8px !important;
    background: linear-gradient(135deg, #ffc107 0%, #ff8c00 100%) !important; /* Bright golden background */
    border-radius: 6px !important;
    border: 1px solid #ffa500 !important;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3) !important;
    font-style: normal !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    display: inline-block !important;
    margin-right: 8px !important;
}

/* Item remarks styling - Enhanced for better visibility */
.item-remarks {
    font-size: 13px !important;
    color: #000000 !important; /* Black text for maximum contrast */
    font-weight: 600 !important; /* Bold for prominence */
    line-height: 1.3;
    margin-top: 4px !important;
    padding: 4px 8px !important;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%) !important; /* Light gray background */
    border-radius: 6px !important;
    border: 1px solid #adb5bd !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    font-style: normal !important;
    display: inline-block !important;
    margin-right: 8px !important;
}

.item-status {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.item-status.pending {
    background: #6c757d;
    color: white;
}

.item-status.preparing {
    background: #17a2b8;
    color: white;
}

.item-status.ready {
    background: #28a745;
    color: white;
}

.item-status.served {
    background: #6c757d;
    color: white;
}

/* Professional Info Styling */
.table-info {
    background: #e9ecef;
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 10px;
    margin-left: 8px;
    color: #495057;
}

.order-type-badge {
    background: #007bff;
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 20px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 8px;
    color: white;
    letter-spacing: 0.5px;
}

.order-type-badge.dine-in {
    background: #28a745;
}

.order-type-badge.take_away {
    background: #17a2b8;
}

.order-type-badge.delivery {
    background: #6f42c1;
}

/* Professional Priority Indicators */
.priority-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.priority-indicator.normal { background: #28a745; }
.priority-indicator.urgent { background: #ffc107; }
.priority-indicator.rush { 
    background: #dc3545; 
    animation: blink 1s infinite;
}

/* Professional Customer Info */
.customer-name {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.priority-info {
    font-size: 10px;
    color: #666;
    margin-top: 2px;
}

/* Professional Ready Button Container - COMPACT */
.order-actions-container {
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
    border-top: 1px solid #dee2e6;
}

/* Ready button styling */
.ready-button {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.ready-button:hover {
    background: linear-gradient(135deg, #218838 0%, #1ea085 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.4);
}

.ready-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.ready-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.order-actions {
    padding: 10px 15px;
    background: rgba(0,0,0,0.2);
    border-radius: 0 0 13px 13px;
}

.btn-kds {
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    margin: 0 5px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-kds:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.btn-start {
    background: #17a2b8;
    color: white;
}

.btn-ready {
    background: #28a745;
    color: white;
}

.btn-complete {
    background: #6c757d;
    color: white;
}

.btn-urgent {
    background: #dc3545;
    color: white;
}

.order-timer {
    background: rgba(0,0,0,0.3);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    margin-left: 10px;
}

.timer-warning { color: #ffc107; }
.timer-danger { color: #dc3545; }

.no-orders {
    text-align: center;
    padding: 100px 20px;
    color: #666666;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
}

.no-orders i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
    color: #999999;
}

.connection-status {
    position: fixed;
    top: 60px;
    right: 20px;
    background: #ffffff;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 11px;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
    color: #333;
}

/* Professional Running Order Badge */
.running-order-badge {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(45deg, #dc3545, #ff6b6b);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
    z-index: 10;
    animation: pulse-running 2s infinite;
}

/* Professional Post-Service Order Badge */
.post-service-order-badge {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(45deg, #6f42c1, #9d5ade);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(111, 66, 193, 0.3);
    z-index: 10;
    animation: pulse-post-service 2s infinite;
}

.running-order-item-label {
    background: linear-gradient(135deg, #ffc107 0%, #ff8c00 100%);
    color: #000;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-left: 6px;
    box-shadow: 0 1px 2px rgba(255, 193, 7, 0.3);
    animation: pulse-running 2s infinite;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Professional curved continuation indicators for split orders */
.order-continuation {
    position: relative;
    margin: 8px 0;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.order-continuation.continued {
    background: none;
    border: none;
    box-shadow: none;
}

.order-continuation.continued::before {
    content: "";
    position: absolute;
    bottom: -10px;
    right: 15px;
    width: 30px;
    height: 30px;
    border: 3px solid #28a745;
    border-top: none;
    border-left: none;
    border-radius: 0 0 30px 0;
    transform: rotate(45deg);
}

.order-continuation.continued::after {
    content: "";
    position: absolute;
    bottom: -5px;
    right: 25px;
    width: 8px;
    height: 8px;
    background: #28a745;
    border-radius: 50%;
}

.order-continuation.continuing {
    background: none;
    border: none;
    box-shadow: none;
}

.order-continuation.continuing::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 15px;
    width: 30px;
    height: 30px;
    border: 3px solid #ffc107;
    border-bottom: none;
    border-right: none;
    border-radius: 30px 0 0 30px;
    transform: rotate(45deg);
}

.order-continuation.continuing::after {
    content: "";
    position: absolute;
    top: -5px;
    left: 25px;
    width: 8px;
    height: 8px;
    background: #ffc107;
    border-radius: 50%;
}

/* Split order styling */
.order-card.split-order {
    border-left: 4px solid #007bff;
}

.order-card.split-order.continued {
    border-left: 4px solid #28a745;
}

.order-card.split-order.continuing {
    border-left: 4px solid #ffc107;
}

/* Professional Station Selector */
.station-selector {
    background: #ffffff;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
}

.station-selector label {
    color: #333 !important;
    font-weight: 600;
}

.station-dropdown {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    color: #333;
    font-weight: 500;
    padding: 8px 12px;
    transition: all 0.3s ease;
}

.station-dropdown:focus {
    background: white;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    outline: none;
}

/* Header Station Selector */
.station-selector-header {
    display: inline-block;
}

.station-selector-header label {
    color: #ffffff !important;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 0;
}

.station-dropdown-header {
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    color: #333;
    font-weight: 500;
    padding: 4px 8px;
    font-size: 13px;
    min-width: 150px;
    transition: all 0.3s ease;
}

.station-dropdown-header:focus {
    background: white;
    border-color: rgba(255,255,255,0.8);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.2);
    outline: none;
}

.station-dropdown-header:hover {
    background: white;
    border-color: rgba(255,255,255,0.5);
}

#refresh-orders {
    background: #007bff;
    border: 2px solid #007bff;
    border-radius: 8px;
    color: white;
    padding: 8px 12px;
    transition: all 0.3s ease;
}

#refresh-orders:hover {
    background: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
}

#refresh-orders:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Station management styles */
.station-management {
    background: rgba(255,255,255,0.05);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
}

.station-item {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 15px;
    margin: 10px 0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.station-item:hover {
    background: rgba(255,255,255,0.15);
    transform: translateX(5px);
}

.station-item.active {
    background: rgba(255,255,255,0.2);
    border-left: 4px solid #28a745;
}

/* Item customization */
.item-customization {
    background: rgba(108, 117, 125, 0.2);
    border: 1px solid rgba(108, 117, 125, 0.5);
    border-radius: 6px;
    padding: 8px;
    margin: 5px 0;
    font-size: 12px;
    color: #6c757d;
}

/* Kitchen staff info */
.staff-info {
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 12px;
    color: #cccccc;
    margin-top: 10px;
}

/* Order completion progress */
.order-progress {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 10px;
    margin: 10px 0;
}

.progress-bar {
    background: rgba(255,255,255,0.2);
    border-radius: 5px;
    height: 8px;
    
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    transition: width 0.3s ease;
}

/* Animations */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

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

@keyframes pulse-border {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

@keyframes pulse-post-service {
    0% { 
        opacity: 1; 
        box-shadow: 0 2px 4px rgba(111, 66, 193, 0.3);
    }
    50% { 
        opacity: 0.8; 
        box-shadow: 0 4px 8px rgba(111, 66, 193, 0.5);
    }
    100% { 
        opacity: 1; 
        box-shadow: 0 2px 4px rgba(111, 66, 193, 0.3);
    }
}

@keyframes pulse-running {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Responsive Header Breakpoints */
@media (max-width: 1200px) {
    .header-container {
        gap: 12px;
    }
    
    .header-left {
        gap: 15px;
    }
    
    .header-center {
        gap: 12px;
    }
    
    .header-right {
        gap: 8px;
    }
    
    .header-logo {
        font-size: 1.1rem;
    }
    
    .header-buttons .btn {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    
    .orders-grid {
        max-width: 95%;
        margin: 0 auto;
    }
    
    .orders-column {
        min-width: 360px;
        max-width: 360px;
    }
    
    .order-number {
        font-size: 20px;
    }
    
    .item-name {
        font-size: 24px;
    }
}

@media (max-width: 992px) {
    .header-container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .header-left {
        justify-content: space-between;
        gap: 10px;
    }
    
    .header-center {
        justify-content: center;
        gap: 15px;
    }
    
    .header-right {
        justify-content: center;
        gap: 10px;
    }
    
    .station-selector-header {
        min-width: 200px;
    }
    
    .station-dropdown-header {
        min-width: 180px;
    }
    
    .orders-grid {
        max-width: 100%;
        margin: 0 auto;
    }
    
    .orders-column {
        min-width: 340px;
        max-width: 340px;
    }
}

@media (max-width: 768px) {
    .kds-header {
        padding: 10px 15px;
    }
    
    .header-left {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .header-center {
        flex-direction: column;
        gap: 8px;
    }
    
    .header-right {
        flex-direction: column;
        gap: 8px;
    }
    
    .header-buttons {
        flex-direction: column;
        width: 100%;
        gap: 5px;
    }
    
    .header-buttons .btn {
        width: 100%;
        padding: 8px 12px;
    }
    
    .refresh-indicator {
        order: -1;
        align-self: center;
    }
    
    .station-selector-header {
        width: 100%;
        min-width: auto;
    }
    
    .station-dropdown-header {
        width: 100%;
        min-width: auto;
    }
    
    .orders-grid {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 10px;
        padding: 10px;
        
        max-width: 100%;
        margin: 0 auto;
    }
    
    .orders-column {
        min-width: 100%;
        max-width: 100%;
        height: auto;
        min-width: 300px;
        max-width: 300px;
    }
   
    .order-card {
        width: 100%;
        max-width: 100%;
        margin-bottom: 8px;
    }
   
    .item-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
   
    .item-row .d-flex {
        width: 100%;
        justify-content: flex-start;
    }
   
    .item-name {
        max-width: 100%;
        white-space: normal;
    }
   
    .ready-button {
        padding: 10px 16px;
        font-size: 14px;
    }
   
    .order-actions-container {
        padding: 12px;
    }
    
    .station-tab {
        padding: 8px 12px;
        font-size: 12px;
        margin: 0 1px;
    }
    
    .order-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .order-number {
        font-size: 16px;
    }
    
    .order-body {
        padding: 10px;
    }
    
    /* Small screen styling for modifiers and remarks */
    .item-modifiers {
        font-size: 11px !important;
        padding: 2px 4px !important;
        margin-top: 2px !important;
        margin-right: 4px !important;
    }
    
    .item-remarks {
        font-size: 12px !important;
        padding: 4px 6px !important;
        margin-top: 4px !important;
        margin-right: 4px !important;
        letter-spacing: 0.2px !important;
    }
    
    .btn-kds {
        padding: 6px 12px;
        font-size: 11px;
        flex: 1;
        min-width: 80px;
    }
}

@media (max-width: 576px) {
    .kds-header {
        padding: 8px 10px;
    }
    
    .header-logo {
        font-size: 1rem;
    }
    
    .current-time-display {
        font-size: 0.875rem;
        padding: 4px 8px;
    }
    
    .refresh-indicator {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
    
    .ready-button {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .order-actions-container {
        padding: 10px;
    }
    
    .orders-grid {
        max-width: 95%;
    }
}

/* Print styles for KDS */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .kds-header,
    .station-tab,
    .status-indicator,
    .refresh-indicator,
    .order-actions {
        display: none;
    }
    
    .order-card {
        background: white;
        border: 1px solid #ccc;
        margin-bottom: 20px;
        page-break-inside: avoid;
    }
    
    .order-header {
        background: #f8f9fa;
        color: black;
    }
    
    .order-body {
        color: black;
    }
    
    .item-row {
        border-bottom: 1px solid #eee;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .order-card,
    .station-tab,
    .btn-kds,
    .priority-indicator.rush {
        animation: none;
        transition: none;
    }
    
    .order-card:hover {
        transform: none;
    }
    
    .btn-kds:hover {
        transform: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .order-card {
        border-width: 3px;
    }
    
    .order-header {
        border-bottom-width: 2px;
    }
    
    .item-modifiers {
        border-width: 2px !important;
    }
}