/* Conversational AI Interface Styles */

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

:root {
    --primary-color: #007AFF;
    --secondary-color: #5856D6;
    --success-color: #34C759;
    --error-color: #FF3B30;
    --background: #000000;
    --surface: #1C1C1E;
    --surface-elevated: #2C2C2E;
    --text-primary: #FFFFFF;
    --text-secondary: #98989D;
    --border-color: #38383A;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #000000 0%, #1a1a2e 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

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

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.home-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.home-button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo h1 {
    font-size: 24px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--surface);
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.connected {
    background: var(--success-color);
}

.status-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Main Content */
.main-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
}

.voice-interface {
    text-align: center;
    width: 100%;
    max-width: 600px;
}

/* Status Container */
.status-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.status,
.speaking-status {
    padding: 12px 24px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.status.connected {
    background: rgba(52, 199, 89, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
}

.speaking-status.speaking {
    background: rgba(0, 122, 255, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
    animation: pulse-border 1.5s ease-in-out infinite;
}

/* Voice Visualizer */
.voice-visualizer {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 60px 0;
}

.voice-circle {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.1), rgba(88, 86, 214, 0.1));
    border: 2px solid rgba(0, 122, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.voice-circle.listening {
    animation: pulse-listening 2s ease-in-out infinite;
    border-color: var(--success-color);
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.1), rgba(88, 86, 214, 0.1));
}

.voice-circle.speaking {
    animation: pulse-speaking 1s ease-in-out infinite;
    border-color: var(--primary-color);
    box-shadow: 0 0 40px rgba(0, 122, 255, 0.4);
}

.voice-button {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
    box-shadow: 0 8px 32px rgba(0, 122, 255, 0.3);
}

.voice-button:hover {
    transform: scale(1.05);
}

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

.mic-icon {
    color: white;
    width: 64px;
    height: 64px;
}

/* Controls */
.controls {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin: 40px 0;
    flex-wrap: wrap;
}

.button {
    padding: 14px 32px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.button.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
}

.button.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}

.button.secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.button.secondary:hover:not(:disabled) {
    background: var(--surface-elevated);
    border-color: var(--primary-color);
}

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

.button:active:not(:disabled) {
    transform: scale(0.98);
}

/* Info Text */
.info-text {
    margin-top: 40px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.info-text p {
    margin: 8px 0;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 20px;
    font-size: 16px;
    color: var(--text-primary);
}

/* Error Toast */
.error-toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--error-color);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(255, 59, 48, 0.3);
    transition: bottom 0.3s ease;
    z-index: 1001;
    max-width: 90%;
}

.error-toast.show {
    bottom: 30px;
}

.error-message {
    font-size: 14px;
    font-weight: 500;
}

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

@keyframes pulse-border {
    0%, 100% {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 rgba(0, 122, 255, 0.4);
    }
    50% {
        border-color: var(--secondary-color);
        box-shadow: 0 0 20px rgba(88, 86, 214, 0.6);
    }
}

@keyframes pulse-listening {
    0%, 100% {
        box-shadow: 0 0 0 rgba(52, 199, 89, 0);
    }
    50% {
        box-shadow: 0 0 30px rgba(52, 199, 89, 0.4);
    }
}

@keyframes pulse-speaking {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
/* Transcript Panel */
.transcript-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--border-color);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.transcript-panel.open {
    transform: translateX(0);
}

.transcript-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-elevated);
}

.transcript-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.transcript-controls {
    display: flex;
    gap: 10px;
}

.transcript-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.transcript-btn:hover {
    background: var(--surface-elevated);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.transcript-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.transcript-content::-webkit-scrollbar {
    width: 6px;
}

.transcript-content::-webkit-scrollbar-track {
    background: transparent;
}

.transcript-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.transcript-placeholder {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 50px;
}

.transcript-message {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 12px;
    animation: fadeInUp 0.3s ease;
}

.transcript-message.user {
    background: var(--primary-color);
    color: white;
    margin-left: 40px;
}

.transcript-message.assistant {
    background: var(--surface-elevated);
    color: var(--text-primary);
    margin-right: 40px;
}

.transcript-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    opacity: 0.7;
}

.transcript-message-content {
    line-height: 1.5;
}

.transcript-toggle-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 122, 255, 0.3);
    transition: all 0.3s ease;
    z-index: 999;
}

.transcript-toggle-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 122, 255, 0.4);
}

.transcript-toggle-fab.hidden {
    display: none;
}

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

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .voice-circle {
        width: 160px;
        height: 160px;
    }

    .voice-button {
        width: 100px;
        height: 100px;
    }

    .mic-icon {
        width: 48px;
        height: 48px;
    }

    .controls {
        flex-direction: column;
    }

    .button {
        width: 100%;
    }
    
    /* Transcript responsive */
    .transcript-panel {
        width: 100%;
        height: 70vh;
        top: auto;
        bottom: 0;
        transform: translateY(100%);
        border-left: none;
        border-top: 1px solid var(--border-color);
        border-radius: 20px 20px 0 0;
    }
    
    .transcript-panel.open {
        transform: translateY(0);
    }
    
    .transcript-toggle-fab {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
}
