/**
 * Speech-to-Animation Demo Styles
 * SignBridge Brand Colors
 */

:root {
    --deep-navy: #0D1B2A;
    --ocean-blue: #1B3A4B;
    --teal: #62B6CB;
    --coral: #FF6B6B;
    --white: #FFFFFF;
    --light-gray: #F5F5F5;
    --success: #4CAF50;
    --warning: #FF9800;
    --error: #F44336;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--deep-navy) 0%, var(--ocean-blue) 100%);
    color: var(--white);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.demo-header {
    background: rgba(13, 27, 42, 0.9);
    padding: 30px 0;
    border-bottom: 3px solid var(--teal);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.demo-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--teal);
}

.demo-header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.settings-btn {
    background: rgba(98, 182, 203, 0.2);
    border: 2px solid var(--teal);
    color: var(--teal);
    font-size: 1.8rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-btn:hover {
    background: var(--teal);
    transform: rotate(90deg) scale(1.1);
}

/* Main Content */
.demo-main {
    padding: 40px 0;
}

/* Avatar Section */
.avatar-section {
    margin-bottom: 40px;
}

#avatar-container {
    width: 100%;
    height: 600px;
    background: linear-gradient(135deg, #0D1B2A 0%, #1B3A4B 100%);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
}

#avatar-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Loading Indicator */
.avatar-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--teal);
    font-size: 18px;
    font-weight: 600;
    z-index: 10;
    pointer-events: none;
}

.avatar-loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Gesture Info Overlay */
.gesture-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(13, 27, 42, 0.9);
    color: var(--teal);
    padding: 12px 20px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    border: 1px solid var(--teal);
    backdrop-filter: blur(10px);
}

/* Camera Controls Hint */
.controls-hint {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(13, 27, 42, 0.8);
    color: var(--white);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    opacity: 0.7;
}

/* Controls Section */
.controls-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

/* Status Display */
.status-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    background: rgba(13, 27, 42, 0.6);
    border-radius: 10px;
    margin-bottom: 20px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.status-display.status-listening {
    border-color: var(--teal);
    background: rgba(98, 182, 203, 0.1);
}

.status-display.status-processing {
    border-color: var(--warning);
    background: rgba(255, 152, 0, 0.1);
}

.status-display.status-error {
    border-color: var(--error);
    background: rgba(244, 67, 54, 0.1);
}

.status-icon {
    font-size: 2rem;
}

.status-text {
    font-size: 1.3rem;
    font-weight: 600;
}

/* Control Buttons */
.control-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.btn {
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--teal);
    color: var(--deep-navy);
}

.btn-primary:hover:not(:disabled) {
    background: #4da6bc;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(98, 182, 203, 0.4);
}

.btn-secondary {
    background: var(--coral);
    color: var(--white);
}

.btn-secondary:hover:not(:disabled) {
    background: #ff5252;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
}

/* Transcript Display */
.transcript-display,
.gesture-display {
    background: rgba(13, 27, 42, 0.6);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.transcript-display h3,
.gesture-display h3 {
    color: var(--teal);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.transcript-text {
    font-size: 1.1rem;
    line-height: 1.6;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    min-height: 60px;
}

/* Gesture List */
.gesture-list {
    font-size: 1.1rem;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    min-height: 50px;
}

.gesture-badge {
    display: inline-block;
    background: var(--teal);
    color: var(--deep-navy);
    padding: 5px 15px;
    border-radius: 20px;
    margin: 5px;
    font-weight: 600;
}

/* Confidence Score */
.confidence-score {
    margin-top: 15px;
}

.confidence-bar {
    height: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.confidence-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.5s ease;
}

.confidence-bar.confidence-medium .confidence-fill {
    background: var(--warning);
}

.confidence-bar.confidence-low .confidence-fill {
    background: var(--error);
}

.confidence-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    color: var(--white);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Examples Section */
.examples-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.examples-section h3 {
    color: var(--teal);
    margin-bottom: 20px;
    text-align: center;
}

.example-phrases {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.example-btn {
    background: rgba(98, 182, 203, 0.2);
    border: 2px solid var(--teal);
    color: var(--white);
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.example-btn:hover {
    background: var(--teal);
    color: var(--deep-navy);
    transform: translateY(-2px);
}

/* Info Section */
.info-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 30px;
}

.info-section h3 {
    color: var(--teal);
    margin-bottom: 25px;
    text-align: center;
}

.info-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.step {
    display: flex;
    gap: 15px;
    padding: 20px;
    background: rgba(13, 27, 42, 0.6);
    border-radius: 10px;
    border-left: 4px solid var(--teal);
}

.step-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: var(--teal);
    color: var(--deep-navy);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
}

.step-content h4 {
    color: var(--teal);
    margin-bottom: 8px;
}

.step-content p {
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.5;
}

/* Footer */
.demo-footer {
    background: rgba(13, 27, 42, 0.9);
    padding: 30px 0;
    text-align: center;
    margin-top: 50px;
    border-top: 3px solid var(--teal);
}

.demo-footer p {
    opacity: 0.8;
    line-height: 1.8;
}

.demo-footer small {
    opacity: 0.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .demo-header h1 {
        font-size: 1.8rem;
    }

    .demo-header p {
        font-size: 1rem;
    }

    .header-content {
        flex-direction: row;
        align-items: center;
    }

    .settings-btn {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .settings-panel {
        width: 90%;
        right: 5%;
        top: 80px;
    }

    #avatar-container {
        height: 400px;
    }

    .control-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .example-phrases {
        flex-direction: column;
    }

    .example-btn {
        width: 100%;
    }

    .info-steps {
        grid-template-columns: 1fr;
    }

    .gesture-info,
    .controls-hint {
        font-size: 11px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .demo-header h1 {
        font-size: 1.5rem;
    }

    #avatar-container {
        height: 300px;
    }

    .status-icon {
        font-size: 1.5rem;
    }

    .status-text {
        font-size: 1rem;
    }
}

/* Settings Panel */
.settings-panel {
    position: fixed;
    top: 100px;
    right: 20px;
    width: 350px;
    background: rgba(13, 27, 42, 0.98);
    border: 2px solid var(--teal);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.settings-panel.hidden {
    transform: translateX(400px);
    opacity: 0;
    pointer-events: none;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid var(--teal);
}

.settings-header h3 {
    margin: 0;
    color: var(--teal);
    font-size: 1.3rem;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--coral);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    transition: transform 0.2s ease;
}

.close-btn:hover {
    transform: scale(1.2);
}

.settings-content {
    padding: 20px;
}

.setting-item {
    margin-bottom: 25px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    display: block;
    color: var(--teal);
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

/* Language Toggle */
.language-toggle {
    display: flex;
    gap: 10px;
}

.lang-btn {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(98, 182, 203, 0.3);
    color: var(--white);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: rgba(98, 182, 203, 0.1);
    border-color: var(--teal);
}

.lang-btn.active {
    background: var(--teal);
    color: var(--deep-navy);
    border-color: var(--teal);
    box-shadow: 0 4px 12px rgba(98, 182, 203, 0.4);
}

/* Status Indicator */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

.status-dot.loading {
    background: var(--warning);
}

.status-dot.ready {
    background: var(--success);
    animation: none;
}

.status-dot.error {
    background: var(--error);
    animation: none;
}

.status-text {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid rgba(98, 182, 203, 0.2);
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    opacity: 0.7;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--teal);
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

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

.status-display.status-listening .status-icon {
    animation: pulse 1.5s ease-in-out infinite;
}
