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


/* Background Video */

#bgVideo {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    color: #FFF;
    overflow: hidden;
    position: relative;
}


/* Header with Three Logos */

.header-logos {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    /* background: rgba(255, 255, 255, 0.95); */
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    height: 250px;
}

.header-logo-left,
.header-logo-center,
.header-logo-right {
    flex: 1;
    display: flex;
    align-items: center;
}

.header-logo-left {
    justify-content: flex-start;
}

.header-logo-center {
    justify-content: center;
}

.header-logo-right {
    justify-content: flex-end;
}

.header-logos img {
    max-height: 120px;
    width: auto;
    object-fit: contain;
}

.screen {
    display: none !important;
    min-height: 100vh;
    padding: 0;
    animation: fadeIn 0.5s ease-in-out;
}

.screen.active {
    display: flex !important;
}

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

.container {
    max-width: 100%;
    width: 100%;
    margin: auto;
    text-align: center;
    padding: 20px;
    height: 100%;
}


/* Welcome Screen */

.logo-container {
    /* background: white; */
    /* border-radius: 30px; */
    padding: 60px 40px;
    margin-bottom: 40px;
    /* box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2); */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
    width: 100%;
    max-width: 100%;
}

.aai-logo {
    max-width: 100%;
    width: 100%;
    height: auto;
    margin-bottom: 40px;
}

.logo-container h1 {
    color: #FF9933;
    margin-bottom: 30px;
    font-size: 3.5em;
    line-height: 1.2;
    font-weight: 700;
}

.logo-container p {
    color: #666;
    font-size: 2em;
    margin-bottom: 30px;
}


/* Buttons */

.btn-primary,
.btn-secondary {
    padding: 25px 80px;
    font-size: 2em;
    border: none;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 700;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    display: block;
}

.btn-primary {
    background: linear-gradient(135deg, #FF9933 0%, #138808 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.btn-secondary {
    background: white;
    color: #FF9933;
    margin-right: 15px;
    border: 2px solid #FF9933;
}

.btn-secondary:hover {
    transform: translateY(-3px);
    background: #f0f0f0;
}

.btn-restart {
    padding: 20px 60px;
    font-size: 2em;
    border: 2px solid #FF9933;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 700;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 600px;
    margin: 20px auto;
    display: block;
    background: white;
    color: #FF9933;
}

.btn-restart:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    background: #FFF5E6;
}


/* Camera Screen */

.camera-container {
    position: relative;
    background: black;
    border-radius: 30px;
    overflow: hidden;
    margin-bottom: 40px;
    max-width: 100%;
    width: 100%;
    height: 33vh;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

#videoElement {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transform: scaleX(-1);
}

.countdown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 15em;
    color: white;
    font-weight: bold;
    text-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
    animation: pulse 0.5s ease-in-out;
    z-index: 10;
}

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


/* Preview Screen */

.preview-container,
.result-container {
    background: white;
    border-radius: 30px;
    padding: 10px;
    margin: 0px auto;
    max-width: 97%;
    margin-top: 200px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.preview-container img {
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    max-height: 50vh;
    object-fit: contain;
    transform: scaleX(-1);
}

.result-container img {
    max-width: 100%;
    height: auto;
    border-radius: 20px;
    max-height: 50vh;
    object-fit: contain;
}


/* QR Code Container */

.qr-container {
    background: white;
    border-radius: 30px;
    padding: 25px;
    margin: 30px auto;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.qr-container h3 {
    color: #FF9933;
    font-size: 2em;
    margin-bottom: 0px;
    font-weight: 700;
}

#qrcode {
    display: inline-block;
    padding: 20px;
    background: white;
    border-radius: 20px;
}

#qrcode img {
    display: block;
    margin: 0 auto;
    border-radius: 10px;
}


/* QR Loader */

.qr-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    min-height: 200px;
}

.qr-spinner {
    width: 80px;
    height: 80px;
    border: 6px solid rgba(255, 153, 51, 0.2);
    border-top: 6px solid #FF9933;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.qr-loader p {
    color: #FF9933;
    font-size: 1.5em;
    font-weight: 600;
    margin: 0;
}

h2 {
    color: white;
    font-size: 3.5em;
    margin-bottom: 40px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    padding: 0 20px;
    font-weight: 700;
}


/* Profession Grid */

.profession-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-top: 30px;
}

.profession-card {
    background: white;
    border-radius: 25px;
    padding: 40px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    text-align: left;
}

.profession-card:active {
    transform: scale(0.98);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.profession-icon {
    font-size: 5em;
    margin-right: 30px;
    flex-shrink: 0;
}

.profession-icon img {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.profession-info {
    flex: 1;
    min-width: 0;
}

.profession-card h3 {
    color: #FF9933;
    margin-bottom: 10px;
    font-size: 2.5em;
    font-weight: 700;
}

.profession-card p {
    color: #666;
    font-size: 1.5em;
}


/* Loading Screen */

.loader {
    border: 15px solid rgba(255, 255, 255, 0.3);
    border-top: 15px solid white;
    border-radius: 50%;
    width: 150px;
    height: 150px;
    animation: spin 1s linear infinite;
    margin: 0 auto 50px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

#loadingScreen h2,
#loadingScreen p {
    color: #000;
}

#loadingScreen p {
    font-size: 2em;
    margin-top: 20px;
}


/* Trivia Content Styles */

.trivia-content {
    max-width: 900px;
    margin: 80px auto 40px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.trivia-content h2 {
    color: #FF9933;
    font-size: 2.8em;
    margin-bottom: 30px;
    text-shadow: none;
    font-weight: 700;
    text-align: center;
}

.trivia-items {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.trivia-item {
    color: #000000;
    font-size: 2em;
    line-height: 1.5;
    padding: 20px;
    background: rgba(255, 153, 51, 0.1);
    border-left: 5px solid #FF9933;
    border-radius: 10px;
    font-weight: 500;
}


/* Button Group */

.button-group {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.button-group .btn-secondary {
    margin-right: 0;
    margin-left: auto;
    margin-right: auto;
}

.button-group .btn-primary {
    margin-left: auto;
    margin-right: auto;
}


/* Optimized for 1080x1920px vertical display */

.screen.active {
    align-items: center;
    justify-content: center;
    overflow-y: auto;
}

#welcomeScreen .container {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    min-height: 100vh;
}

#cameraScreen .container,
#previewScreen .container,
#professionScreen .container,
#resultScreen .container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

#cameraScreen .container>.btn-primary,
#welcomeScreen .container>.btn-primary {
    margin-left: auto;
    margin-right: auto;
}


/* Specific optimization for 1080x1920 */

@media (width: 1080px) and (height: 1920px) {
    .container {
        padding: 40px 60px;
    }
    .logo-container h1 {
        font-size: 6em;
    }
    .logo-container h3 {
        font-size: 4em;
    }
    .logo-container p {
        font-size: 2.2em;
    }
    h2 {
        font-size: 4em;
    }
    .profession-card {
        padding: 50px 40px;
    }
    .profession-card h3 {
        font-size: 3em;
    }
    .profession-card p {
        font-size: 1.8em;
    }
    .profession-icon {
        font-size: 6em;
    }
    .profession-icon img {
        width: 100px;
        height: 100px;
    }
    .qr-container h3 {
        font-size: 2em;
    }
    #qrcode {
        margin: 0px 0;
    }
    .trivia-content {
        padding: 60px;
    }
    .trivia-content h2 {
        font-size: 3.5em;
    }
    .trivia-item {
        font-size: 2.3em;
        padding: 25px;
    }
}