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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(103deg, #345490 0%, #599aa6 100%);
    min-height: 100dvh;
    height:100dvh;
    max-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin:0;

    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: center;
    align-items: center;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 28px;
}

#video-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto 20px;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 1;
}

#video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

button {
    padding: 12px 24px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

#start-btn {
    background: #667eea;
    color: white;
}

#start-btn:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-2px);
}

#stop-btn {
    background: #f56565;
    color: white;
}

#stop-btn:hover:not(:disabled) {
    background: #e53e3e;
    transform: translateY(-2px);
}

#camera-toggle {
    background: #48bb78;
    color: white;
}

#camera-toggle:hover:not(:disabled) {
    background: #38a169;
    transform: translateY(-2px);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

#result {
    background: #f7fafc;
    padding: 20px;
    border-radius: 10px;
    min-height: 100px;
    word-wrap: break-word;
}

#result h2 {
    color: #2d3748;
    font-size: 18px;
    margin-bottom: 10px;
}

#result p {
    color: #4a5568;
    line-height: 1.6;
}

.success {
    color: #48bb78 !important;
    font-weight: 600;
}

.error {
    color: #f56565 !important;
}

#qr-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    border: 3px solid #48bb78;
    border-radius: 10px;
    pointer-events: none;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.4);
    }
    50% {
        box-shadow: 0 0 20px 10px rgba(72, 187, 120, 0.2);
    }
}

.hidden {
    display: none;
}

#course_selector {
    position: fixed;
    z-index: 0;
    background-color: #12121275;
    backdrop-filter: blur(3px);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap:.5rem;
    opacity: 0;

    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

#course_selector.active {
    z-index:999;
    pointer-events: all;
    opacity: 1;
}

#courses_container {
    width: 60%;
    display: none;
    flex-direction: column;
    flex-wrap: nowrap;
    align-content: center;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    color:white;
}

#courses_container.active {
    display: flex;
}

#course_selector h1 {
    color:white !important;
    max-width: 90%;
}

.course_btn {
    width: 100%;
    background-color:#5474ad;
    color:white;
}