/* CSS Variables for Premium Design System */
:root {
    --bg-primary: #070913;
    --bg-secondary: rgba(15, 22, 42, 0.45);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-hover: rgba(255, 255, 255, 0.15);
    
    --color-primary: #0df2c9; /* Electric Maldives Teal */
    --color-primary-glow: rgba(13, 242, 201, 0.25);
    --color-secondary: #00b4d8; /* Deep Ocean Cyan */
    --color-secondary-glow: rgba(0, 180, 216, 0.25);
    
    --color-active: #ff3b6b; /* Sunset Pink/Red for active call/hangup */
    --color-active-glow: rgba(255, 59, 107, 0.3);
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-cyan: #38bdf8;
    
    --font-outfit: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-inter: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset and Layout */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    font-family: var(--font-inter);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Atmospheric Glow Effects */
.background-glows {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.45;
    mix-blend-mode: screen;
    animation: floatGlow 18s ease-in-out infinite alternate;
}

.glow-1 {
    width: 500px;
    height: 500px;
    top: -10%;
    left: -10%;
    background: radial-gradient(circle, var(--color-primary) 0%, transparent 80%);
}

.glow-2 {
    width: 600px;
    height: 600px;
    bottom: -10%;
    right: -10%;
    background: radial-gradient(circle, var(--color-secondary) 0%, transparent 80%);
    animation-delay: -5s;
    animation-duration: 24s;
}

@keyframes floatGlow {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(80px, 50px) scale(1.15);
    }
}

/* App Main Container */
.app-container {
    width: 100%;
    max-width: 800px;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    z-index: 10;
}

/* Typography & Header styling */
.header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

.badge {
    background: rgba(13, 242, 201, 0.1);
    border: 1px solid rgba(13, 242, 201, 0.3);
    color: var(--color-primary);
    padding: 0.35rem 1rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(13, 242, 201, 0.1);
}

.header h1 {
    font-family: var(--font-outfit);
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 40%, #a5f3fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 500px;
    line-height: 1.6;
}

/* Glassmorphism Card Container */
.card-container {
    width: 100%;
    perspective: 1000px;
}

.glass-card {
    background: var(--bg-secondary);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--border-glass);
    border-radius: 28px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    transition: var(--transition-smooth);
}

