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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0a1628 0%, #1a2a4a 50%, #0d1f3c 100%);
    color: #e0e0e0;
    min-height: 100vh;
}

.container {
    max-width: 700px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem;
}

header {
    text-align: center;
    margin-bottom: 1.5rem;
}

header h1 {
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 0.3rem;
}

.subtitle {
    color: #7eb8e0;
    font-size: 1rem;
}

/* Mode selector */
.mode-selector {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.mode-btn {
    flex: 1;
    max-width: 200px;
    padding: 0.8rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: #8899aa;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.mode-btn .mode-desc {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    margin-top: 0.2rem;
    opacity: 0.7;
}

.mode-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.mode-btn.active {
    border-color: #4FC3F7;
    background: rgba(79, 195, 247, 0.15);
    color: #fff;
}

/* Status orb */
.status-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 1.5rem 0;
}

.orb {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #2a3a5a, #1a2540);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.orb-inner {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #3a4a6a, #2a3550);
    transition: all 0.3s ease;
}

/* Idle */
.orb.idle {
    background: radial-gradient(circle at 30% 30%, #2a3a5a, #1a2540);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Recording - red pulse */
.orb.recording {
    background: radial-gradient(circle at 30% 30%, #e53935, #b71c1c);
    box-shadow: 0 0 40px rgba(229, 57, 53, 0.5);
    animation: pulse 1s infinite;
}

.orb.recording .orb-inner {
    background: radial-gradient(circle at 30% 30%, #ef5350, #e53935);
}

/* Processing - orange spin */
.orb.processing {
    background: radial-gradient(circle at 30% 30%, #FF9800, #E65100);
    box-shadow: 0 0 40px rgba(255, 152, 0, 0.5);
    animation: spin 2s linear infinite;
}

.orb.processing .orb-inner {
    background: radial-gradient(circle at 30% 30%, #FFA726, #FB8C00);
}

/* Speaking - green pulse */
.orb.speaking {
    background: radial-gradient(circle at 30% 30%, #4CAF50, #2E7D32);
    box-shadow: 0 0 40px rgba(76, 175, 80, 0.5);
    animation: pulse-fast 0.5s infinite;
}

.orb.speaking .orb-inner {
    background: radial-gradient(circle at 30% 30%, #66BB6A, #43A047);
}

/* Error */
.orb.error {
    background: radial-gradient(circle at 30% 30%, #f44336, #c62828);
    box-shadow: 0 0 40px rgba(244, 67, 54, 0.5);
}

.orb.error .orb-inner {
    background: radial-gradient(circle at 30% 30%, #ef5350, #e53935);
}

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

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.status-text {
    margin-top: 0.8rem;
    font-size: 1rem;
    color: #7eb8e0;
    text-align: center;
}

/* Push-to-talk button */
.ptt-area {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

.btn-ptt {
    width: 100%;
    max-width: 400px;
    padding: 1.2rem 2rem;
    border: none;
    border-radius: 16px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #4FC3F7, #0288D1);
    color: white;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.btn-ptt:hover:not(:disabled) {
    background: linear-gradient(135deg, #81D4FA, #0277BD);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 195, 247, 0.4);
}

.btn-ptt:active:not(:disabled) {
    transform: scale(0.98);
}

/* Stop button */
.btn-ptt.btn-stop {
    background: linear-gradient(135deg, #e53935, #b71c1c);
}

.btn-ptt.btn-stop:hover:not(:disabled) {
    background: linear-gradient(135deg, #ef5350, #c62828);
    box-shadow: 0 6px 20px rgba(229, 57, 53, 0.4);
}

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

/* Transcript */
.transcript-area {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.2rem;
    margin: 1.5rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.transcript-area h3 {
    color: #7eb8e0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.8rem;
}

.transcript-messages {
    max-height: 350px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

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

.transcript-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.placeholder {
    color: #556;
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

.message {
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
}

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

.message.user {
    background: rgba(79, 195, 247, 0.12);
    border-left: 3px solid #4FC3F7;
    margin-left: 1rem;
}

.message.assistant {
    background: rgba(76, 175, 80, 0.12);
    border-left: 3px solid #4CAF50;
    margin-right: 1rem;
}

.message .role {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #778;
    margin-bottom: 0.3rem;
}

/* Correction cards */
.correction-card {
    margin: 0.5rem 0 0.5rem 1rem;
    padding: 0.8rem 1rem;
    background: rgba(255, 152, 0, 0.08);
    border: 1px solid rgba(255, 152, 0, 0.2);
    border-left: 3px solid #FF9800;
    border-radius: 10px;
    animation: fadeIn 0.4s ease;
}

.correction-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.correction-original {
    color: #ef5350;
    text-decoration: line-through;
    font-style: italic;
}

.correction-arrow {
    color: #FF9800;
    font-weight: bold;
}

.correction-fixed {
    color: #66BB6A;
    font-weight: 600;
}

.correction-explanation {
    font-size: 0.85rem;
    color: #a0a0b8;
    font-style: italic;
    line-height: 1.4;
}

/* Demo section */
.demo-section {
    margin-top: 1.5rem;
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.demo-section h3 {
    color: #7eb8e0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.3rem;
}

.demo-info {
    color: #667;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.demo-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.btn-demo {
    padding: 0.7rem 1.2rem;
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #7c4dff, #536dfe);
    color: white;
}

.btn-demo:hover:not(:disabled) {
    background: linear-gradient(135deg, #9c7cff, #738ffe);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(124, 77, 255, 0.4);
}

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

/* New conversation button */
.btn-new {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #78909C, #546E7A);
    color: white;
    margin-top: 1rem;
}

.btn-new:hover {
    background: linear-gradient(135deg, #90A4AE, #607D8B);
    transform: translateY(-2px);
}

/* Footer */
footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #445;
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }
    header h1 {
        font-size: 1.5rem;
    }
    .orb {
        width: 80px;
        height: 80px;
    }
    .orb-inner {
        width: 52px;
        height: 52px;
    }
    .btn-ptt {
        font-size: 1.1rem;
        padding: 1rem 1.5rem;
    }
    .transcript-messages {
        max-height: 250px;
    }
}
