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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f5f5f5;
    color: #333;
    padding: 10px;
    -webkit-tap-highlight-color: transparent;
}

.container {
    max-width: 600px;
    margin: 24px auto;
    background: white;
    border-radius: 18px;
    box-shadow: 0 18px 44px rgba(20, 28, 51, 0.12), 0 2px 8px rgba(20, 28, 51, 0.06);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #2a2626 0%, #454040 55%, #b83838 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* #menu-placeholder wird von /static/common/menu.css definiert */

header h1 {
    font-size: 24px;
    font-weight: 600;
}

.back-link {
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
}

.header-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.btn-switch-user {
    background: none;
    color: rgba(255, 255, 255, 0.55);
    border: none;
    border-radius: 0;
    padding: 0;
    font-size: 11px;
    font-weight: 400;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    text-decoration: underline;
    text-underline-offset: 2px;
    opacity: 0.85;
}

.btn-switch-user:hover {
    color: rgba(255, 255, 255, 0.85);
    background: none;
    opacity: 1;
}

.btn-switch-user:active {
    transform: none;
}

.status-badge {
    background: rgba(255, 255, 255, 0.25);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.picklist-info {
    padding: 15px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
}

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

.info-item .label {
    font-weight: 600;
    color: #666;
}

.scan-section {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

#scan-input {
    width: 100%;
    padding: 15px;
    font-size: 18px;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin-bottom: 10px;
    text-align: center;
}

#scan-input:focus {
    outline: none;
    border-color: #c84040;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-primary, .btn-secondary {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background-color 0.2s, opacity 0.2s;
}

.btn-primary {
    background: #c84040;
    color: white;
}

.btn-primary:active {
    background: #ad3333;
    opacity: 0.9;
    /* transform entfernt um Browser-Fenster-Verschiebung zu vermeiden */
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:active {
    background: #d0d0d0;
    opacity: 0.9;
    /* transform entfernt um Browser-Fenster-Verschiebung zu vermeiden */
}

#camera-container {
    margin-top: 15px;
    margin-bottom: 15px;
    border: 2px solid #c84040;
    border-radius: 8px;
    padding: 15px;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#camera-container video, 
#camera-container canvas,
#barcode-detector-video,
#quagga-container video,
#quagga-container canvas,
#camera-container #html5qr-code-full-region video,
#camera-container #html5qr-code-full-region canvas {
    width: 100% !important;
    height: auto !important;
    max-width: 500px;
    border-radius: 8px;
    margin: 0 auto;
    object-fit: contain;
    box-shadow: none;
}

#camera-container #html5qr-code-full-region {
    width: 100% !important;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 8px;
    background: transparent !important;
    box-shadow: none !important;
}

#quagga-container {
    width: 100% !important;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 8px;
    background: transparent !important;
    box-shadow: none !important;
    position: relative;
    overflow: hidden;
}

#quagga-container .drawingBuffer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

#stop-camera-btn {
    width: 100%;
    margin-top: 15px;
    margin-bottom: 0;
}

/* Ensure no specific ID selector overrides the class for the stop button */
#camera-container #stop-camera-btn {
    margin: 15px 0 0 0;
    background: #e0e0e0; /* Reset to secondary button style if needed, but class handles it */
    color: #333;
    box-shadow: none;
    position: static;
}

#camera-container #stop-camera-btn:hover {
    background: #d0d0d0;
}

.scan-feedback {
    padding: 15px 20px;
    margin: 0 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    display: none;
}

.scan-feedback.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.scan-feedback.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.items-section {
    padding: 20px;
}

.items-section h2 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.item-card {
    background: white;
    border: 2px solid #eee;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
    position: relative;
}

.item-card.open {
    border-color: #ffc107;
    background: #fffbf0;
}

.item-card.picked {
    border-color: #28a745;
    background: #f0f9f4;
}

.item-card.blacklisted {
    border-color: #dc3545 !important;
    background: #f8d7da !important;
}

.item-blacklist-badge {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 10px;
    background: #dc3545;
    color: #fff;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
}

.item-card.clickable {
    cursor: pointer;
    user-select: none;
}

.item-card.clickable:hover {
    border-color: #c84040;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    /* transform entfernt um Browser-Fenster-Verschiebung zu vermeiden */
}

.item-card.clickable:active {
    border-color: #28a745 !important;
    border-width: 3px !important;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.3);
    /* Grüner Rand beim Klicken statt Verschiebung */
}

.click-hint {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 12px;
    color: #c84040;
    opacity: 0.7;
}

.item-card h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: #333;
}

.item-info {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.item-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #c84040;
    transition: width 0.3s;
}

.progress-text {
    font-size: 14px;
    font-weight: 600;
    color: #c84040;
    min-width: 60px;
    text-align: right;
}

