/* voice-studio.css — Premium Voice Call UI */

/* ─── Layout ──────────────────────────────────────────────────────── */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    background: var(--bg-color);
    overflow: hidden;
}

.voice-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--bg-color);
    position: relative;
    overflow-y: auto;
}

.voice-content {
    padding: 40px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ─── Dashboard Header ────────────────────────────────────────────── */
.dashboard-header {
    text-align: center;
    margin-bottom: 50px;
}
.dashboard-header h1 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}
.dashboard-header h1 i { color: var(--accent-primary); }
.dashboard-header p { color: var(--text-secondary); font-size: 1.1rem; }

/* ─── Persona Cards ───────────────────────────────────────────────── */
.personas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}
.persona-card {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 18px;
    padding: 28px 24px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    --persona-color: #7c3aed;
}
.persona-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(124,58,237,0.08), rgba(79,70,229,0.04));
    opacity: 0;
    transition: opacity 0.3s;
}
.persona-card:hover { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(0,0,0,0.4); border-color: rgba(var(--persona-color-rgb, 124 58 237), 0.35); }
.persona-card:hover::after { opacity: 1; }

.persona-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--persona-color, #7c3aed) 25%, transparent), color-mix(in srgb, var(--persona-color, #4f46e5) 15%, transparent));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border: 1px solid color-mix(in srgb, var(--persona-color, #7c3aed) 30%, transparent);
}
.persona-icon { font-size: 1.7rem; color: var(--persona-color, var(--accent-primary)); }
.persona-card h3 { margin: 0 0 8px; color: var(--text-primary); font-size: 1.1rem; font-weight: 600; }
.persona-card p { color: var(--text-secondary); font-size: 0.85rem; line-height: 1.5; margin: 0; }

.persona-card .start-badge {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(124,58,237,0.15);
    color: var(--accent-primary);
    border: 1px solid rgba(124,58,237,0.25);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    opacity: 0;
    transform: translateX(6px);
    transition: opacity 0.2s, transform 0.2s;
}
.persona-card:hover .start-badge { opacity: 1; transform: translateX(0); }

/* ─── Simulator Panel (slides up from bottom) ─────────────────────── */
.simulator-panel {
    position: fixed;
    bottom: -100%;
    left: 260px;
    right: 0;
    height: 440px;
    background: rgba(10, 14, 26, 0.97);
    backdrop-filter: blur(24px);
    border-top: 1px solid rgba(124,58,237,0.25);
    box-shadow: 0 -16px 60px rgba(0,0,0,0.6);
    transition: bottom 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    display: flex;
    flex-direction: column;
}
.simulator-panel.open { bottom: 0; }

/* ─── Simulator Header ────────────────────────────────────────────── */
.simulator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}
.simulator-header h3 {
    margin: 0;
    color: #a78bfa;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
}
.sim-lang-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Language select pill */
.voice-select {
    background: rgba(124,58,237,0.12);
    border: 1px solid rgba(124,58,237,0.3);
    color: #a78bfa;
    padding: 5px 10px;
    font-size: 0.82rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    border-radius: 20px;
    max-width: 155px;
}
.voice-select option { background: #1a1f35; color: white; }

/* Live indicator dot */
.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,0.2);
    animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(34,197,94,0.2); }
    50%       { box-shadow: 0 0 0 6px rgba(34,197,94,0.08); }
}

/* ─── Conversation Log ────────────────────────────────────────────── */
.conversation-log {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: rgba(124,58,237,0.2) transparent;
}
.conversation-log::-webkit-scrollbar { width: 4px; }
.conversation-log::-webkit-scrollbar-thumb { background: rgba(124,58,237,0.3); border-radius: 4px; }

.conv-hint {
    color: rgba(255,255,255,0.3);
    font-size: 0.82rem;
    text-align: center;
    padding: 30px 0 10px;
    letter-spacing: 0.01em;
}

/* ─── Chat Bubbles ────────────────────────────────────────────────── */
.conv-bubble {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    max-width: 80%;
    animation: bubbleIn 0.22s ease;
}
@keyframes bubbleIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.bubble-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.bubble-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bubble-text {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.5;
}

