/* ============================================
   ROBO-X Face Styles - TEDxTaiz
   Hexagonal Eyes Design
   ============================================ */

/* TEDxTaiz Color Variables */
:root {
    --tedx-red: #ea0028;
    --tedx-dark-red: #7f0021;
    --tedx-black: #000000;
    --tedx-white: #eeeeee;
    --tedx-purple: #8c88d2;
    
    /* State Colors */
    --success-green: #4CAF50;
    --late-orange: #FF9800;
    --checkout-blue: #2196F3;
    --error-red: #ea0028;
    
    /* Animation Timings */
    --transition-fast: 0.2s;
    --transition-normal: 0.4s;
    --blink-duration: 0.15s;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--tedx-purple);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Connection Status */
.connection-status {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 14px;
    z-index: 1000;
    transition: opacity var(--transition-normal);
}

.connection-status.hidden {
    opacity: 0;
    pointer-events: none;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f44336;
}

.connection-status.connected .status-dot {
    background: var(--success-green);
    animation: pulse 2s infinite;
}

.connection-status.disconnected .status-dot {
    background: #f44336;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Main Face SVG */
#robo-face {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
}

/* Eyes */
.eye {
    fill: var(--tedx-white);
    transition: all var(--transition-normal);
    transform-origin: center;
}

/* Mouth */
.mouth {
    transition: all var(--transition-normal);
}

/* ============================================
   IDLE STATE ANIMATIONS
   ============================================ */

/* Blink Animation */
@keyframes blink {
    0%, 45%, 55%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.1); }
}

.eye.blinking {
    animation: blink var(--blink-duration) ease-in-out;
    transform-origin: center;
}

/* Subtle breathing/floating animation for idle */
@keyframes breathe {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

#face-group.idle {
    animation: breathe 4s ease-in-out infinite;
}

/* ============================================
   MESSAGE DISPLAY
   ============================================ */

.message-display {
    position: fixed;
    bottom: 30px;
    left: 0;
    right: 0;
    text-align: center;
    color: var(--tedx-white);
    opacity: 0;
    transition: all var(--transition-normal);
    z-index: 100;
    pointer-events: none;
    background: linear-gradient(transparent, rgba(0,0,0,0.3));
    padding: 20px;
    padding-top: 40px;
}

.message-display.visible {
    opacity: 1;
}

.participant-name {
    font-size: 56px;
    font-weight: bold;
    text-shadow: 3px 3px 10px rgba(0, 0, 0, 0.7);
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.status-message {
    font-size: 28px;
    opacity: 0.95;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6);
    font-weight: 500;
}

/* ============================================
   GLOW OVERLAY
   ============================================ */

.glow-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-normal);
    z-index: 50;
}

.glow-overlay.active {
    opacity: 1;
}

.glow-overlay.success {
    box-shadow: inset 0 0 200px 80px var(--success-green);
}

.glow-overlay.late {
    box-shadow: inset 0 0 200px 80px var(--late-orange);
}

.glow-overlay.checkout {
    box-shadow: inset 0 0 200px 80px var(--checkout-blue);
}

.glow-overlay.error {
    box-shadow: inset 0 0 200px 80px var(--error-red);
}

.glow-overlay.already-registered {
    box-shadow: inset 0 0 200px 80px var(--late-orange);
}

/* ============================================
   STATE-SPECIFIC STYLES
   ============================================ */

/* Success State - Happy wide eyes */
#face-group.success .eye {
    transform: scale(1.1);
    fill: var(--tedx-white);
}

#face-group.success .mouth {
    d: path("M 320 460 Q 400 540 480 460");
}

/* Late State - Concerned look */
#face-group.late #eye-left {
    transform: rotate(-8deg);
    transform-origin: 310px 280px;
}

#face-group.late #eye-right {
    transform: rotate(8deg);
    transform-origin: 490px 280px;
}

#face-group.late .mouth {
    d: path("M 350 470 Q 400 480 450 470");
}

/* Checkout State - Friendly */
#face-group.checkout .eye {
    transform: scale(1.05);
}

@keyframes wave-eye {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    75% { transform: rotate(-5deg); }
}

#face-group.checkout #eye-right {
    animation: wave-eye 0.6s ease-in-out 2;
    transform-origin: 490px 280px;
}

#face-group.checkout .mouth {
    d: path("M 330 460 Q 400 520 470 460");
}

/* Error State - X eyes effect using clip or opacity */
#face-group.error .eye {
    fill: var(--tedx-white);
    opacity: 0.3;
}

#face-group.error .mouth {
    d: path("M 340 490 Q 400 450 460 490");
}

/* Already Registered State - Surprised */
#face-group.already-registered .eye {
    transform: scale(1.15);
}

#face-group.already-registered .mouth {
    d: path("M 370 460 Q 400 500 430 460 Q 400 500 370 460");
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .participant-name {
        font-size: 36px;
    }
    
    .status-message {
        font-size: 24px;
    }
    
    .message-display {
        bottom: 40px;
    }
}

@media (max-width: 480px) {
    .participant-name {
        font-size: 28px;
    }
    
    .status-message {
        font-size: 20px;
    }
}

/* iPad optimization */
@media (min-width: 768px) and (max-width: 1024px) {
    .participant-name {
        font-size: 56px;
    }
    
    .status-message {
        font-size: 40px;
    }
}


/* ============================================
   SOUND ENABLE BUTTON
   ============================================ */

.enable-sound-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    font-size: 18px;
    font-weight: bold;
    background: var(--tedx-red);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.3s;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

.enable-sound-btn:hover {
    background: var(--tedx-dark-red);
    transform: scale(1.05);
}

.enable-sound-btn.hidden {
    display: none;
}


