/* ==========================================================================
   CALLBOT SIP DEMO STYLESHEET
   Vanilla CSS design with modern gradients, glassmorphism, and pulses
   ========================================================================== */

/* Design Tokens & Theme Variables */
:root {
    --bg-dark: #090b0f;
    --bg-panel: rgba(16, 20, 30, 0.65);
    --bg-console: #05070c;
    --border-color: rgba(255, 255, 255, 0.07);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    /* Neon Colors & Gradients */
    --color-primary: #3b82f6;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-accent: #8b5cf6;
    
    --grad-callbot: linear-gradient(135deg, #63BDEA 0%, #D56BFF 50%, #9B3EFF 100%);
    --grad-blue: linear-gradient(135deg, #2563eb, #3b82f6);
    --grad-green: linear-gradient(135deg, #059669, #10b981);
    --grad-danger: linear-gradient(135deg, #dc2626, #ef4444);
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;
    
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Ambient Glows */
.ambient-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.15;
    pointer-events: none;
}

.bg-glow-1 {
    top: -10%;
    left: -10%;
    background: radial-gradient(circle, #9B3EFF, transparent 70%);
}

.bg-glow-2 {
    bottom: -10%;
    right: -10%;
    background: radial-gradient(circle, #63BDEA, transparent 70%);
}

/* Main Container Layout */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    min-height: 100vh;
}

/* App Header styling */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.brand-logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 24px;
    letter-spacing: 0.5px;
}

.logo-accent {
    background: var(--grad-callbot);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-sub {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 5px;
}

/* Header Status Indicator Badge */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.status-dot.disconnected {
    background-color: var(--color-danger);
    box-shadow: 0 0 12px var(--color-danger);
}

.status-dot.connecting {
    background-color: var(--color-warning);
    box-shadow: 0 0 12px var(--color-warning);
    animation: blink 1s infinite alternate;
}

.status-dot.registered {
    background-color: var(--color-success);
    box-shadow: 0 0 12px var(--color-success);
}

.status-text {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Main Layout Grid */
.main-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 992px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
}

/* Glassmorphism Card Element */
.card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 25px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 15px;
}

.card-header h2 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.icon {
    width: 22px;
    height: 22px;
    color: var(--color-primary);
}

/* Settings Form elements */
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: var(--transition-fast);
}

input:focus {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

small {
    font-size: 11px;
    color: var(--text-muted);
}

/* Buttons Style rules */
.btn {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    outline: none;
}

.btn-primary {
    background: var(--grad-callbot);
    color: white;
    box-shadow: 0 4px 15px rgba(155, 62, 255, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(155, 62, 255, 0.4);
    filter: brightness(1.1);
}

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

.btn-danger {
    background: var(--grad-danger);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
}

.btn-block {
    width: 100%;
}

.btn-xs {
    padding: 6px 12px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.btn-xs:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

/* Calling Interface Panel */
.calling-widget {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    min-height: 520px;
    justify-content: space-between;
}

/* Business scenarios selector tab layout */
.scenario-selector {
    width: 100%;
}

.scenario-selector h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-align: center;
}

.scenario-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 18px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tab-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.tab-dot.green { background-color: var(--color-success); }
.tab-dot.blue { background-color: var(--color-primary); }
.tab-dot.purple { background-color: var(--color-accent); }
.tab-dot.orange { background-color: var(--color-warning); }


/* Dial pulse widget container */
.dial-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 15px 0;
}

.pulse-wrapper {
    position: relative;
    width: 180px;
    height: 180px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Pulsing background wave rings */
.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #63BDEA, #D56BFF, #9B3EFF, #63BDEA);
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

.pulse-ring-1 { animation: pulseRings 3s infinite 0s linear; }
.pulse-ring-2 { animation: pulseRings 3s infinite 1s linear; }
.pulse-ring-3 { animation: pulseRings 3s infinite 2s linear; }

/* Inactive pulse rings */
.pulse-wrapper:not(.active) .pulse-ring {
    animation: none;
    display: none;
}

.dial-circle-outer {
    position: relative;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: conic-gradient(from 45deg, #3b82f6 0deg, #60a5fa 60deg, #3b82f6 120deg, #8b5cf6 180deg, #3b82f6 240deg, #60a5fa 300deg, #3b82f6 360deg);
    padding: 3px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
    transition: all var(--transition-normal);
}

.pulse-wrapper.active .dial-circle-outer {
    animation: rotateOuter 10s infinite linear;
    box-shadow: 0 0 40px rgba(155, 62, 255, 0.6);
}

.dial-circle-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: #0f131a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    cursor: pointer;
    transition: all var(--transition-normal);
    user-select: none;
}

.dial-circle-inner:hover {
    background-color: #171d28;
}

.phone-icon {
    width: 44px;
    height: 44px;
    color: white;
    transition: all var(--transition-normal);
}

/* Hover/active effects on status */
.pulse-wrapper.active .phone-icon {
    animation: shake 0.5s infinite alternate;
}

.pulse-wrapper.connected .dial-circle-outer {
    background: conic-gradient(from 45deg, #10b981 0deg, #34d399 180deg, #10b981 360deg);
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.6);
}

.pulse-wrapper.connected .phone-icon {
    color: var(--color-success);
    animation: breathe 2s infinite ease-in-out;
}

/* Dial details */
.call-status {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.2px;
}

.call-timer {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 500;
    color: var(--color-success);
    margin-top: 5px;
    letter-spacing: 1px;
}

/* Calling controls footer */
.call-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

.control-btn {
    flex: 1;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    padding: 12px 24px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all var(--transition-normal);
    color: white;
}

.control-btn svg {
    width: 18px;
    height: 18px;
}

.btn-call {
    background: var(--grad-green);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
}

.btn-call:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    filter: brightness(1.1);
}

.btn-call:disabled {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

.btn-hangup {
    background: var(--grad-danger);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.25);
}

.btn-hangup:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
    filter: brightness(1.1);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.15);
}

.btn-secondary:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* DTMF Keypad Grid */
.keypad-panel {
    width: 100%;
    max-width: 260px;
    animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.keypad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.key-btn {
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all var(--transition-fast);
}

.key-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.key-btn:active {
    background: var(--grad-callbot);
    color: white;
    transform: scale(0.95);
    box-shadow: 0 0 10px rgba(155, 62, 255, 0.5);
}

/* Visual Developer Console Log Window */
.console-section {
    width: 100%;
}

.console-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.console-icon {
    color: var(--color-accent);
}

.console-body {
    background-color: var(--bg-console);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    height: 180px;
    overflow-y: auto;
    padding: 15px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.8);
}

/* Scrollbar styling for console */
.console-body::-webkit-scrollbar {
    width: 6px;
}
.console-body::-webkit-scrollbar-track {
    background: transparent;
}
.console-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
.console-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.log-line {
    word-break: break-all;
    border-left: 2px solid transparent;
    padding-left: 8px;
}

.log-line.system {
    color: #3b82f6;
    border-color: #3b82f6;
}

.log-line.info {
    color: #60a5fa;
    border-color: #2563eb;
}

.log-line.success {
    color: #34d399;
    border-color: #059669;
}

.log-line.warn {
    color: #fbbf24;
    border-color: #d97706;
}

.log-line.error {
    color: #f87171;
    border-color: #dc2626;
}

.log-line.event {
    color: #c084fc;
    border-color: #7c3aed;
}

/* Helpers */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* Animations */
@keyframes blink {
    0% { opacity: 0.4; }
    100% { opacity: 1; }
}

@keyframes pulseRings {
    0% {
        transform: scale(0.9);
        opacity: 0.6;
    }
    50% {
        opacity: 0.3;
    }
    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

@keyframes rotateOuter {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes shake {
    0% { transform: rotate(-5deg); }
    100% { transform: rotate(5deg); }
}

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

@keyframes slideDown {
    0% { transform: translateY(-10px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   FLOATING ACTION BUTTON (FAB) & CHATBOT WIDGET STYLES
   ========================================================================== */

.fab-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
}

.fab-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--grad-callbot);
    border: none;
    color: white;
    box-shadow: 0 4px 20px rgba(155, 62, 255, 0.4);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.fab-button:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 8px 30px rgba(155, 62, 255, 0.6);
}

.fab-button:active {
    transform: scale(0.95);
}

.fab-button svg {
    width: 28px;
    height: 28px;
    transition: transform 0.3s ease;
}

.fab-pulse-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid #D56BFF;
    pointer-events: none;
    animation: fabPulse 2s infinite ease-out;
    opacity: 0;
}

@keyframes fabPulse {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.chatbot-floating-panel {
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 420px;
    height: 680px;
    max-width: calc(100vw - 50px);
    max-height: calc(100vh - 140px);
    z-index: 9998;
    transform: scale(0.8) translateY(40px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: bottom right;
    
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 15px;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
}

.chatbot-floating-panel.active {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.chatbot-floating-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
}

.chatbot-floating-header h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatbot-floating-header h3::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-success);
    box-shadow: 0 0 8px var(--color-success);
}

.btn-close-chatbot {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.btn-close-chatbot:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-close-chatbot svg {
    width: 20px;
    height: 20px;
}

