:root {
    /* Default values - akan diupdate oleh JavaScript */
    --item-width: 180px;
    --font-size: 120%;
    --line-spacing: 120%;
    --stack-height: 80%;
    /* Font size untuk menu (tidak terpengaruh slider) */
    --menu-font-size: 16px;
    /* Other variables */
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --new-color: #3498db;
    --cooking-color: #f9e79f;
    --done-color: #a9dfbf;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #333333;
    --border-color: #dee2e6;
    --item-gap: 10px;
    --card-padding: 15px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    height: 100vh;
}

.kds-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    background-color: #E2E2E2;
}

/* Menu Button */
.menu-button-container {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
}

.menu-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.menu-button:hover {
    background-color: var(--secondary-color);
    transform: scale(1.1);
}

/* Menu Sidebar */
.menu-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 300px;
    height: 100vh;
    background-color: var(--card-bg);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 999;
    transition: left 0.3s ease;
    overflow-y: auto;
    padding: 20px;
    font-size: var(--menu-font-size);
    /* Font size tetap untuk menu */
}

.menu-sidebar.active {
    left: 0;
}

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

.close-menu {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-color);
}

/* Table Filter */
.table-filter-container {
    display: flex;
    margin-bottom: 10px;
}

.table-filter-btn {
    flex: 1;
    background-color: var(--light-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 8px 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.table-filter-btn:hover {
    background-color: var(--border-color);
}

.clear-filter-btn {
    background: none;
    border: none;
    color: var(--danger-color);
    margin-left: 5px;
    cursor: pointer;
    padding: 0 5px;
}

.table-selector {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.table-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.table-item {
    padding: 10px;
    text-align: center;
    background-color: var(--light-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.table-item:hover {
    background-color: var(--border-color);
}

.table-item.selected {
    background-color: var(--secondary-color);
    color: white;
}

.table-selector-footer {
    text-align: right;
}

/* Stats */
.stats-container {
    display: flex;
    justify-content: space-between;
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-color);
}

/* Report Modal */
.report-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1002;
    display: flex;
    flex-direction: column;
}

.report-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-report {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.report-content {
    flex: 1;
    padding: 0;
}

.report-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Main KDS Display */
.kds-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

/* Status Indicators */
.status-indicators {
    display: flex;
    flex: 1;
    margin-left: 75px;
}

.status-indicator {
    display: flex;
    align-items: center;
    margin-right: 3px;
    padding: 5px 10px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #C3C3C3;
    background-color: ;
}

.status-indicator:hover {
    background-color: var(--light-color);
}

.status-indicator.active {
    background-color: var(--secondary-color);
    color: white;
}

.status-indicator.active .status-count {
    background-color: rgba(255, 255, 255, 0.3);
}

.status-color {
    width: 19px;
    height: 21px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-indicator.new .status-color {
    background-color: var(--new-color);
}

.status-indicator.cooking .status-color {
    background-color: var(--cooking-color);
}

.status-indicator.done .status-color {
    background-color: var(--done-color);
}

.status-label {
    font-size: 0.9rem;
    margin-right: 5px;
}

.status-count {
    font-size: 0.8rem;
    background-color: var(--light-color);
    border-radius: 10px;
    padding: 2px 6px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 10px;
    width: 60%;
    justify-content: flex-end;
    /*+placement: ;*/
    position: relative;
    left: 0;
    top: 0;
    margin-right: 439px;
}

div.order-card-timer span {
    /*+placement: 3px -1px;*/
    position: relative;
    left: 3px;
    top: -1px;
    font-size: ;
}

.action-btn {
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
}

.action-btn.undo {
    background-color: var(--secondary-color);
    color: white;
}

.action-btn.undo:hover:not(:disabled) {
    background-color: #2980B9;
}

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

.action-btn.redo:hover:not(:disabled) {
    background-color: #229954;
}

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

.action-btn i {
    margin-right: 5px;
}

/* Orders Container */
.orders-container {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 15px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-color);
}

/* Order Card Component */
.orders-scroll {
    display: flex;
    height: 100%;
    /* Hapus flex-direction: row-reverse agar order baru muncul di kanan */
}

.order-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    margin-left: 15px;
    /* Changed from margin-right to margin-left */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100%;
    max-height: calc(100vh - 120px);
}

.order-card-header {
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 53px;
}

.order-card-info {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.order-card-table {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 5px;
}

.order-card-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.order-card-time {
    font-size: 0.9rem;
    opacity: 0.8;
}

.order-card-waiter {
    font-size: 0.9rem;
    opacity: 0.8;
}

.order-card-timer {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
}

.order-card-timer i {
    margin-right: 5px;
    font-size: 0.8rem;
}

.order-card-id {
    font-size: 1.6rem;
    opacity: 0.7;
    display: none;
}

.order-card-items {
    flex: 1;
    overflow: hidden;
    padding: var(--card-padding);
}

/* Multi-column layout for items */
.order-items-columns {
    display: flex;
    height: 100%;
    gap: var(--item-gap);
}

.order-column {
    flex: 0 0 var(--item-width);
    display: flex;
    flex-direction: column;
    gap: var(--item-gap);
}

.order-item {
    background-color: var(--light-color);
    border-radius: 6px;
    padding: 4px 10px 9px;
    flex-shrink: 0;
    transition: all 0.2s;
    cursor: pointer;
    min-height: 43px;
    display: flex;
    flex-direction: column;
    /* Font size akan diatur oleh JavaScript */
}

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

.order-item.cooking {
    background-color: var(--cooking-color);
    padding-bottom: 0px;
}

.order-item.done {
    background-color: var(--done-color);
}

/* Apply font size and line spacing */
.item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 9px;
    font-weight: normal;
    height: 34px;
    width: 100%;
    line-height: 1.1;
}

.item-name {
    font-weight: 700;
    line-height: 1;
    padding-top: 17px;
    margin-bottom: 3px;
    padding-bottom: 5px;
    /* Font size akan diatur oleh JavaScript */
}

.item-quantity {
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 0px;
    padding: 2px 6px;
    font-weight: 600;
    /* Font size akan diatur oleh JavaScript */
    /* Always align to right */
    margin-left: auto;
}

.item-details {
    line-height: calc(1.4 * var(--line-spacing) / 100);
    /* Font size akan diatur oleh JavaScript */
}

.item-toppings {
    margin-bottom: 5px;
    margin-right: 0;
}

.topping-item {
    margin-bottom: 3px;
    color: var(--dark-color);
    display: flex;
    align-items: flex-start;
    font-weight: 400;
    position: relative;
    left: -3px;
    top: 4px;
    /* Font size akan diatur oleh JavaScript */
}

.topping-quantity {
    margin-left: auto;
    /* Font size akan diatur oleh JavaScript */
}

span {
    position: relative;
    left: 6px;
    top: 4px;
}

.topping-item i {
    margin-right: 4px;
    margin-top: 5px;
    position: relative;
    left: 1px;
    top: -7px;
    /* Font size akan diatur oleh JavaScript */
}

.item-note {
    font-style: italic;
    color: var(--dark-color);
    display: flex;
    align-items: flex-start;
    /* Font size akan diatur oleh JavaScript */
}

.item-note i {
    margin-right: 4px;
    margin-top: 2px;
    /* Font size akan diatur oleh JavaScript */
}

.item-status {
    display: none;
    align-items: center;
    margin-top: 5px;
    line-height: calc(1.2 * var(--line-spacing) / 100);
    /* Font size akan diatur oleh JavaScript */
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
}

.status-dot.new {
    background-color: var(--new-color);
}

.status-dot.cooking {
    background-color: var(--warning-color);
}

.status-dot.done {
    background-color: var(--success-color);
}

/* Order Card Footer */
.order-card-footer {
    padding: 10px;
    display: flex;
    gap: 10px;
    background-color: var(--light-color);
}

.order-card-btn {
    flex: 1;
    padding: 8px;
    border-radius: 4px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.order-card-btn.start {
    background-color: var(--warning-color);
    color: white;
    font-size: 23px;
}

.order-card-btn.start:hover {
    background-color: #E67E22;
}

.order-card-btn.start.active {
    background-color: var(--secondary-color);
}

.order-card-btn.done {
    background-color: var(--success-color);
    color: white;
}

.order-card-btn.done:hover {
    background-color: #229954;
}

.order-card-btn.done.active {
    background-color: var(--primary-color);
}

.order-card-btn i {
    margin-right: 5px;
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1001;
    max-width: 300px;
}

.notification {
    background-color: var(--card-bg);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    cursor: pointer;
    animation: slideIn 0.3s ease-out;
}

.notification.success {
    border-left: 4px solid var(--success-color);
}

.notification.warning {
    border-left: 4px solid var(--warning-color);
}

.notification.error {
    border-left: 4px solid var(--danger-color);
}

.notification.info {
    border-left: 4px solid var(--secondary-color);
}

.notification-icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

.notification.success .notification-icon {
    color: var(--success-color);
}

.notification.warning .notification-icon {
    color: var(--warning-color);
}

.notification.error .notification-icon {
    color: var(--danger-color);
}

.notification.info .notification-icon {
    color: var(--secondary-color);
}

.notification-message {
    flex: 1;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .table-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .status-indicators {
        overflow-x: auto;
        padding-bottom: 5px;
    }
    
    .action-buttons {
        width: 40%;
    }
}
