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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    padding-bottom: 120px; /* Space for context bar at bottom */
    gap: 15px;
}

.status {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
    text-align: center;
    transition: color 0.3s ease;
}

.status.active {
    color: #000;
}

.status.listening {
    color: #007AFF;
}

.status.speaking {
    color: #34C759;
}

.status.ptt-active {
    color: #FF9500;
}

.status.reconnecting {
    color: #FF3B30;
}

/* Disabled state for PTT button before connection */
.ptt-button.disabled {
    opacity: 0.4;
    pointer-events: none;
    background: #ccc;
}

.ptt-button.disabled::after {
    content: '🔒';
    position: absolute;
    font-size: 20px;
}

.call-button, .ptt-button {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: none;
    background: #000;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.call-button:hover, .ptt-button:hover {
    transform: scale(1.05);
}

.call-button:active, .ptt-button:active {
    transform: scale(0.95);
}

.call-button.active {
    background: #FF3B30;
}

.call-button.listening {
    background: #007AFF;
}

.call-button.speaking {
    background: #34C759;
}

/* Push-to-talk button styles */
.ptt-button {
    background: #333;
}

.ptt-button.recording {
    background: #FF9500;
    transform: scale(1.1);
}

.ptt-button.processing {
    background: #007AFF;
}

.ptt-button.speaking {
    background: #34C759;
}

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

.button-label {
    font-size: 14px;
    color: #999;
    margin-top: -5px;
}

.button-divider {
    width: 60px;
    height: 2px;
    background: #eee;
    margin: 10px 0;
}

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

.wave-container {
    display: flex;
    gap: 8px;
    height: 40px;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wave-container.active {
    opacity: 1;
}

.wave {
    width: 4px;
    height: 20px;
    background: #007AFF;
    border-radius: 2px;
    animation: wave 1s ease-in-out infinite;
}

.wave:nth-child(2) {
    animation-delay: 0.1s;
}

.wave:nth-child(3) {
    animation-delay: 0.2s;
}

@keyframes wave {
    0%, 100% {
        height: 20px;
    }
    50% {
        height: 40px;
    }
}

/* PWA standalone mode adjustments */
@media (display-mode: standalone) {
    .container {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Context section - iOS style */
.context-section {
    position: fixed;
    bottom: 40px;
    left: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.context-bar {
    width: 100%;
    height: 10px;
    background: #e5e5e5;
    border-radius: 5px;
    overflow: hidden;
}

.context-fill {
    height: 100%;
    background: #000;
    border-radius: 5px;
    transition: width 0.5s ease, background 0.3s ease;
    width: 0%;
}

.context-fill.warning {
    background: #FF9500;
}

.context-fill.danger {
    background: #FF3B30;
}

.reset-button {
    align-self: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    background: #000;
    border: none;
    border-radius: 10px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.reset-button:hover {
    background: #333;
}

.reset-button:active {
    transform: scale(0.98);
    background: #222;
}

.reset-button.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* PIN Screen */
.pin-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.pin-screen.hidden {
    display: none;
}

.pin-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px;
}

.pin-title {
    font-size: 24px;
    font-weight: 600;
    color: #000;
}

.pin-input {
    width: 120px;
    padding: 16px;
    font-size: 24px;
    text-align: center;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    outline: none;
    -webkit-appearance: none;
}

.pin-input:focus {
    border-color: #007AFF;
}

.pin-button {
    padding: 14px 32px;
    font-size: 17px;
    font-weight: 600;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 12px;
    cursor: pointer;
}

.pin-button:active {
    background: #333;
}

.pin-error {
    color: #FF3B30;
    font-size: 14px;
    min-height: 20px;
}
