body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f2f5;
    margin: 0;
}

.container {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 90%;
    max-width: 600px;
}

h1 {
    color: #333;
}

.buttons {
    margin: 1.5rem 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

button {
    padding: 10px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 0;
    transition: background-color 0.3s;
}

#startButton {
    background-color: #952dda;
    color: white;
}

#startButton:disabled {
    background-color: #aaa;
}

#cameraButton {
    background-color: #952dda;
    color: white;
}

#cleanButton {
    background-color: #952dda;
    color: white;
}

.output {
    margin-top: 1.5rem;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    min-height: 100px;
    text-align: left;
}

.camera-view {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-top: 1.5rem;
}

.media-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

#video-stream,
#canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#captureButton {
    margin-top: 10px;
    background-color: #337ab7;
    color: white;
}


.interim {
    color: #888;
}

.final {
    color: #333;
    font-weight: bold;
}

.status {
    margin-top: 1rem;
    color: #555;
    font-size: 0.9rem;
}

.api-response {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 5px;
    font-size: 1.1rem;
    border: 1px solid #ccc;
    background-color: #f9f9f9;
}

.status-found {
    color: #2a8c4a;
    font-weight: bold;
    border-left: 5px solid #4CAF50;
}

.status-not-found {
    color: #c9302c;
    font-weight: bold;
    border-left: 5px solid #f44336;
}

.status-error {
    color: #f0ad4e;
    font-weight: bold;
    border-left: 5px solid #ec971f;
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.popup-content {
    background: white;
    padding: 2rem 3rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    text-align: center;
    position: relative;
    max-width: 90%;
    width: 400px;
}

.popup-content h2 {
    margin-top: 0;
}

.popup-content h2.status-found {
    color: #4CAF50;
}

.popup-content h2.status-not-found {
    color: #c9302c;
}

.popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
}

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

.hidden {
    display: none;
}

.popup-content.processing {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(0, 0, 0, 0.15);
    border-top-color: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

#processing-popup.popup-overlay {
    background-color: rgba(0, 0, 0, 0.5);
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 10px;
    background: #111;
    color: #fff;
    cursor: pointer;
    transition: transform .1s, box-shadow .1s;
}

.icon-btn i {
    font-size: 18px
}

.icon-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25)
}

.icon-btn:active {
    transform: none
}

.icon-btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px
}