/* style.css - Стили приложения */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1a237e;
    --primary-light: #3949ab;
    --primary-dark: #0d1442;
    --success: #2e7d32;
    --danger: #c62828;
    --warning: #f57f17;
    --background: #f5f5f5;
    --card-shadow: 0 4px 12px rgba(0,0,0,0.1);
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: #333;
    min-height: 100vh;
    padding-bottom: 80px;
}

/* Хедер */
.app-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-content h1 {
    font-size: 20px;
    font-weight: 600;
}

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

.status-bar {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 14px;
    opacity: 0.9;
    padding: 4px 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
}

/* Область сканирования */
.scan-area {
    padding: 16px;
}

.scan-container {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--card-shadow);
}

.scan-input-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.scan-input-wrapper input {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 18px;
    background: #fafafa;
    transition: border-color 0.3s;
}

.scan-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary-light);
    background: white;
}

.scan-btn {
    padding: 14px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
}

.scanner-preview {
    background: #1a1a2e;
    border-radius: 8px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.scan-animation {
    width: 200px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    position: relative;
}

.scan-line {
    width: 40px;
    height: 100%;
    background: #4fc3f7;
    animation: scanMove 1.5s ease-in-out infinite;
    border-radius: 2px;
}

@keyframes scanMove {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(160px); }
}

.scan-hint {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    margin-top: 12px;
}

/* Результат сканирования */
.scan-result {
    margin-top: 16px;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-card {
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--card-shadow);
    border-left: 4px solid var(--success);
}

.result-card.error {
    border-left-color: var(--danger);
}

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

.result-status {
    font-size: 24px;
}

.result-order {
    font-weight: 600;
    color: var(--primary);
}

.result-body {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
}

.product-info h3 {
    font-size: 16px;
    margin-bottom: 4px;
}

.product-sku, .product-barcode {
    font-size: 14px;
    color: #666;
}

.product-meta {
    text-align: right;
    font-size: 14px;
}

.product-meta .label {
    display: block;
    margin: 2px 0;
}

.result-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

/* Информация о заказе */
.order-info {
    margin: 16px;
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--card-shadow);
}

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

.order-id {
    font-weight: 700;
    color: var(--primary);
}

.order-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), #66bb6a);
    transition: width 0.5s ease;
    border-radius: 4px;
}

.progress-text {
    font-size: 14px;
    font-weight: 600;
    min-width: 40px;
}

.order-items {
    max-height: 200px;
    overflow-y: auto;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.order-item .item-name {
    flex: 1;
}

.order-item .item-status {
    margin-left: 8px;
}

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

.order-item .item-status.pending {
    color: var(--warning);
}

.empty-message {
    color: #999;
    text-align: center;
    padding: 16px;
}

/* Модалка */
.modal {
    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;
    animation: fadeIn 0.3s;
}

.modal.hidden {
    display: none;
}

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

.modal-content {
    background: white;
    border-radius: var(--radius);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 20px;
}

.upload-section, .info-section {
    margin-bottom: 20px;
}

.upload-group {
    margin-bottom: 12px;
}

.upload-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
}

.upload-group input[type="file"] {
    display: block;
    width: 100%;
    padding: 8px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-light);
}
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
}

/* Уведомления */
.notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 24px;
    border-radius: var(--radius);
    background: #333;
    color: white;
    max-width: 90%;
    z-index: 2000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    animation: slideUp 0.3s;
}

.notification.success {
    background: var(--success);
}

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

.notification.warning {
    background: var(--warning);
}

.notification.hidden {
    display: none;
}

/* Адаптивность */
@media (max-width: 480px) {
    .result-body {
        grid-template-columns: 1fr;
    }
    .product-meta {
        text-align: left;
    }
    .scan-input-wrapper input {
        font-size: 16px;
    }
}