/* ============================================
   360 Voice - Professional UI Styles
   ============================================ */

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Brand Colors */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --accent: #06b6d4;
    --accent-light: #22d3ee;
    
    /* Semantic Colors */
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    
    /* Neutrals */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-card: rgba(26, 26, 37, 0.8);
    --bg-card-hover: rgba(35, 35, 50, 0.9);
    
    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    
    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.1);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 60px rgba(99, 102, 241, 0.3);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   Background Effects
   ============================================ */
.app {
    position: relative;
    min-height: 100vh;
}

.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.15), transparent),
        radial-gradient(ellipse 60% 40% at 100% 50%, rgba(6, 182, 212, 0.1), transparent),
        radial-gradient(ellipse 60% 40% at 0% 80%, rgba(99, 102, 241, 0.08), transparent);
    pointer-events: none;
    z-index: 0;
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   Container
   ============================================ */
.container {
    position: relative;
    z-index: 1;
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-2xl);
    min-height: 100vh;
}

/* ============================================
   Header
   ============================================ */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-icon {
    width: 36px;
    height: 36px;
    color: var(--primary);
    animation: pulse-slow 3s ease-in-out infinite;
}

@keyframes pulse-slow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-accent {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    backdrop-filter: blur(10px);
}

.badge-dot {
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    text-align: center;
    padding: var(--space-lg) 0;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-lg);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ============================================
   Call Interface
   ============================================ */
.call-interface {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
}

.call-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.call-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
}

.call-state.hidden {
    display: none;
}

/* Idle State */
.pulse-ring {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    opacity: 0;
    animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(0.8); opacity: 0.5; }
    100% { transform: scale(1.4); opacity: 0; }
}

.call-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg) var(--space-2xl);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-family: inherit;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 
        0 4px 20px rgba(99, 102, 241, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.call-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 30px rgba(99, 102, 241, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.call-btn:active {
    transform: translateY(0);
}

.call-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.call-icon {
    width: 24px;
    height: 24px;
}

.call-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Active Call State */
.voice-visualizer {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.visualizer-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid var(--primary);
    opacity: 0.3;
    animation: visualizer-pulse 2s ease-in-out infinite;
}

.ring-1 {
    width: 100%;
    height: 100%;
    animation-delay: 0s;
}

.ring-2 {
    width: 130%;
    height: 130%;
    animation-delay: 0.3s;
}

.ring-3 {
    width: 160%;
    height: 160%;
    animation-delay: 0.6s;
}

@keyframes visualizer-pulse {
    0%, 100% { transform: scale(0.95); opacity: 0.2; }
    50% { transform: scale(1.05); opacity: 0.4; }
}

.avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-glow);
}

.avatar svg {
    width: 40px;
    height: 40px;
}

.call-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.call-status-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-md);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--success);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: blink 1s ease-in-out infinite;
}

.call-timer {
    font-size: 2rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.end-call-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: var(--danger);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
}

.end-call-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(239, 68, 68, 0.4);
}

.end-call-btn svg {
    width: 20px;
    height: 20px;
}

/* Status Message */
.status-message {
    min-height: 24px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
}

.status-message.error {
    color: var(--danger);
}

.status-message.success {
    color: var(--success);
}

/* ============================================
   Transcript Section
   ============================================ */
.transcript-section {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.transcript-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
}

.transcript-header h2 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.transcript-header h2 svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.transcript-controls {
    display: flex;
    gap: var(--space-sm);
}

.icon-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.icon-btn svg {
    width: 16px;
    height: 16px;
}

.transcript-list {
    min-height: 300px;
    max-height: 450px;
    overflow-y: auto;
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

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

.transcript-list::-webkit-scrollbar-track {
    background: transparent;
}

.transcript-list::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-2xl);
    text-align: center;
    height: 100%;
    min-height: 250px;
}

.empty-icon {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    opacity: 0.5;
}

.empty-icon svg {
    width: 100%;
    height: 100%;
}

.empty-state p {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.empty-state span {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Transcript Entries */
.transcript-entry {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 3px solid;
    animation: slideIn 0.3s ease-out;
}

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

.transcript-entry.user {
    border-left-color: var(--primary);
    background: rgba(99, 102, 241, 0.08);
}

.transcript-entry.agent {
    border-left-color: var(--accent);
    background: rgba(6, 182, 212, 0.08);
}

.transcript-speaker {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.transcript-entry.user .transcript-speaker {
    color: var(--primary-light);
}

.transcript-entry.agent .transcript-speaker {
    color: var(--accent-light);
}

.transcript-text {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-primary);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    margin-top: auto;
    padding-top: var(--space-xl);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.footer-divider {
    opacity: 0.3;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 640px) {
    .container {
        padding: var(--space-lg) var(--space-md);
        gap: var(--space-xl);
    }
    
    .header {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .call-card {
        padding: var(--space-xl);
    }
    
    .call-btn {
        padding: var(--space-md) var(--space-xl);
        font-size: 1rem;
    }
    
    .transcript-list {
        min-height: 250px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .footer-divider {
        display: none;
    }
}