.picklist-card {
    background: white;
    border: 2px solid #eee;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: border-color 0.2s, opacity 0.2s;
}

.picklist-card:active {
    opacity: 0.9;
    border-color: #c84040;
    /* transform entfernt um Browser-Fenster-Verschiebung zu vermeiden */
}

.picklist-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.picklist-card .meta {
    font-size: 14px;
    color: #666;
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.status-indicator {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.picklist-card .blacklist-info {
    margin-top: 10px;
    padding: 8px 12px;
    background: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

.status-indicator.open {
    background: #fff3cd;
    color: #856404;
}

.status-indicator.picking {
    background: #d1ecf1;
    color: #0c5460;
}

.status-indicator.picked {
    background: #d4edda;
    color: #155724;
}

.loading, .error-message, .complete-message {
    padding: 20px;
    text-align: center;
    font-size: 16px;
}

.loading {
    color: #666;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border-radius: 8px;
    margin: 20px;
}

.complete-message {
    background: #d4edda;
    color: #155724;
    border-radius: 8px;
    margin: 20px;
    font-size: 18px;
    font-weight: 600;
}

.complete-picklist-section {
    padding: 20px;
    text-align: center;
    border-top: 2px solid #e0e0e0;
    margin-top: 20px;
}

.btn-complete-picklist {
    font-size: 18px;
    padding: 15px 30px;
    font-weight: 600;
    width: 100%;
    max-width: 400px;
}

.admin-search-section {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.search-container {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-container input {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
}

.search-container input:focus {
    border-color: #c84040;
}

.search-container button {
    padding: 12px 20px;
    font-size: 16px;
    white-space: nowrap;
}

.picklists-container h2 {
    padding: 20px 20px 10px;
    font-size: 20px;
    color: #333;
}

#picklists-list {
    padding: 0 20px 20px;
}

/* Vibrationsanimation entfernt - verursachte Browser-Fenster-Verschiebung */
.vibrate {
    /* Animation entfernt */
}

/* Warning Popup */
.warning-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.warning-popup-content {
    background: white;
    border-radius: 12px;
    max-width: 95%;
    width: 500px;
    max-height: 85%;
    overflow: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7);
    animation: slideUp 0.4s;
    border: 4px solid;
    position: relative;
}

@keyframes slideUp {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.warning-popup-content.warning {
    border-color: #ffc107;
    background: #fffbf0;
}

.warning-popup-content.error {
    border-color: #dc3545;
    background: #fff5f5;
    animation: slideUp 0.4s;
}

/* Pulse-Animationen entfernt - verursachten Browser-Fenster-Verschiebung */

.warning-popup-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px 12px 0 0;
}

.warning-popup-header h2 {
    margin: 0;
    font-size: 24px;
    color: #dc3545;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.warning-popup-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    line-height: 28px;
    border-radius: 50%;
    transition: all 0.2s;
}

.warning-popup-close:hover {
    background: #e0e0e0;
    color: #333;
}

.warning-popup-body {
    padding: 25px;
    font-size: 18px;
    line-height: 1.8;
    color: #333;
    font-weight: 500;
}

.warning-popup-body pre {
    margin: 0;
    font-size: 18px;
    line-height: 1.8;
    color: #721c24;
    font-weight: 500;
}

.warning-popup-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    text-align: right;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* Debug Panel */
.debug-panel {
    margin: 10px 20px;
    background: #1e1e1e;
    border-radius: 8px;
    border: 2px solid #333;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    max-height: 300px;
    display: flex;
    flex-direction: column;
}

.debug-header {
    background: #2d2d2d;
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #444;
    border-radius: 6px 6px 0 0;
}

.debug-header h3 {
    margin: 0;
    font-size: 14px;
    color: #fff;
    flex: 1;
}

.debug-toggle, .debug-clear {
    background: #444;
    border: 1px solid #666;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 5px;
}

.debug-toggle:hover, .debug-clear:hover {
    background: #555;
}

.debug-content {
    padding: 10px;
    overflow-y: auto;
    flex: 1;
    max-height: 250px;
}

.debug-log {
    padding: 4px 0;
    border-bottom: 1px solid #333;
    line-height: 1.4;
}

.debug-log.camera {
    color: #4fc3f7;
}

.debug-log.scanner {
    color: #81c784;
}

.debug-log.scan {
    color: #ffb74d;
}

.debug-log.error {
    color: #e57373;
    font-weight: bold;
}

.debug-log.success {
    color: #81c784;
    font-weight: bold;
}

.debug-timestamp {
    color: #888;
    font-size: 10px;
    margin-right: 8px;
}

#show-debug-btn {
    width: auto;
    margin: 10px 20px;
    padding: 6px 12px;
    font-size: 12px;
}