.glass-card:hover {
    border-color: var(--border-glass-hover);
    box-shadow: 0 30px 60px -10px rgba(13, 242, 201, 0.05), 
                0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

/* Session Status */
.session-status {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.status-indicator {
    width: 8px;
    height: 8px;
    background-color: var(--text-muted);
    border-radius: 50%;
    position: relative;
    transition: var(--transition-smooth);
}

/* Status Modes */
.glass-card.is-active .status-indicator {
    background-color: var(--color-primary);
    box-shadow: 0 0 12px var(--color-primary);
}

.glass-card.is-active .status-indicator::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 2px solid var(--color-primary);
    opacity: 0;
    animation: ripplePulse 1.8s infinite;
}

@keyframes ripplePulse {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }
    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

.glass-card.is-listening .status-indicator {
    background-color: var(--color-active);
    box-shadow: 0 0 12px var(--color-active);
}

.glass-card.is-listening .status-text {
    color: var(--text-main);
}

/* Interaction Zone (Voice Orb Button & Wave Animation) */
.interaction-zone {
    position: relative;
    width: 200px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Wave Rings */
.wave-rings {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.8);
    transition: var(--transition-smooth);
}

.glass-card.is-active .wave-rings {
    opacity: 1;
    transform: scale(1);
}

.ring {
    position: absolute;
    border-radius: 50%;
    width: 100%;
    height: 100%;
    border: 1.5px solid rgba(13, 242, 201, 0.4);
    box-shadow: 0 0 20px var(--color-primary-glow);
    animation: pulseRing 3s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

.ring-1 {
    animation-delay: 0s;
}
.ring-2 {
    animation-delay: 1s;
    border-color: rgba(0, 180, 216, 0.3);
    box-shadow: 0 0 20px var(--color-secondary-glow);
}
.ring-3 {
    animation-delay: 2s;
}

/* Wave dynamic heights (Micro-animations when voice active) */
.glass-card.is-speaking .ring {
    animation-duration: 1.5s;
    border-width: 2.5px;
}

@keyframes pulseRing {
    0% {
        transform: scale(0.65);
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

/* Central Call/Mic Action Button */
.call-btn {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    outline: none;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-bounce);
    z-index: 5;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.call-btn:hover {
    transform: scale(1.08);
}

.call-btn:active {
    transform: scale(0.95);
}

/* Inactive State: Start Call */
.btn-inactive {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: #070913;
    box-shadow: 0 0 35px var(--color-primary-glow), 0 10px 25px rgba(0, 0, 0, 0.3);
}

.btn-inactive:hover {
    box-shadow: 0 0 50px var(--color-primary-glow), 0 12px 30px rgba(0, 0, 0, 0.4);
}

.btn-inactive .icon-phone-hangup {
    display: none;
}

.btn-inactive .icon-mic {
    display: block;
}

/* Active State: Hangup — Phone-style red end-call button */
.btn-active {
    background: linear-gradient(135deg, #FF1744 0%, #D50000 100%);
    color: #ffffff;
    box-shadow: 0 0 40px rgba(255, 23, 68, 0.5), 0 10px 25px rgba(0, 0, 0, 0.3);
    animation: pulse-red 1.5s ease-in-out infinite;
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 40px rgba(255, 23, 68, 0.5), 0 10px 25px rgba(0, 0, 0, 0.3); }
    50% { box-shadow: 0 0 60px rgba(255, 23, 68, 0.7), 0 12px 30px rgba(0, 0, 0, 0.4); }
}

.btn-active:hover {
    box-shadow: 0 0 65px rgba(255, 23, 68, 0.8), 0 12px 30px rgba(0, 0, 0, 0.4);
    animation: none;
}

.btn-active .icon-phone-hangup {
    display: block;
}

.btn-active .icon-mic {
    display: none;
}

.icon-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.icon {
    width: 32px;
    height: 32px;
    transition: var(--transition-smooth);
}

/* Transcription Displays */
.transcription-display {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.transcript-line {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    opacity: 0.7;
    transition: var(--transition-smooth);
}

.transcript-line.active, 
.transcript-line:hover {
    opacity: 1;
}

.transcript-line .label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.transcript-user .label {
    color: var(--text-cyan);
}

.transcript-agent .label {
    color: var(--color-primary);
}

.transcript-line .text {
    font-size: 0.95rem;
    line-height: 1.5;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.8rem 1.2rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    font-weight: 300;
}

.transcript-user .text {
    border-left: 3px solid var(--text-cyan);
}

.transcript-agent .text {
    border-left: 3px solid var(--color-primary);
}

/* Footer elements */
.card-footer {
    width: 100%;
    display: flex;
    justify-content: center;
}

.ai-mode-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.4rem 1rem;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.ai-mode-badge .badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--text-cyan);
}

.ai-mode-badge .badge-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Suggestion Grid Section */
.info-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.info-section h2 {
    font-family: var(--font-outfit);
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.topic-card {
    background: rgba(15, 22, 42, 0.25);
    border: 1px solid var(--border-glass);
    border-radius: 18px;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: var(--transition-smooth);
}

.topic-card:hover {
    transform: translateY(-4px);
    border-color: rgba(13, 242, 201, 0.2);
    background: rgba(15, 22, 42, 0.35);
}

.topic-icon {
    font-size: 1.5rem;
}

.topic-card h3 {
    font-family: var(--font-outfit);
    font-size: 1rem;
    font-weight: 600;
}

.topic-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    font-style: italic;
}

/* Mode Switcher Segments */
.mode-selector {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    padding: 3px;
    width: 100%;
    max-width: 420px;
    margin-bottom: 0.5rem;
}

.mode-btn {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-muted);
    font-family: var(--font-inter);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    border-radius: 100px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.mode-btn:hover {
    color: var(--text-main);
}

.mode-btn.active {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: #070913;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(13, 242, 201, 0.2);
}

/* API Settings Panel (Smooth Collapsible) */
.live-settings {
    width: 100%;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-top: 1px dashed rgba(255, 255, 255, 0.0);
    border-bottom: 1px dashed rgba(255, 255, 255, 0.0);
    padding: 0;
}

.live-settings.show {
    max-height: 300px;
    opacity: 1;
    padding: 1.2rem 0;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
    margin-bottom: 0.5rem;
}

/* Region warning note styling */
.region-notice {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: rgba(245, 158, 11, 0.04);
    border: 1px solid rgba(245, 158, 11, 0.15);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    margin-top: 1rem;
    text-align: left;
}

.notice-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.notice-text {
    font-size: 0.75rem;
    line-height: 1.45;
    color: #fcd34d;
    font-weight: 300;
}

.input-row {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.input-group {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.api-group {
    flex: 2;
}

.voice-group {
    flex: 1;
}

.input-group label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.api-input-container {
    display: flex;
    position: relative;
    width: 100%;
}

.api-input-container input {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    font-family: var(--font-inter);
    font-size: 0.85rem;
    padding: 0.6rem 5.5rem 0.6rem 0.8rem;
    border-radius: 12px;
    height: 42px;
    outline: none;
    transition: var(--transition-smooth);
}

.api-input-container input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(13, 242, 201, 0.15);
    background: rgba(255, 255, 255, 0.04);
}

.helper-link {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.72rem;
    color: var(--text-cyan);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.helper-link:hover {
    color: var(--color-primary);
    text-shadow: 0 0 8px rgba(13, 242, 201, 0.3);
}

.input-group select {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    font-family: var(--font-inter);
    font-size: 0.85rem;
    padding: 0.6rem 0.8rem;
    border-radius: 12px;
    height: 42px;
    outline: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 18px;
    padding-right: 1.8rem;
}

.input-group select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(13, 242, 201, 0.15);
    background-color: rgba(15, 22, 42, 0.9);
}

/* Responsiveness adjustments */
@media (max-width: 640px) {
    .header h1 {
        font-size: 2.2rem;
    }
    
    .glass-card {
        padding: 1.5rem;
        gap: 1.8rem;
    }
    
    .interaction-zone {
        width: 160px;
        height: 160px;
    }
    
    .call-btn {
        width: 85px;
        height: 85px;
    }
    
    .icon {
        width: 26px;
        height: 26px;
    }

    .input-row {
        flex-direction: column;
        gap: 0.8rem;
    }

    .api-input-container input {
        padding-right: 5rem;
    }
}
