body {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    overflow-x: hidden;
}

#loadingContainer {
    background-color: rgba(255, 255, 255, 0.08);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3), 0 0 40px rgba(0, 188, 212, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    text-align: center;
    width: 90%;
    max-width: 500px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    animation: fadeInScale 1s ease-out forwards;
}

#loadingContainer::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(0, 188, 212, 0.1) 0%, transparent 70%);
    transform: rotate(0deg);
    animation: rotateGlow 15s linear infinite;
    z-index: -1;
    opacity: 0.7;
}

#loadingText {
    font-size: 1.8em;
    margin-bottom: 15px;
    color: #e0e0e0;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

#countdown {
    font-family: 'Orbitron', sans-serif;
    font-size: 5em;
    font-weight: bold;
    color: #00bcd4;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(0, 188, 212, 0.7), 0 0 30px rgba(0, 188, 212, 0.5);
    animation: pulseGlow 1.5s infinite alternate;
}

#statusMessage {
    margin-top: 20px;
    font-size: 1.1em;
    color: #ccc;
    line-height: 1.5;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
    min-height: 50px;
}

button {
    background-color: #00bcd4;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: bold;
    transition: all 0.3s ease;
    margin: 10px;
    box-shadow: 0 4px 15px rgba(0, 188, 212, 0.3);
}

button:hover {
    background-color: #0097a7;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 188, 212, 0.4);
}

button:disabled {
    background-color: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#cameraContainer {
    margin-top: 20px;
    text-align: center;
    width: 100%;
    max-width: 600px;
}

#cameraFeed {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    border: 2px solid rgba(0, 188, 212, 0.5);
}

#photoContainer {
    margin-top: 20px;
    text-align: center;
    width: 100%;
    max-width: 600px;
}

#photoCanvas {
    display: none;
}

#capturedPhoto {
    display: none !important;
}

#uploadStatus {
    margin-top: 20px;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
}

#uploadStatus.success {
    background-color: rgba(76, 175, 80, 0.2);
    border: 1px solid #4caf50;
    color: #4caf50;
}

#uploadStatus.error {
    background-color: rgba(244, 67, 54, 0.2);
    border: 1px solid #f44336;
    color: #f44336;
}

#uploadStatus.loading {
    background-color: rgba(255, 193, 7, 0.2);
    border: 1px solid #ffc107;
    color: #ffc107;
}

/* Loading spinner */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid #00bcd4;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

/* Keyframe Animations */
@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes pulseGlow {
    from { text-shadow: 0 0 15px rgba(0, 188, 212, 0.7), 0 0 25px rgba(0, 188, 212, 0.5); }
    to { text-shadow: 0 0 25px rgba(0, 188, 212, 0.9), 0 0 40px rgba(0, 188, 212, 0.7); }
}

@keyframes rotateGlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    #loadingContainer {
        padding: 25px;
        margin: 0 10px;
    }
    
    #loadingText {
        font-size: 1.5em;
    }
    
    #countdown {
        font-size: 3.5em;
    }
    
    #statusMessage {
        font-size: 1em;
    }
    
    button {
        width: 100%;
        margin: 5px 0;
    }
    
    #cameraFeed, #capturedPhoto {
        max-width: 100%;
    }
}

@media (max-width: 400px) {
    body {
        padding: 10px;
    }
    
    #loadingContainer {
        padding: 20px;
    }
    
    #countdown {
        font-size: 2.5em;
    }
    
    button {
        font-size: 1em;
        padding: 10px 20px;
    }
}

/* User Form Styles */
#userForm {
    background-color: rgba(255, 255, 255, 0.08);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3), 0 0 40px rgba(0, 188, 212, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    width: 90%;
    max-width: 500px;
    box-sizing: border-box;
    margin-top: 20px;
    animation: fadeInScale 0.5s ease-out forwards;
}

#userForm h2 {
    text-align: center;
    color: #00bcd4;
    margin-bottom: 30px;
    font-size: 1.8em;
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #e0e0e0;
    font-weight: bold;
    font-size: 1.1em;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1em;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00bcd4;
    background-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 10px rgba(0, 188, 212, 0.3);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

#submitForm {
    width: 100%;
    background-color: #4caf50;
    margin-top: 20px;
    font-size: 1.3em;
    padding: 15px;
}

#submitForm:hover {
    background-color: #45a049;
}

/* Mobile form styles */
@media (max-width: 600px) {
    #userForm {
        padding: 25px;
        margin: 0 10px;
        margin-top: 20px;
    }
    
    #userForm h2 {
        font-size: 1.5em;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 10px;
    }
}