/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    overflow-y: auto;
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5; /* Background neutro por defecto */
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
    color: #333;
    position: relative;
    margin: 0;
    padding: 0;
}

/* Fullscreen container */
.fullscreen-container {
    width: 100%;
    min-height: calc(100vh - 85px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 20px;
}

/* Main Avatar Container */
.avatar-main {
    position: relative;
    z-index: 10;
    animation: fadeIn 1s ease-in;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* Solar Panel - Tilted on Top */
.solar-panel {
    position: relative;
    width: 380px;
    height: 200px;
    background: linear-gradient(145deg,
        #0d47a1 0%,
        #1565c0 25%,
        #1976d2 50%,
        #2196f3 75%,
        #42a5f5 100%
    );
    border-radius: 15px;
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.5),
        0 8px 20px rgba(0, 0, 0, 0.3),
        inset 0 2px 5px rgba(255, 255, 255, 0.15),
        inset 0 -3px 10px rgba(0, 0, 0, 0.2);
    transform: perspective(600px) rotateX(25deg);
    transform-origin: bottom center;
    animation: panelFloat 5s ease-in-out infinite;
    overflow: hidden;
    margin-bottom: -40px;
    z-index: 2;
}

.solar-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%,
        rgba(255, 255, 255, 0.15) 0%,
        rgba(255, 255, 255, 0.05) 40%,
        transparent 70%
    );
    pointer-events: none;
}

.solar-panel::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 40%,
        rgba(255, 255, 255, 0.08) 50%,
        transparent 60%
    );
    animation: panelShine 8s ease-in-out infinite;
    pointer-events: none;
}

/* Panel Support/Stand */
.panel-support {
    position: absolute;
    bottom: -25px;
    right: 30px;
    width: 60px;
    height: 30px;
    background: linear-gradient(145deg, #546e7a 0%, #607d8b 100%);
    clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
    z-index: 1;
}

@keyframes panelFloat {
    0%, 100% {
        transform: perspective(600px) rotateX(25deg) translateY(0px);
    }
    50% {
        transform: perspective(600px) rotateX(25deg) translateY(-8px);
    }
}

@keyframes panelShine {
    0% {
        transform: translate(-100%, -100%) rotate(0deg);
    }
    100% {
        transform: translate(100%, 100%) rotate(0deg);
    }
}

/* Panel Grid (solar cells) - Enhanced */
.panel-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
    padding: 20px;
    z-index: 1;
}

.panel-cell {
    background: linear-gradient(135deg,
        #0d47a1 0%,
        #1565c0 30%,
        #1976d2 60%,
        #2196f3 100%
    );
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    animation: cellPulse 4s ease-in-out infinite;
    animation-delay: calc(var(--cell-index, 0) * 0.15s);
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 -2px 8px rgba(255, 255, 255, 0.1),
        0 2px 5px rgba(0, 0, 0, 0.2);
}

.panel-cell::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 35%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 65%
    );
    animation: cellShine 6s ease-in-out infinite;
    animation-delay: calc(var(--cell-index, 0) * 0.3s);
}

.panel-cell::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    width: 30%;
    height: 30%;
    background: radial-gradient(circle,
        rgba(255, 255, 255, 0.3) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    border-radius: 50%;
}

@keyframes cellPulse {
    0%, 100% {
        opacity: 0.85;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

@keyframes cellShine {
    0% {
        transform: translate(-100%, -100%) rotate(0deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translate(100%, 100%) rotate(0deg);
        opacity: 0;
    }
}

/* Set animation delays for each cell */
.panel-cell:nth-child(1) { --cell-index: 0; }
.panel-cell:nth-child(2) { --cell-index: 1; }
.panel-cell:nth-child(3) { --cell-index: 2; }
.panel-cell:nth-child(4) { --cell-index: 3; }
.panel-cell:nth-child(5) { --cell-index: 4; }
.panel-cell:nth-child(6) { --cell-index: 5; }
.panel-cell:nth-child(7) { --cell-index: 6; }
.panel-cell:nth-child(8) { --cell-index: 7; }
.panel-cell:nth-child(9) { --cell-index: 8; }

/* Panel Frame - Enhanced Metallic Look */
.panel-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 10px solid #263238;
    border-radius: 15px;
    box-shadow:
        inset 0 0 20px rgba(0, 0, 0, 0.6),
        inset 0 2px 6px rgba(0, 0, 0, 0.8),
        inset 0 -2px 6px rgba(255, 255, 255, 0.1),
        0 0 0 2px rgba(255, 255, 255, 0.12),
        0 0 15px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    z-index: 3;
}

.panel-frame::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border-radius: 15px;
    background: linear-gradient(145deg,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.2) 100%
    );
    pointer-events: none;
}

