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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

.screen {
    display: none !important;
    min-height: 100vh;
    padding: 20px;
    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: #667eea;
    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, #667eea 0%, #764ba2 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: #667eea;
    margin-right: 15px;
}

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

/* Camera Screen */
.camera-container {
    position: relative;
    background: black;
    border-radius: 30px;
    overflow: hidden;
    margin-bottom: 40px;
    max-width: 100%;
    width: 100%;
    height: 75vh;
    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;
}

.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: 30px;
    margin: 30px auto;
    max-width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.preview-container img, .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: 30px;
    margin: 30px auto;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.qr-container h3 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 30px;
    font-weight: 700;
}

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

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

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-info {
    flex: 1;
    min-width: 0;
}

.profession-card h3 {
    color: #667eea;
    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: white;
}

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

/* 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: 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;
    }

    .qr-container h3 {
        font-size: 3em;
    }

    #qrcode {
        margin: 40px 0;
    }
}
