/* WMS Mobile CSS - Optimalizált mobil eszközökre */

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

:root {
    --primary-color: #1976d2;
    --primary-dark: #115293;
    --success-color: #4caf50;
    --error-color: #f44336;
    --warning-color: #ff9800;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-primary: #212121;
    --text-secondary: #757575;
    --border-color: #e0e0e0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Prevent zoom on input focus (iOS) */
input, select, textarea {
    font-size: 16px !important;
}

#app {
    width: 100%;
    min-height: 100vh;
}

/* Screen Management */
.screen {
    display: none;
    width: 100%;
    min-height: 100vh;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

/* Header */
.header {
    background-color: var(--primary-color);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header h2 {
    flex: 1;
    font-size: 20px;
    font-weight: 600;
}

.btn-back {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

.btn-icon {
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
}

/* Login Screen */
.login-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px;
}

.logo {
    width: 120px;
    height: 120px;
    margin-bottom: 24px;
}

.login-container h1 {
    font-size: 28px;
    margin-bottom: 32px;
    color: var(--primary-color);
}

#login-form {
    width: 100%;
    max-width: 400px;
}

input[type="text"],
input[type="password"],
.scan-input {
    width: 100%;
    padding: 16px;
    margin-bottom: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    background-color: white;
}

input:focus,
.scan-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-primary:disabled {
    background-color: var(--text-secondary);
    cursor: not-allowed;
}

.btn-secondary {
    width: 100%;
    padding: 14px;
    background-color: #eef3f7;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.btn-secondary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-warning {
    background-color: #ffc107;
    color: #212529;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 600;
}

.btn-warning:active {
    background-color: #e0a800;
}

.btn-large {
    padding: 20px;
    font-size: 20px;
    margin-top: 24px;
}

.error-message {
    color: var(--error-color);
    margin-top: 16px;
    text-align: center;
    font-size: 14px;
}

/* Menu Grid */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding: 16px;
    justify-items: stretch;
    align-items: stretch;
}

.menu-card {
    background-color: var(--card-bg);
    border: none;
    border-radius: 12px;
    padding: 24px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 120px;
    min-width: 0;
    width: 100%;
    justify-self: stretch;
    min-inline-size: 0;
    -webkit-appearance: none;
    appearance: none;
}

/* Tabs */
.tab-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tab-button {
    flex: 1;
    padding: 10px 12px;
    background-color: #e3f2fd;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
}

.tab-button.active {
    background-color: var(--primary-color);
    color: white;
}

/* Simple list items */
.list-item {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.list-item-title {
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--primary-color);
}

.menu-card:active {
    transform: scale(0.95);
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.menu-icon {
    font-size: 40px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.menu-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.3;
    min-width: 0;
}

.message-alert {
    background-color: #fff3e0;
    color: #e65100;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.hidden {
    display: none !important;
}

/* Content Area */
.content {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

/* Task List */
.task-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s;
}

.task-card:active {
    transform: scale(0.98);
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.task-number {
    font-weight: 700;
    font-size: 16px;
    color: var(--primary-color);
}

.task-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background-color: var(--warning-color);
    color: white;
}

.task-info {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Info Card */
.info-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.info-card h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.info-card p {
    font-size: 16px;
    margin-bottom: 8px;
}

/* Scan Section */
.scan-section {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.scan-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.input-with-scan {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-with-scan .scan-input {
    flex: 1;
    margin-bottom: 0;
}

.btn-scan {
    background-color: #e3f2fd;
    border: none;
    color: var(--primary-color);
    font-size: 20px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    min-width: 48px;
    min-height: 48px;
}

.scanner-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
}

.scanner-content {
    background: white;
    width: 100%;
    max-width: 420px;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.2);
}

.scanner-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    margin-bottom: 12px;
}

#scanner-close-btn {
    color: var(--text-primary);
    background: #f5f5f5;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 16px;
}

#scanner-preview {
    width: 100%;
    min-height: 260px;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.scanner-hint {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

/* Status Indicator */
.status-indicator {
    padding: 12px;
    border-radius: 8px;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.status-indicator.success {
    background-color: #e8f5e9;
    color: var(--success-color);
}

.status-indicator.error {
    background-color: #ffebee;
    color: var(--error-color);
}

.status-indicator.warning {
    background-color: #fff3e0;
    color: var(--warning-color);
}

/* Info Row */
.info-row {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

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

.info-row.hint {
    background-color: #e3f2fd;
    padding: 12px;
    border-radius: 6px;
    margin: 8px 0;
    border: none;
}

.info-row.warning {
    background-color: #fff3e0;
    padding: 12px;
    border-radius: 6px;
    margin: 8px 0;
    border: none;
    color: var(--warning-color);
}

/* Code Highlights */
.code-highlight {
    display: inline-block;
    background-color: #f5f5f5;
    padding: 8px 16px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 4px;
    letter-spacing: 1px;
}

.check-digit-highlight {
    display: inline-block;
    background-color: #4caf50;
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-family: 'Courier New', monospace;
    font-size: 24px;
    font-weight: 700;
    margin-left: 8px;
    letter-spacing: 2px;
}

/* Badge */
.badge {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    text-transform: uppercase;
}

/* Info Text */
.info-text {
    text-align: center;
    color: var(--text-secondary);
    padding: 32px;
    font-size: 16px;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .menu-grid {
        grid-template-columns: repeat(4, 1fr);
        max-width: 900px;
        margin: 0 auto;
    }

    .content {
        max-width: 800px;
        margin: 0 auto;
        width: 100%;
    }
}


/* Check Digit Field */
.scan-section.alternative {
    background-color: #f0f7ff;
    border: 2px dashed var(--primary-color);
}

.scan-section.alternative h3 {
    color: var(--primary-color);
    font-size: 14px;
}

.hint-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.check-digit-field {
    max-width: 120px;
    text-align: center;
    font-size: 32px !important;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 8px;
    padding: 16px 8px;
}

/* Optional section */
.scan-section.optional {
    background-color: #fafafa;
    border: 1px dashed var(--border-color);
}

.scan-section.optional h3 {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Completed task card */
.task-card.completed {
    background-color: #e8f5e9;
    border-left: 4px solid var(--success-color);
}

/* PWA specific */
@media (display-mode: standalone) {
    .header {
        padding-top: max(16px, env(safe-area-inset-top));
    }
}

/* Sorter workspace progress */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #16a34a, #22c55e);
    transition: width 0.2s ease;
}