/* Tractor Style Wheels (Like Design Image) */
.wheels-container {
    position: relative;
    width: 500px;
    height: 140px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 5;
    margin-top: -30px;
}

.wheel {
    position: relative;
    width: 140px;
    height: 140px;
    background: #2c3e50;
    border-radius: 50%;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.6),
        inset 0 -5px 15px rgba(0, 0, 0, 0.5),
        inset 0 5px 10px rgba(255, 255, 255, 0.1);
    animation: wheelBounce 4s ease-in-out infinite;
    overflow: visible;
}

/* Tire tread pattern */
.wheel::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: repeating-conic-gradient(
        from 0deg,
        #1a252f 0deg 15deg,
        #2c3e50 15deg 30deg
    );
}

/* Yellow/golden rim */
.wheel::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: linear-gradient(145deg,
        #f39c12 0%,
        #f1c40f 50%,
        #f39c12 100%
    );
    border-radius: 50%;
    box-shadow:
        0 0 0 8px #d68910,
        0 0 0 12px #2c3e50,
        inset 0 3px 8px rgba(255, 255, 255, 0.4),
        inset 0 -3px 8px rgba(0, 0, 0, 0.4),
        0 5px 15px rgba(0, 0, 0, 0.5);
}

.wheel-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background: radial-gradient(circle,
        #2c3e50 0%,
        #1a252f 70%
    );
    border-radius: 50%;
    box-shadow:
        inset 0 2px 5px rgba(0, 0, 0, 0.8),
        0 1px 3px rgba(255, 255, 255, 0.1);
    z-index: 3;
}

.wheel-tread {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.wheel-tread:nth-child(2) {
    transform: rotate(45deg);
}

.wheel-tread:nth-child(3) {
    transform: rotate(90deg);
}

.wheel-tread:nth-child(4) {
    transform: rotate(135deg);
}

.wheel-tread::before {
    content: '';
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 15%;
    background: linear-gradient(180deg,
        rgba(0, 0, 0, 0.6) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        transparent 100%
    );
    border-radius: 4px;
}

@keyframes wheelBounce {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-3px) rotate(0deg);
    }
}

.left-wheel {
    animation-delay: 0s;
}

.right-wheel {
    animation-delay: 0.2s;
}

/* Body Container (Gray Box with Face) */
.body-container {
    position: relative;
    width: 300px;
    height: 250px;
    background: linear-gradient(145deg,
        #b0bec5 0%,
        #cfd8dc 50%,
        #b0bec5 100%
    );
    border-radius: 20px;
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.4),
        0 8px 20px rgba(0, 0, 0, 0.2),
        inset 0 3px 8px rgba(255, 255, 255, 0.4),
        inset 0 -3px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3;
    animation: bodyBounce 5s ease-in-out infinite;
    margin-bottom: -20px;
}

.body-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 30% 30%,
        rgba(255, 255, 255, 0.3) 0%,
        rgba(255, 255, 255, 0.1) 40%,
        transparent 70%
    );
    border-radius: 20px;
    pointer-events: none;
}

