/* ==============================================================================
   Bahria Town Karachi — Voice Assistant UI Design System
   Theme: Modern White / Bahria Light Palette (Centered Card Layout)
   Colors: Bahria Azure/Cyan (#00A2E8), Royal Navy (#0A2540), Gold (#D4AF37), Pure White (#FFFFFF)
============================================================================== */

:root {
    /* Brand Colors */
    --btk-primary: #00A2E8;
    --btk-primary-hover: #008ece;
    --btk-primary-dark: #0070a8;
    --btk-primary-glow: rgba(0, 162, 232, 0.28);
    --btk-gold: #D4AF37;
    --btk-gold-light: #F6D365;
    
    /* Neutrals & Surfaces */
    --bg-page: #F4F8FC;
    --bg-card: #FFFFFF;
    --bg-subtle: #F0F6FB;
    --border-light: rgba(0, 162, 232, 0.14);
    --border-subtle: #E2E8F0;
    
    /* Text Hierarchy */
    --text-heading: #0A2540;
    --text-body: #475569;
    --text-muted: #64748B;
    --text-subtle: #94A3B8;
    
    /* Call Action Colors */
    --call-green: #10B981;
    --call-red: #EF4444;
    --call-red-hover: #DC2626;
    
    /* Shadows */
    --shadow-card: 0 20px 48px -10px rgba(10, 37, 64, 0.08), 0 6px 20px -3px rgba(0, 162, 232, 0.08);
    --shadow-button: 0 8px 22px -4px rgba(0, 162, 232, 0.4);
    --shadow-red: 0 8px 22px -4px rgba(239, 68, 68, 0.4);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
}

html, body {
    height: 100%;
}

body {
    background-color: var(--bg-page);
    background-image: 
        radial-gradient(at 15% 15%, rgba(0, 162, 232, 0.08) 0px, transparent 50%),
        radial-gradient(at 85% 85%, rgba(212, 175, 55, 0.06) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(240, 246, 251, 0.8) 0px, transparent 100%);
    background-attachment: fixed;
    color: var(--text-heading);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ==============================================================================
   Top Navigation Header (Bahria Town Light Modern Branding)
============================================================================== */
.app-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    position: relative;
    z-index: 100;
    padding: 10px 24px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.02);
    flex-shrink: 0;
}

.header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo-wrap {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(212, 175, 55, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.brand-logo-img {
    width: 90%;
    height: 90%;
    object-fit: contain;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 0.76rem;
    color: var(--text-muted);
    font-weight: 500;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #ECFDF5;
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #065F46;
}

.status-pulse-dot {
    width: 7px;
    height: 7px;
    background: var(--call-green);
    border-radius: 50%;
    animation: pulseStatus 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes pulseStatus {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.lang-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--btk-primary-dark);
}

/* ==============================================================================
   Main Container Centered in the Middle of Screen
============================================================================== */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    position: relative;
    z-index: 10;
    min-height: 0;
}

.card-shell {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border-radius: 26px;
    border: 1px solid rgba(0, 162, 232, 0.16);
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
    margin: auto 0;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card-shell::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--btk-primary) 0%, var(--btk-gold) 100%);
    z-index: 2;
}

