/* ==========================================================================
   TableGo Web Phone & Unlimited HD Voice Calling Stylesheet
   ========================================================================== */

.phone-wrapper {
    max-width: 980px;
    margin: 2rem auto;
    padding: 0 1rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Header & Intro */
.phone-header {
    text-align: center;
    margin-bottom: 2rem;
}

.phone-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.phone-header p {
    font-size: 1.05rem;
    color: #64748b;
    margin: 0;
}

/* 2-Column Grid Layout */
.phone-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 820px) {
    .phone-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Phone Device Body (Dialer Container)
   ========================================================================== */
.dialer-device {
    background: #0f172a;
    border: 3px solid #1e293b;
    border-radius: 36px;
    padding: 1.75rem 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.05);
    color: #f8fafc;
    position: relative;
    overflow: hidden;
}

/* Permanent Number Banner */
.my-number-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
    border: 1px solid #334155;
    border-radius: 20px;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.my-number-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10b981;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.my-number-label {
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.my-number-val {
    font-size: 1.15rem;
    font-weight: 800;
    color: #38bdf8;
    letter-spacing: 0.05em;
}

.my-number-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-mini {
    background: #1e293b;
    border: 1px solid #475569;
    color: #cbd5e1;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    text-decoration: none;
}

.btn-mini:hover {
    background: #334155;
    color: #ffffff;
    border-color: #64748b;
}

/* Quick 1-Click Dial Strip (Mobile Ultra-Friendly) */
.quick-dial-strip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid #334155;
    padding: 0.45rem 0.75rem;
    border-radius: 14px;
    overflow-x: auto;
    scrollbar-width: none;
}
.quick-dial-strip::-webkit-scrollbar { display: none; }

.quick-dial-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: #10b981;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.quick-dial-chips {
    display: flex;
    gap: 0.45rem;
    flex-wrap: nowrap;
}

.quick-chip-btn {
    background: #1e293b;
    border: 1px solid #475569;
    color: #f8fafc;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.15s ease;
    touch-action: manipulation;
}

.quick-chip-btn:hover, .quick-chip-btn:active {
    background: #10b981;
    color: #ffffff;
    border-color: #059669;
    transform: scale(0.96);
}

/* Mobile Tab Switcher */
.phone-tabs-bar {
    display: flex;
    background: #1e293b;
    border-radius: 12px;
    padding: 3px;
    margin-bottom: 1rem;
    gap: 3px;
}

.phone-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 0.5rem 0.75rem;
    border-radius: 9px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    touch-action: manipulation;
}