@keyframes bodyBounce {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Face */
.face {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2;
    pointer-events: none;
}

/* Eyes - Simple Round Style (Like Design) */
.eyes {
    display: flex;
    gap: 60px;
    margin-bottom: 30px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.eye {
    /* Elliptical bright eyes to match Cabeza.png */
    width: 40px;
    height: 60px;
    background: #000000; /* INVERTIDO: Ahora negro */
    border-radius: 50% / 58%;
    position: relative;
    overflow: visible;
    animation: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 -8px 14px rgba(0,0,0,0.15);
}

@keyframes simpleBlink {
    0%, 94%, 100% {
        transform: scaleY(1);
    }
    96%, 98% {
        transform: scaleY(0.1);
    }
}

.pupil {
    width: 26px;
    height: 26px;
    background: radial-gradient(circle at 35% 35%, #ffffff 0%, #f0f0f0 100%); /* INVERTIDO: Ahora blanco */
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: simpleLook 6s infinite ease-in-out; /* mover ojos (sin parpadeo) */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

/* Glossy eye highlight matching artwork */
.eye::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 10px;
    width: 28px;
    height: 36px;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.6) 60%, transparent 100%);
    border-radius: 50%;
    transform: rotate(-10deg);
    pointer-events: none;
}

@keyframes simpleLook {
    0%, 100% { transform: translate(-50%, -50%); }
    20% { transform: translate(-40%, -50%); }
    40% { transform: translate(-60%, -45%); }
    60% { transform: translate(-45%, -55%); }
    80% { transform: translate(-55%, -50%); }
}

/* Mouth - Improved Natural Animation */
.mouth {
    position: relative;
    width: 90px;
    height: 36px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

.mouth-shape {
    width: 90px;
    height: 36px;
    border: 6px solid #1d1d1d; /* dark smile stroke like in artwork */
    border-top: none;
    border-radius: 0 0 90px 90px;
    background: transparent;
    box-shadow: none;
    transition: all 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Mouth animations when talking - More natural and slower */
.mouth.talking .mouth-shape {
    animation: naturalTalk 0.5s ease-in-out infinite;
}

@keyframes naturalTalk {
    0% {
        transform: scaleY(1);
        height: 36px;
        border-radius: 0 0 90px 90px;
    }
    30% {
        transform: scaleY(0.8);
        height: 30px;
        border-radius: 0 0 80px 80px;
    }
    55% {
        transform: scaleY(0.6);
        height: 24px;
        border-radius: 0 0 70px 70px;
    }
    80% {
        transform: scaleY(0.8);
        height: 30px;
        border-radius: 0 0 80px 80px;
    }
    100% {
        transform: scaleY(1);
        height: 36px;
        border-radius: 0 0 90px 90px;
    }
}

.mouth.open .mouth-shape {
    height: 44px;
    border-radius: 0 0 100px 100px;
    transform: scaleY(1.05);
}

/* Speech Bubble */
.speech-bubble {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 600px;
    width: 90%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 25px 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 20;
    animation: bubbleIn 0.5s ease;
}

@keyframes bubbleIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

#responseText {
    font-size: 1.3em;
    line-height: 1.6;
    color: #1a237e;
    text-align: center;
    margin: 0;
}

/* User Input Display */
.user-input-display {
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 500px;
    width: 90%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 20px;
    border-left: 5px solid #2196f3;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 20;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

#userInputText {
    font-size: 1.1em;
    color: #1976d2;
    font-style: italic;
}

/* Floating Controls */
.floating-controls {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: flex-end;
    z-index: 100;
}

/* Mic Button */
.mic-button-float {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mic-button-float:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 35px rgba(102, 126, 234, 0.6);
}

.mic-button-float:active {
    transform: scale(0.95);
}

.mic-button-float.listening {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
    }
    50% {
        opacity: 0.8;
        box-shadow: 0 8px 40px rgba(255, 107, 107, 0.8);
    }
}

/* Text Input Float */
.text-input-float {
    display: flex;
    gap: 10px;
    background: white;
    padding: 10px;
    border-radius: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    animation: slideInRight 0.3s ease;
}

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

#textInput {
    border: none;
    outline: none;
    padding: 10px 15px;
    font-size: 1em;
    width: 250px;
    background: transparent;
}

.send-button-small {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.send-button-small:hover {
    transform: scale(1.1);
}

/* Toggle Text Button */
.toggle-text-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.toggle-text-button:hover {
    transform: scale(1.1);
    background: white;
}

/* Settings Button */
.settings-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.settings-button:hover {
    transform: scale(1.1) rotate(90deg);
    background: white;
}

/* Settings Overlay */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    animation: fadeIn 0.3s ease;
}

.settings-panel-full {
    background: white;
    border-radius: 25px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.settings-panel-full h3 {
    margin: 0 0 25px 0;
    font-size: 1.8em;
    color: #1a237e;
}

.close-settings {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f5f5f5;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-settings:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-content label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 1em;
    color: #333;
}

.settings-content input[type="range"] {
    width: 100%;
    cursor: pointer;
}

.settings-content input[type="password"] {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.settings-content input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
}

.api-key-section {
    margin-top: 10px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.api-key-section small {
    color: #666;
    display: block;
    margin-top: 8px;
}

/* AI Model Selection */
.ai-model-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 3px solid #667eea;
}

.ai-model-section label {
    margin-bottom: 10px;
}

.model-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    background: white;
    transition: border-color 0.3s;
}

