/* License Plate Scanner CSS */

.scanner-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 15px;
    width: 100%;
}

.scanner-title {
    color: #2196F3;
    text-align: center;
    margin-bottom: 15px;
    font-size: 20px;
}

.scanner-subtitle {
    color: #333;
    font-size: 16px;
    margin-bottom: 8px;
}

.hidden {
    display: none !important;
}

#camera-view {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    height: 38vh;
    overflow: hidden;
}

video {
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 6px;
    display: block;
    object-fit: cover;
}

.roi-box {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid #4CAF50;
    border-radius: 6px;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.3);
}

canvas.hidden {
    display: none;
}

#debug-canvas {
    width: auto;
    max-width: 100%;
    max-height: 70px;
    height: auto;
    background: #000;
    border: 2px solid #2196F3;
    border-radius: 4px;
    margin: 6px auto 0;
    display: block;
}

.debug-section {
    margin: 4px 0;
}

.scanner-controls {
    display: flex;
    gap: 10px;
}

.btn-freeze {
    background: #FF9800;
    color: white;
    padding: 15px 25px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    margin-bottom: 10px;
}

.btn-freeze:active {
    background: #F57C00;
}

.btn-scanner-primary, .btn-scanner-secondary {
    padding: 15px 25px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.btn-scanner-primary {
    background: #2196F3;
    color: white;
}

.btn-scanner-primary:active {
    background: #1976D2;
}

.btn-scanner-secondary {
    background: #757575;
    color: white;
}

.btn-scanner-secondary:active {
    background: #616161;
}

.result-box {
    background: white;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 8px;
}

.result-column {
    padding: 8px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
}

.result-column h3 {
    font-size: 11px;
    color: #666;
    margin-bottom: 6px;
    text-align: center;
    text-transform: uppercase;
    font-weight: 600;
}

.result-text {
    font-size: 20px;
    font-weight: bold;
    color: #2196F3;
    text-align: center;
    letter-spacing: 1px;
    margin: 6px 0;
    word-break: break-all;
}

.confidence {
    text-align: center;
    color: #666;
    font-size: 10px;
    line-height: 1.3;
}

.scanner-status {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

.scanner-status.info {
    background: #E3F2FD;
    color: #1976D2;
}

.scanner-status.error {
    background: #FFEBEE;
    color: #C62828;
}

.scanner-status.success {
    background: #C8E6C9;
    color: #2E7D32;
    font-weight: bold;
}

.last-detection {
    text-align: center;
    color: #666;
    margin-top: 10px;
    font-size: 14px;
}

.preprocessing-controls {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 12px;
}

.preprocessing-controls label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #333;
    font-weight: 500;
}

.preprocessing-controls input[type="range"] {
    width: 80px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .scanner-container {
        padding: 8px;
        max-width: 100%;
    }
    
    .scanner-title {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .scanner-subtitle {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .video-wrapper {
        height: 28vh;
    }
    
    video {
        max-height: none;
        height: 100%;
    }
    
    #debug-canvas {
        max-height: 50px;
    }
    
    .debug-section {
        margin: 4px 0;
    }
    
    #camera-view {
        gap: 6px;
    }
    
    .result-text {
        font-size: 16px;
    }
    
    .comparison {
        gap: 6px;
    }
    
    .result-column {
        padding: 6px;
    }
    
    .result-box {
        padding: 8px;
        margin-bottom: 8px;
    }
    
    .btn-scanner-primary, .btn-scanner-secondary, .btn-freeze {
        padding: 10px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .scanner-container {
        padding: 6px;
    }
    
    .scanner-title {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .video-wrapper { 
        height: 22vh; 
    }
    
    video { 
        object-fit: cover; 
    }
    
    .debug-section {
        margin: 2px 0;
    }
    
    #debug-canvas {
        max-height: 40px;
        margin-bottom: 4px;
    }
    
    .result-text { 
        font-size: 14px; 
    }
    
    .comparison {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .result-column {
        padding: 4px;
        font-size: 11px;
    }
    
    .result-column h3 {
        font-size: 9px;
        margin-bottom: 2px;
    }
    
    .result-box {
        padding: 6px;
        margin-bottom: 4px;
    }
    
    .result-box h2 {
        font-size: 12px !important;
    }
    
    #timestamp, .last-detection { 
        display: none; 
    }
    
    .scanner-status {
        font-size: 12px;
        padding: 8px;
        margin-top: 8px;
    }
    
    .preprocessing-controls {
        flex-direction: column;
        gap: 6px;
        padding: 6px;
        font-size: 11px;
    }
    
    .preprocessing-controls input[type="range"] {
        width: 80px;
    }
    
    .btn-scanner-primary, .btn-scanner-secondary, .btn-freeze {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    #camera-view {
        gap: 4px;
    }
}