.phone-tab-btn.active {
    background: #0f172a;
    color: #38bdf8;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Touch Action Manipulation for Instant Mobile Clicks */
.key-btn, .btn-call, .btn-speed-call, .btn-incoming-choice, .control-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Dialer Screen Display */
.dialer-screen {
    background: rgba(15, 23, 42, 0.6);
    border-radius: 16px;
    padding: 1rem 0.75rem;
    text-align: center;
    margin-bottom: 1.25rem;
    position: relative;
    min-height: 85px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dialer-input-number {
    font-size: 2.1rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.08em;
    min-height: 42px;
    line-height: 1.2;
    word-break: break-all;
}

.dialer-recipient-name {
    font-size: 0.85rem;
    color: #38bdf8;
    font-weight: 600;
    margin-top: 0.25rem;
    min-height: 18px;
}

.dialer-backspace {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.35rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: color 0.15s ease;
    display: none;
}

.dialer-backspace:hover {
    color: #ef4444;
}

/* Keypad Grid */
.dialer-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.key-btn {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #f8fafc;
    cursor: pointer;
    user-select: none;
    transition: all 0.1s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.key-btn:active {
    background: #334155;
    transform: scale(0.92);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.key-digit {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1;
}

.key-letters {
    font-size: 0.65rem;
    color: #94a3b8;
    font-weight: 600;
    letter-spacing: 0.1em;
    margin-top: 2px;
    height: 10px;
}

/* Call Actions Bar */
.dialer-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.btn-call {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.85rem;
    cursor: pointer;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.5);
    transition: all 0.2s ease;
}

.btn-call:hover {
    transform: scale(1.06);
    box-shadow: 0 15px 30px -5px rgba(16, 185, 129, 0.65);
}

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

/* ==========================================================================
   Right Panel: Speed Dial & Instructions
   ========================================================================== */
.phone-side-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card-speed-dial, .card-phone-guide {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.panel-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.contacts-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    border-radius: 14px;
    transition: all 0.2s ease;
}

.contact-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.contact-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.contact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0f2fe;
    color: #0284c7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.05rem;
}

.contact-name {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.95rem;
}

.contact-number {
    font-size: 0.8rem;
    color: #64748b;
    font-family: monospace;
}

.btn-speed-call {
    background: #10b981;
    border: none;
    color: #ffffff;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.15s ease;
}

.btn-speed-call:hover {
    background: #059669;
    transform: scale(1.08);
}

/* Quick Add Contact Form */
.add-contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.5rem;
    margin-top: 1rem;
}

.form-input {
    padding: 0.55rem 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 0.85rem;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.btn-add-contact {
    background: #3b82f6;
    color: #ffffff;
    border: none;
    padding: 0.55rem 0.85rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
}

.btn-add-contact:hover {
    background: #2563eb;
}

/* How It Works Guide List */
.guide-steps {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.guide-step {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.5;
}

.step-badge {
    background: #dbeafe;
    color: #1d4ed8;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ==========================================================================
   In-Call Active Screen (Replaces Dial Pad during active call)
   ========================================================================== */
.active-call-overlay {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1rem;
    min-height: 480px;
}

.call-avatar-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
}

.call-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #ffffff;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.4);
    position: relative;
    z-index: 2;
}

/* Pulsing audio rings when connected */
.call-pulse-ring {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px solid #38bdf8;
    border-radius: 50%;
    animation: ring-pulse 1.8s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
    z-index: 1;
    opacity: 0;
}

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

.call-peer-name {
    font-size: 1.45rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 0.35rem;
}

.call-peer-number {
    font-size: 1rem;
    color: #94a3b8;
    font-family: monospace;
    margin: 0 0 0.85rem;
}

.call-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
}

.call-timer {
    font-size: 1.85rem;
    font-weight: 800;
    color: #ffffff;
    font-family: monospace;
    letter-spacing: 0.05em;
    margin-bottom: 2rem;
}

/* Active Call Controls */
.call-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
}

.control-btn {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.35rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    gap: 1px;
}

.control-btn-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1;
}

.btn-mute {
    background: #334155;
}

.btn-mute.is-muted {
    background: #ef4444;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}

.btn-speaker {
    background: #334155;
}

.btn-speaker.is-loud {
    background: #0284c7;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.6);
    border: 2px solid #38bdf8;
}

.btn-hangup {
    background: #ef4444;
    box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.5);
    width: 68px;
    height: 68px;
    font-size: 1.75rem;
}

.btn-hangup:hover {
    background: #dc2626;
    transform: scale(1.08);
}

/* ==========================================================================
   Incoming Call Popup Dialog
   ========================================================================== */
.incoming-modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.incoming-card {
    background: #0f172a;
    border: 2px solid #38bdf8;
    border-radius: 32px;
    padding: 2.5rem 2rem;
    text-align: center;
    max-width: 360px;
    width: 90%;
    color: #ffffff;
    box-shadow: 0 25px 50px -12px rgba(56, 189, 248, 0.35);
    animation: bounce-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounce-in {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.incoming-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.75rem;
    margin: 0 auto 1.25rem;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.5);
    animation: ring-vibrate 0.6s infinite ease-in-out;
}

@keyframes ring-vibrate {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-8deg) scale(1.04); }
    75% { transform: rotate(8deg) scale(1.04); }
}

.incoming-title {
    font-size: 1rem;
    color: #38bdf8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.incoming-caller-name {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 0.25rem;
}

.incoming-caller-number {
    font-size: 1.1rem;
    color: #94a3b8;
    font-family: monospace;
    margin: 0 0 2rem;
}

.incoming-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.btn-incoming-choice {
    flex: 1;
    padding: 0.85rem 1rem;
    border-radius: 18px;
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
}

.btn-accept-call {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.6);
}

.btn-accept-call:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 30px -5px rgba(16, 185, 129, 0.8);
}

.btn-decline-call {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 10px 25px -5px rgba(239, 68, 68, 0.5);
}

.btn-decline-call:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 30px -5px rgba(239, 68, 68, 0.7);
}

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

/* Audio Visualizer Canvas */
.audio-visualizer-canvas {
    width: 100%;
    height: 48px;
    margin: 0.5rem 0 1rem;
    border-radius: 8px;
}
