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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    overflow: hidden;
    position: relative;
    width: 100%;
    padding: 0;
    margin: 0;
}

.screen {
    position: fixed;
    width: 100%;
    height: 100vh;
    display: none;
    flex-direction: column;
    top: 0;
    left: 0;
    overflow: hidden;
}

.screen.active {
    display: flex;
}

.screen:not(.hidden) {
    display: flex;
}

.hidden {
    display: none !important;
}

/* Setup Screen */
.setup-container {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    margin: auto;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.setup-container h1 {
    color: #333;
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
}

.setup-step {
    display: flex;
    flex-direction: column;
    gap: 15px;
    animation: slideIn 0.3s ease;
}

.setup-step label {
    color: #666;
    font-size: 18px;
    font-weight: 500;
}

.setup-step input,
.setup-step select {
    padding: 15px;
    font-size: 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    transition: border-color 0.3s;
}

.setup-step input:focus,
.setup-step select:focus {
    outline: none;
    border-color: #667eea;
}

.setup-step button {
    padding: 15px;
    font-size: 18px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, background 0.3s;
}

.setup-step button:active {
    transform: scale(0.98);
}

/* Kassa Screen */
#kassaScreen {
    background: #f5f5f7;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 8px 12px;
    padding-top: calc(8px + env(safe-area-inset-top));
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

header h2 {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    padding: 0 8px;
}

.reset-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.reset-btn:active {
    transform: scale(0.95);
    background: rgba(255,255,255,0.3);
}

.mobile-counters {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    padding: 6px 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 20px;
}

.desktop-counters {
    display: none;
    background: white;
    padding: 15px 20px;
    justify-content: space-around;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.desktop-counters .counter {
    text-align: center;
}

.desktop-counters .counter-label {
    color: #666;
    font-size: 14px;
    text-transform: none;
    margin-bottom: 5px;
    display: block;
}

.desktop-counters .counter-value {
    color: #333;
    font-size: 28px;
    font-weight: bold;
    display: block;
}

.mobile-counters .counter {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 8px;
}

.counter-divider {
    color: rgba(255,255,255,0.5);
    font-size: 16px;
    padding: 0 2px;
}

.mobile-counters .counter-label {
    color: rgba(255,255,255,0.9);
    font-size: 10px;
    text-transform: lowercase;
    margin-top: -2px;
}

.mobile-counters .counter-value {
    color: white;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
}

.main-display {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.total-display {
    font-size: 48px;
    font-weight: bold;
    color: #333;
    margin: 10px 0 5px 0;
}

.price-info {
    font-size: 12px;
    color: #999;
    margin-bottom: 15px;
    text-transform: lowercase;
}

.input-container {
    position: relative;
    width: 100%;
    max-width: 300px;
    margin: 15px 0;
}

#aantalInput {
    width: 100%;
    padding: 15px;
    font-size: 28px;
    text-align: center;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: white;
    -webkit-appearance: none;
}

#aantalInput:focus {
    outline: none;
    border-color: #667eea;
}

.input-label {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 18px;
}

.payment-buttons {
    display: flex;
    gap: 10px;
    padding: 0 15px;
    margin: 15px 0;
    width: 100%;
    max-width: 350px;
}

.payment-btn {
    flex: 1;
    padding: 15px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.3s;
    color: white;
}

.cash-btn {
    background: #34c759;
}

.payconiq-btn {
    background: #007aff;
}

.payment-btn:active {
    transform: scale(0.98);
}

.payment-btn:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

/* Dialog */
.dialog {
    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;
}

.dialog-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 350px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.dialog-content h3 {
    margin-bottom: 15px;
    color: #333;
}

.dialog-content p {
    color: #666;
    margin-bottom: 15px;
}

.dialog-content input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 20px;
}

.dialog-buttons {
    display: flex;
    gap: 10px;
}

.dialog-buttons button {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.dialog-buttons button:first-child {
    background: #ff3b30;
    color: white;
}

.dialog-buttons button:last-child {
    background: #e0e0e0;
    color: #333;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Remove number input spinners */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Landscape orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .total-display {
        font-size: 36px;
        margin: 5px 0;
    }
    
    .main-display {
        padding: 5px;
    }
    
    .payment-buttons {
        margin: 5px 0;
    }
    
    .payment-btn {
        padding: 12px;
        font-size: 14px;
    }
    
    #aantalInput {
        padding: 12px;
        font-size: 24px;
    }
    
    .input-container {
        margin-top: 5px;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .total-display {
        font-size: 40px;
    }
    
    .payment-buttons {
        max-width: 100%;
        padding: 0 10px;
    }
    
    .input-container {
        max-width: 100%;
        padding: 0 10px;
    }
}

/* Tablet and desktop */
@media (min-width: 768px) {
    .mobile-counters {
        display: none;
    }
    
    .desktop-counters {
        display: flex;
    }
    
    .setup-container {
        max-width: 500px;
    }
    
    .total-display {
        font-size: 56px;
    }
    
    header h2 {
        font-size: 20px;
    }
    
    .input-container {
        max-width: 400px;
    }
    
    .payment-buttons {
        max-width: 450px;
    }
}