/* View Panels */
.view-panel {
    padding: 24px 24px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Card Brand Emblem (User's shared official Bahria Town logo) */
.card-brand-emblem {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(212, 175, 55, 0.22);
    border: 1.5px solid rgba(212, 175, 55, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.card-brand-emblem .card-logo-img {
    width: 90%;
    height: 90%;
    object-fit: contain;
}

.small-emblem {
    width: 44px;
    height: 44px;
    margin-bottom: 8px;
}

/* ==============================================================================
   3D AI Voice Orb (Compact & Glowing in Card)
============================================================================== */
.orb-stage {
    position: relative;
    width: 110px;
    height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 4px 0 16px;
}

.voice-orb-glow {
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 162, 232, 0.3) 0%, rgba(0, 162, 232, 0) 70%);
    filter: blur(12px);
    z-index: 1;
    pointer-events: none;
    animation: glowBreath 3.5s ease-in-out infinite;
}

.active-glow {
    background: radial-gradient(circle, rgba(0, 185, 255, 0.5) 0%, rgba(0, 162, 232, 0.12) 65%, transparent 75%);
    animation: glowIntense 2.2s ease-in-out infinite;
}

.voice-orb {
    position: relative;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    z-index: 2;
    background: radial-gradient(circle at 35% 30%, #38bdf8 0%, #00a2e8 40%, #0068a8 75%, #032b53 100%);
    box-shadow: 
        inset 0 -6px 16px rgba(2, 26, 54, 0.6),
        inset 0 6px 14px rgba(255, 255, 255, 0.5),
        0 10px 24px rgba(0, 140, 220, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.orb-inner-light {
    position: absolute;
    top: 10%;
    left: 18%;
    width: 45%;
    height: 35%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 80%);
    transform: rotate(-25deg);
    pointer-events: none;
}

.orb-swirl {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 180deg at 50% 50%, rgba(0, 217, 255, 0.4) 0deg, rgba(0, 110, 220, 0.1) 140deg, rgba(255, 255, 255, 0.3) 240deg, rgba(0, 217, 255, 0.4) 360deg);
    mix-blend-mode: overlay;
    animation: rotateSwirl 8s linear infinite;
}

.idle-orb {
    animation: floatIdle 3.8s ease-in-out infinite;
}

.calling-orb {
    animation: floatIdle 3s ease-in-out infinite, pulseCalling 1.5s ease-in-out infinite;
}

.connected-orb {
    animation: pulseConnected 2.2s ease-in-out infinite;
}

@keyframes floatIdle {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-6px) scale(1.02); }
}

@keyframes rotateSwirl {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes glowBreath {
    0%, 100% { opacity: 0.6; transform: scale(0.95); }
    50% { opacity: 0.95; transform: scale(1.08); }
}

@keyframes glowIntense {
    0%, 100% { opacity: 0.75; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}

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

@keyframes pulseConnected {
    0%, 100% { transform: scale(1); box-shadow: 0 8px 20px rgba(0, 140, 220, 0.35); }
    50% { transform: scale(1.04); box-shadow: 0 12px 28px rgba(0, 185, 255, 0.55); }
}

/* Concentric Rings */
.pulse-ring {
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    border: 2px solid rgba(0, 162, 232, 0.45);
    opacity: 0;
    pointer-events: none;
    animation: rippleExpand 2.2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}

.ring-1 { animation-delay: 0s; }
.ring-2 { animation-delay: 0.75s; }
.ring-3 { animation-delay: 1.5s; }

@keyframes rippleExpand {
    0% { transform: scale(0.8); opacity: 0.8; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* Connected Sound Ripples */
.sound-ripples {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.sound-ripples .ripple {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 1.5px solid rgba(56, 189, 248, 0.5);
    animation: soundWave 2s cubic-bezier(0.1, 0.7, 0.1, 1) infinite;
}

.sound-ripples .r2 { animation-delay: 0.65s; }
.sound-ripples .r3 { animation-delay: 1.3s; }

@keyframes soundWave {
    0% { transform: scale(0.9); opacity: 0.7; }
    100% { transform: scale(1.4); opacity: 0; }
}

/* ==============================================================================
   Hero & Welcome Typography
============================================================================== */
.hero-content {
    margin-bottom: 14px;
}

.sub-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #F0F9FF;
    border: 1px solid rgba(0, 162, 232, 0.22);
    color: var(--btk-primary-dark);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.hero-title {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.025em;
    line-height: 1.2;
    margin-bottom: 6px;
}

.hero-desc {
    font-size: 0.86rem;
    color: var(--text-body);
    line-height: 1.5;
    max-width: 330px;
    margin: 0 auto;
}

.feature-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 22px;
}

.pill-item {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-body);
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    padding: 4px 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.pill-item i {
    color: var(--btk-primary);
    font-size: 0.72rem;
}

/* ==============================================================================
   Start Call Button (Properly Centered in Button & Container)
============================================================================== */
.action-dock {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#callButton,
.btn-start-call {
    width: 100% !important;
    padding: 14px 24px;
    background: linear-gradient(135deg, #00A2E8 0%, #0077B6 100%);
    color: #FFFFFF;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    display: flex !important;
    flex-direction: row;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 12px;
    margin: 0 auto !important;
    box-shadow: var(--shadow-button);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

#callButton[style*="none"] {
    display: none !important;
}

.btn-start-call:hover {
    background: linear-gradient(135deg, #0090D0 0%, #00669E 100%);
    transform: translateY(-2px);
    box-shadow: 0 12px 26px -3px rgba(0, 162, 232, 0.45);
}

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

.btn-icon-circle {
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.24);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.btn-text-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
}

.btn-primary-text {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.btn-secondary-text {
    font-size: 0.72rem;
    font-family: 'Noto Nastaliq Urdu', serif;
    opacity: 0.92;
    font-weight: 400;
}

/* ==============================================================================
   In-Call Interface & Container (#ringBox, #outgoing, #connected)
============================================================================== */
#ringBox {
    width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 22px 20px 26px;
}

.call-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.call-stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.outgoing-badge {
    background: #FFFBEB;
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: #92400E;
}

.connected-badge {
    background: #ECFDF5;
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #065F46;
}

.live-dot {
    width: 7px;
    height: 7px;
    background: var(--call-green);
    border-radius: 50%;
    animation: livePulse 1.5s infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.connected-prefix {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 2px;
    display: block;
}

.call-partner-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-heading);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.call-status {
    font-size: 0.86rem;
    color: var(--text-body);
    font-weight: 500;
    margin-bottom: 12px;
    min-height: 20px;
}

/* Avatar Container */
.avatar-container {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 6px 0 14px;
}

.avatar-container.ringing {
    animation: ringBounce 1.8s ease-in-out infinite;
}

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

/* Micro Dots */
.call-animation {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.call-animation span {
    width: 7px;
    height: 7px;
    background: var(--btk-primary);
    border-radius: 50%;
    animation: pulseDot 1.4s infinite ease-in-out;
}

.call-animation span:nth-child(2) { animation-delay: 0.2s; }
.call-animation span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulseDot {
    0%, 100% { transform: scale(0.8); opacity: 0.4; }
    50% { transform: scale(1.4); opacity: 1; }
}

/* Voice Equalizer Bars */
.voice-bars {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 20px;
    margin-top: 10px;
}

.voice-bars .bar {
    width: 3.5px;
    height: 7px;
    background: var(--btk-primary);
    border-radius: 99px;
    animation: soundBar 1.2s ease-in-out infinite;
}

.voice-bars .b1 { animation-delay: 0.1s; height: 9px; }
.voice-bars .b2 { animation-delay: 0.3s; height: 16px; }
.voice-bars .b3 { animation-delay: 0.5s; height: 12px; }
.voice-bars .b4 { animation-delay: 0.2s; height: 18px; }
.voice-bars .b5 { animation-delay: 0.4s; height: 10px; }

@keyframes soundBar {
    0%, 100% { transform: scaleY(0.4); opacity: 0.4; }
    50% { transform: scaleY(1.3); opacity: 1; }
}

/* Timer Pill */
.timer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-light);
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--btk-primary-dark);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
    margin: 4px 0 18px;
}

/* End Call Button */
.end-call-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: #FFFFFF;
    border: none;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-red);
    transition: all 0.2s ease;
}

.end-call-btn:hover {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -3px rgba(239, 68, 68, 0.45);
}

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

/* Loader */
.loader {
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px;
    margin-top: 8px;
}

.loader-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(0, 162, 232, 0.2);
    border-top-color: var(--btk-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader span {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ==============================================================================
   Quick Suggestions Strip (Centered Under Card)
============================================================================== */
.tips-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    max-width: 440px;
    text-align: center;
}

.tips-intro {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tips-intro i {
    color: var(--btk-gold);
}

.tip-chip {
    font-size: 0.72rem;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid var(--border-subtle);
    padding: 3px 9px;
    border-radius: 6px;
    color: var(--text-body);
}

/* ==============================================================================
   Floating Helpline Action
============================================================================== */
.help {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 90;
}

.help-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #FFFFFF;
    color: var(--btk-primary);
    border: 1px solid var(--border-light);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    text-decoration: none;
    position: relative;
    transition: all 0.2s ease;
}

.help-btn:hover {
    background: var(--btk-primary);
    color: #FFFFFF;
    transform: scale(1.06);
    box-shadow: 0 8px 24px rgba(0, 162, 232, 0.35);
}

.help-tooltip {
    position: absolute;
    right: 52px;
    white-space: nowrap;
    background: #0A2540;
    color: #FFFFFF;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transform: translateX(6px);
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.help-btn:hover .help-tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* Stars fallback */
.stars {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(0, 162, 232, 0.2);
    border-radius: 50%;
    pointer-events: none;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .app-header {
        padding: 8px 16px;
    }

    .brand-title {
        font-size: 0.98rem;
    }

    .header-meta .lang-pill {
        display: none;
    }

    .main-wrapper {
        padding: 12px 10px;
    }

    .card-shell {
        border-radius: 20px;
    }

    .view-panel {
        padding: 18px 16px 22px;
    }

    .hero-title {
        font-size: 1.35rem;
    }

    .orb-stage {
        width: 95px;
        height: 95px;
        margin: 2px 0 12px;
    }

    .voice-orb {
        width: 72px;
        height: 72px;
    }
}