.model-select:focus {
    outline: none;
    border-color: #667eea;
}

/* Config Sections */
.config-section {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.config-section h4 {
    margin: 0 0 15px 0;
    color: #1a237e;
    font-size: 1.1em;
}

.config-section input[type="text"],
.config-section input[type="password"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95em;
    transition: border-color 0.3s;
}

.config-section input[type="text"]:focus,
.config-section input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
}

.config-section small {
    color: #666;
    display: block;
    margin-top: 10px;
    font-size: 0.9em;
}

/* Voice Select */
.voice-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    background: white;
    transition: border-color 0.3s;
}

.voice-select:focus {
    outline: none;
    border-color: #667eea;
}

/* Test Voice Button */
.test-voice-button {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    margin-bottom: 15px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.test-voice-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 147, 251, 0.4);
}

.test-voice-button:active {
    transform: translateY(0);
}

/* Test Button */
.test-button {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.test-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.4);
}

.test-button:active {
    transform: translateY(0);
}

/* Status Message */
.status-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9em;
    text-align: center;
    display: none;
}

.status-message.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-message.loading {
    display: block;
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

#rateValue,
#pitchValue,
#tempValue,
#topPValue,
#repeatPenaltyValue {
    font-weight: 600;
    color: #667eea;
    margin-left: 10px;
}

/* Status Indicator */
.status-indicator {
    position: fixed;
    top: 75px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 25px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 100;
    animation: slideDown 0.3s ease;
}

.status-text {
    font-size: 0.95em;
    color: #666;
    font-weight: 500;
}

.status-indicator.listening {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    animation: pulse 1s infinite;
}

.status-indicator.listening .status-text {
    color: white;
}

.status-indicator.thinking {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
}

.status-indicator.thinking .status-text {
    color: white;
}

.status-indicator.speaking {
    background: linear-gradient(135deg, #95e1d3 0%, #aaffa9 100%);
}

.status-indicator.speaking .status-text {
    color: #1a237e;
}

/* Music Player */
.music-player {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 10px;
}

.music-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 28px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-button:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.music-button:active {
    transform: scale(0.95);
}

.music-button.playing {
    animation: musicPulse 1.5s ease-in-out infinite;
}

@keyframes musicPulse {
    0%, 100% {
        box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 8px 30px rgba(102, 126, 234, 0.8);
    }
}

.music-info {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#currentTrack {
    font-size: 0.9em;
    color: #333;
    font-weight: 500;
    min-width: 200px;
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.volume-icon {
    font-size: 18px;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 120px;
    height: 6px;
    background: linear-gradient(to right, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
    outline: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.volume-slider:hover {
    opacity: 1;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
    transition: all 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.8);
}

.volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border-radius: 50%;
    border: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.5);
    transition: all 0.2s ease;
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.8);
}

.volume-value {
    font-size: 0.85em;
    color: #667eea;
    font-weight: 600;
    min-width: 40px;
}

.next-button {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}

.next-button:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.next-button:active {
    transform: scale(0.95);
}

/* Responsive Design */
@media (max-width: 768px) {
    .solar-panel {
        width: 300px;
        height: 380px;
    }

    .eyes {
        gap: 60px;
        margin-bottom: 30px;
    }

    .eye {
        width: 40px;
        height: 50px;
    }

    .pupil {
        width: 18px;
        height: 18px;
        top: 16px;
        left: 11px;
    }

    .mouth {
        width: 80px;
        height: 40px;
    }

    .mouth-shape {
        width: 80px;
        height: 40px;
    }

    .speech-bubble {
        bottom: 80px;
    }

    #responseText {
        font-size: 1.1em;
    }

    .floating-controls {
        bottom: 20px;
        right: 20px;
        gap: 10px;
    }

    .mic-button-float {
        width: 60px;
        height: 60px;
        font-size: 1.8em;
    }

    .toggle-text-button,
    .settings-button {
        width: 45px;
        height: 45px;
        font-size: 1.3em;
    }

    #textInput {
        width: 180px;
    }

    .settings-panel-full {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .solar-panel {
        width: 260px;
        height: 330px;
    }

    .panel-grid {
        gap: 6px;
        padding: 12px;
    }

    .eyes {
        gap: 50px;
    }

    .speech-bubble {
        bottom: 70px;
        padding: 20px;
    }

    #responseText {
        font-size: 1em;
    }
}