/* User bubble — right side */
.user-bubble {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.user-bubble .bubble-avatar {
    background: rgba(79,70,229,0.25);
    color: #818cf8;
    border: 1px solid rgba(79,70,229,0.3);
}
.user-bubble .bubble-text {
    background: linear-gradient(135deg, #4f46e5, #6d28d9);
    color: white;
    border-bottom-right-radius: 4px;
}

/* AI bubble — left side */
.ai-bubble {
    align-self: flex-start;
}
.ai-bubble .bubble-avatar {
    background: rgba(124,58,237,0.15);
    color: #a78bfa;
    border: 1px solid rgba(124,58,237,0.25);
}
.ai-bubble .bubble-text {
    background: rgba(30, 37, 60, 0.85);
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.07);
    border-bottom-left-radius: 4px;
}

/* ─── WhatsApp Voice Note inside AI Bubble ────────────────────────── */
.wa-voice-note {
    background: linear-gradient(135deg, #0d3b2e, #005c4b);
    border-radius: 16px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 260px;
    max-width: 100%;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.wa-play-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.wa-play-btn:hover { background: rgba(255,255,255,0.25); }
.wa-waveform-container {
    flex: 1;
    position: relative;
    height: 18px;
    border-radius: 8px;
    background: repeating-linear-gradient(
        90deg,
        rgba(255,255,255,0.3) 0px, rgba(255,255,255,0.3) 2px,
        transparent 2px, transparent 5px
    );
}
.wa-scrubber {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    z-index: 2;
}
.wa-scrubber::-webkit-slider-runnable-track { background: transparent; cursor: pointer; }
.wa-scrubber::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 13px; width: 13px;
    border-radius: 50%;
    background: #34B7F1;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.wa-time {
    color: rgba(255,255,255,0.65);
    font-size: 0.75rem;
    min-width: 30px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ─── Voice Control Area ──────────────────────────────────────────── */
.voice-control-area {
    padding: 14px 24px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    border-top: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
    background: rgba(5, 8, 18, 0.5);
}

.ai-status-bar { font-size: 0.8rem; color: rgba(255,255,255,0.4); display: flex; align-items: center; gap: 7px; letter-spacing: 0.02em; height: 20px; transition: color 0.3s; }
.ai-status-bar.active    { color: #a78bfa; }
.ai-status-bar.listening { color: #f87171; }
.ai-status-bar.ready     { color: #34d399; }
.ai-status-bar.searching { color: #38bdf8; animation: searchPulse 1.5s ease-in-out infinite; }
@keyframes searchPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ─── Mic Button ──────────────────────────────────────────────────── */
.mic-btn {
    position: relative;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(145deg, #7c3aed, #4f46e5);
    border: none;
    color: white;
    font-size: 1.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 0 rgba(124,58,237,0.4), 0 8px 30px rgba(124,58,237,0.35);
    transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.18s;
}
.mic-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 0 0 0 rgba(124,58,237,0.4), 0 12px 40px rgba(124,58,237,0.55);
}
.mic-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.mic-btn.recording {
    background: linear-gradient(145deg, #dc2626, #b91c1c);
    box-shadow: 0 0 0 0 rgba(220,38,38,0.4), 0 8px 30px rgba(220,38,38,0.4);
}

/* Outer ring when recording */
.mic-pulse {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2.5px solid rgba(239,68,68,0.5);
    opacity: 0;
    pointer-events: none;
}
.mic-pulse.active { animation: pulseRing 1.1s ease-out infinite; }
@keyframes pulseRing {
    0%   { opacity: 0.9; transform: scale(1); }
    100% { opacity: 0;   transform: scale(1.55); }
}

/* Second ring for double-pulse effect */
.mic-btn.recording::after {
    content: '';
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    border: 2px solid rgba(239,68,68,0.2);
    animation: pulseRing 1.1s 0.35s ease-out infinite;
}

.mic-hint {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.25);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ─── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .simulator-panel { left: 0; }
    .personas-grid { grid-template-columns: 1fr 1fr; }
}
