/* =============================================================================
   scales_test.css - Стили для тестовой страницы весов и сканера
   ============================================================================= */

.scales-test-page {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.scales-test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.scales-test-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #64748b;
    padding: 8px 16px;
    background: #f8fafc;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.connected {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.status-dot.disconnected {
    background: #ef4444;
}

/* Content Grid */
.scales-test-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .scales-test-content {
        grid-template-columns: 1fr;
    }
}

/* Sections */
.scales-section,
.scanner-section {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.scales-section h2,
.scanner-section h2 {
    font-size: 18px;
    font-weight: 600;
    color: #334155;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

/* Weight Display */
.weight-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    margin-bottom: 20px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.weight-display.stable {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #86efac;
}

.weight-display.error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fca5a5;
}

.weight-value {
    font-size: 64px;
    font-weight: 700;
    color: #1e293b;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: -2px;
    line-height: 1;
}

.weight-display.stable .weight-value {
    color: #16a34a;
}

.weight-display.error .weight-value {
    color: #dc2626;
}

.weight-unit {
    font-size: 24px;
    font-weight: 500;
    color: #64748b;
}

/* Stability Indicator */
.stability-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    margin-bottom: 20px;
}

.stability-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #94a3b8;
}

.stability-dot.stable {
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
    animation: pulse-green 2s infinite;
}

.stability-dot.unstable {
    background: #f59e0b;
    animation: pulse-yellow 1s infinite;
}

.stability-dot.error {
    background: #ef4444;
}

@keyframes pulse-green {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes pulse-yellow {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.stability-text {
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
}

/* Fix Weight Button */
.btn-fix-weight {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.btn-fix-weight:disabled {
    background: #e2e8f0;
    border-color: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

.btn-fix-weight:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Fixed Readings */
.fixed-readings,
.scan-history {
    margin-top: 24px;
}

.fixed-readings h3,
.scan-history h3 {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.readings-list,
.history-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.no-readings,
.no-scans {
    padding: 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
    margin: 0;
}

.reading-item,
.scan-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.reading-item:last-child,
.scan-item:last-child {
    border-bottom: none;
}

.reading-item:hover,
.scan-item:hover {
    background: #f8fafc;
}

.reading-weight {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.reading-time,
.scan-time {
    font-size: 12px;
    color: #94a3b8;
}

.scan-barcode {
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    font-family: 'Monaco', 'Menlo', monospace;
    word-break: break-all;
    flex: 1;
    margin-right: 12px;
}

/* Scanner Input */
.scanner-input-wrapper {
    margin-bottom: 20px;
}

.scanner-input {
    font-size: 18px;
    padding: 14px 16px;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    transition: all 0.2s ease;
}

.scanner-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    outline: none;
}

.scanner-input::placeholder {
    color: #94a3b8;
}

/* Mobile Optimizations */
@media (max-width: 480px) {
    .scales-test-page {
        padding: 15px;
    }

    .scales-test-header h1 {
        font-size: 20px;
    }

    .weight-value {
        font-size: 48px;
    }

    .weight-unit {
        font-size: 20px;
    }

    .scales-section,
    .scanner-section {
        padding: 16px;
    }

    .btn-fix-weight {
        padding: 12px 20px;
        font-size: 15px;
    }
}
