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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
}

.container {
    text-align: center;
    padding: 2rem;
    max-width: 400px;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: #e94560;
}

.subtitle {
    color: #a0a0a0;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.status-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

#status {
    font-size: 1rem;
    color: #a0a0a0;
    margin-bottom: 0.5rem;
}

#status.connected {
    color: #4ade80;
}

#status.connecting {
    color: #fbbf24;
}

#status.error {
    color: #ef4444;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #4a4a4a;
    display: inline-block;
    margin-right: 8px;
    animation: none;
}

.indicator.active {
    background: #4ade80;
    animation: pulse 1.5s infinite;
}

.indicator.connecting {
    background: #fbbf24;
    animation: pulse 0.5s infinite;
}

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

#startBtn {
    background: linear-gradient(135deg, #e94560 0%, #c73659 100%);
    color: white;
    border: none;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.3);
}

#startBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(233, 69, 96, 0.4);
}

#startBtn:disabled {
    background: linear-gradient(135deg, #4a4a4a 0%, #3a3a3a 100%);
    cursor: not-allowed;
    box-shadow: none;
}

#muteBtn {
    background: transparent;
    color: #fbbf24;
    border: 2px solid #fbbf24;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    margin-right: 0.5rem;
    display: none;
}

#muteBtn:hover {
    background: #fbbf24;
    color: #1a1a2e;
}

#muteBtn.muted {
    background: #fbbf24;
    color: #1a1a2e;
}

#stopBtn {
    background: transparent;
    color: #ef4444;
    border: 2px solid #ef4444;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    display: none;
}

#stopBtn:hover {
    background: #ef4444;
    color: white;
}

.transcript {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1.5rem;
    max-height: 200px;
    overflow-y: auto;
    text-align: left;
    font-size: 0.9rem;
    display: none;
}

.transcript.visible {
    display: block;
}

.transcript p {
    margin: 0.5rem 0;
    padding: 0.5rem;
    border-radius: 8px;
}

.transcript .user {
    background: rgba(233, 69, 96, 0.2);
    color: #e94560;
}

.transcript .assistant {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

.footer {
    margin-top: 2rem;
    color: #666;
    font-size: 0.8rem;
}

.voice-selector {
    margin-bottom: 1.5rem;
}

.voice-selector label {
    display: block;
    margin-bottom: 0.5rem;
    color: #a0a0a0;
    font-size: 0.9rem;
}

.voice-selector select {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    cursor: pointer;
    width: 100%;
    max-width: 280px;
}

.voice-selector select:focus {
    outline: none;
    border-color: #e94560;
}

.voice-selector select option,
.voice-selector select optgroup {
    background: #1a1a2e;
    color: #fff;
}

.settings-panel {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.settings-toggle {
    cursor: pointer;
    padding: 0.75rem 1rem;
    color: #a0a0a0;
    font-size: 0.85rem;
    font-weight: 500;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
    transition: color 0.2s;
}

.settings-toggle:hover {
    color: #e94560;
}

.settings-toggle::before {
    content: '\25B6';
    font-size: 0.65rem;
    transition: transform 0.2s;
}

.settings-panel[open] .settings-toggle::before {
    transform: rotate(90deg);
}

.settings-toggle::-webkit-details-marker {
    display: none;
}

.settings-content {
    padding: 0 1rem 1rem;
}

.settings-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 0.75rem 0;
}

.settings-section-label {
    color: #888;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.setting-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0.6rem 0;
    gap: 0.4rem;
}

.setting-row label {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex-shrink: 0;
    text-align: left;
}

.setting-row label > span:first-child {
    color: #ccc;
    font-size: 0.85rem;
    font-weight: 500;
}

.setting-hint {
    color: #666;
    font-size: 0.7rem;
    font-weight: 400;
}

.toggle-label {
    flex: 1;
}

.setting-row .switch {
    align-self: flex-start;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    transition: background 0.2s;
}

.switch .slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.switch input:checked + .slider {
    background: #e94560;
}

.switch input:checked + .slider::before {
    transform: translateX(20px);
}

.number-input {
    width: 100%;
    padding: 0.5rem 0.65rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: #e94560;
    font-size: 0.85rem;
    font-family: 'Monaco', 'Menlo', monospace;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.number-input:focus {
    border-color: #e94560;
}

.number-input::-webkit-inner-spin-button,
.number-input::-webkit-outer-spin-button {
    opacity: 1;
}

.conversation-id-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.conversation-id-label {
    color: #a0a0a0;
    margin-right: 0.5rem;
}

.conversation-id {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    color: #e94560;
    word-break: break-all;
}

.feedback-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    text-align: left;
}

.feedback-section h3 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    text-align: center;
}

.feedback-conv-id {
    color: #a0a0a0;
    font-size: 0.8rem;
    margin-bottom: 1rem;
    text-align: center;
}

.feedback-conv-id code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    color: #e94560;
    font-size: 0.75rem;
    word-break: break-all;
}

.feedback-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    min-height: 120px;
    margin-bottom: 1rem;
}

.feedback-textarea:focus {
    outline: none;
    border-color: #e94560;
}

.feedback-textarea::placeholder {
    color: #666;
}

.feedback-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    color: #1a1a2e;
    border: none;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.feedback-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(74, 222, 128, 0.3);
}

.feedback-submit-btn:disabled {
    background: linear-gradient(135deg, #4a4a4a 0%, #3a3a3a 100%);
    color: #888;
    cursor: not-allowed;
}

.feedback-status {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

.feedback-status.success {
    display: block;
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

.feedback-status.error {
    display: block;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.feedback-status.loading {
    display: block;
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}
