/* assets/css/voice.css - ihp call Enterprise Voice Broadcast & Billing */

:root {
    /* Human Enterprise SaaS Palette - Sharp Contrast & Modern Readability */
    --bg-page: #0b111e;
    --bg-card: #131c2e;
    --bg-card-hover: #19243b;
    --bg-surface: #0f172a;
    --bg-sidebar: #0a0f1a;
    --border-color: #202c42;
    --border-focus: #3b82f6;

    /* Semantic Accents */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: rgba(37, 99, 235, 0.14);
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.14);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.14);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.14);
    --info: #0ea5e9;
    --info-light: rgba(14, 165, 233, 0.14);

    /* Text Colors - WCAG AAA High Contrast */
    --text-heading: #ffffff;
    --text-body: #f1f5f9;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;

    /* Radii */
    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 6px;
}

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

body {
    background-color: var(--bg-page);
    color: var(--text-body);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.92rem;
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Typography Contrast */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--text-heading) !important;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin-bottom: 0.25rem;
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-light {
    color: var(--text-body) !important;
}

/* Enterprise Solid Cards */
.glass-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: border-color 0.15s ease;
}

.glass-card:hover {
    border-color: #2b3b55;
}

/* App Header */
.app-header {
    background-color: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1020;
    min-height: 58px;
    display: flex;
    align-items: center;
}

.brand-icon {
    width: 34px;
    height: 34px;
    background: #2563eb;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Sidebar Navigation */
.sidebar-wrapper {
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    min-height: calc(100vh - 58px);
}

.nav-link-custom {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    color: #cbd5e1;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88rem;
    transition: background 0.15s ease, color 0.15s ease;
    margin-bottom: 3px;
}

.nav-link-custom:hover {
    color: #ffffff;
    background-color: #1a253c;
}

.nav-link-custom.active {
    color: #ffffff;
    background-color: var(--primary);
    font-weight: 600;
}

.nav-link-custom i {
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
}

/* Modern Metric / Stat Card */
.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 104px;
    transition: border-color 0.15s ease;
}

.stat-card:hover {
    border-color: #2b3b55;
}

.stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin: 0;
    line-height: 1.2;
}

.stat-icon {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
    flex-shrink: 0;
}

.stat-icon.balance { background: var(--success-light); color: var(--success); }
.stat-icon.calls { background: var(--primary-light); color: var(--primary); }
.stat-icon.voices { background: var(--info-light); color: var(--info); }
.stat-icon.answered { background: var(--success-light); color: var(--success); }
.stat-icon.no-answer { background: var(--warning-light); color: var(--warning); }
.stat-icon.failed { background: var(--danger-light); color: var(--danger); }
.stat-icon.queued { background: rgba(148, 163, 184, 0.14); color: #cbd5e1; }

.stat-value {
    font-size: 1.32rem;
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.01em;
}

.stat-subtext {
    font-size: 0.72rem;
    color: var(--text-subtle);
    margin-top: 3px;
    line-height: 1.2;
}

/* Status Badges - High Contrast */
.badge-status {
    padding: 3px 9px;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.02em;
}

.badge-status.approved, .badge-status.answered, .badge-status.completed, .badge-status.active {
    background: #064e3b;
    color: #6ee7b7;
    border: 1px solid #059669;
}

.badge-status.pending, .badge-status.no_answer, .badge-status.scheduled {
    background: #78350f;
    color: #fde68a;
    border: 1px solid #d97706;
}

.badge-status.rejected, .badge-status.failed, .badge-status.busy, .badge-status.stopped, .badge-status.cancelled {
    background: #7f1d1d;
    color: #fca5a5;
    border: 1px solid #dc2626;
}

.badge-status.running, .badge-status.dialing, .badge-status.queued {
    background: #1e3a8a;
    color: #93c5fd;
    border: 1px solid #2563eb;
}

.badge-dynamic {
    background-color: #ffc107 !important;
    color: #111827 !important;
    font-weight: 700 !important;
    border: 1px solid #d97706 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Enterprise Tables */
.custom-table {
    color: var(--text-body);
    vertical-align: middle;
    width: 100%;
}

.custom-table thead th {
    background-color: #0d1524;
    border-bottom: 2px solid var(--border-color);
    color: #94a3b8;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 10px 12px;
    white-space: nowrap;
}

.custom-table tbody td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.86rem;
    background-color: transparent;
    vertical-align: middle;
}

.custom-table tbody tr:hover td {
    background-color: var(--bg-card-hover);
}

/* Custom Buttons */
.btn-primary-glow {
    background-color: var(--primary);
    color: #ffffff !important;
    border: 1px solid transparent;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: background-color 0.15s ease;
}

.btn-primary-glow:hover {
    background-color: var(--primary-hover);
    color: #ffffff !important;
}

.btn-soft {
    background-color: #1a253c;
    color: #e2e8f0 !important;
    border: 1px solid #2c3e5d;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-soft:hover {
    background-color: #243350;
    border-color: #3b5278;
    color: #ffffff !important;
}

/* Form Controls - High Contrast */
.form-control, .form-select {
    background-color: #0c1322 !important;
    border: 1px solid #25344d !important;
    color: #ffffff !important;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.88rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--border-focus) !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25) !important;
    outline: none;
}

.form-control::placeholder {
    color: #64748b !important;
}

/* Progress bar */
.progress-dark {
    background-color: #0c1322;
    border: 1px solid #223049;
    height: 10px;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar-glow {
    background: #10b981;
    transition: width 0.3s ease;
}

/* Base Mobile & Overflow Prevention */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Audio Player */
audio {
    height: 36px;
    border-radius: 6px;
    outline: none;
    max-width: 100%;
}

/* Code & Pre Blocks Responsive */
pre {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
    padding: 12px;
}

pre code {
    white-space: pre;
    word-break: normal;
}

/* Fixed Mobile Bottom Navigation Bar (< 768px) */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #0a0f1a;
    border-top: 1px solid var(--border-color);
    z-index: 1040;
    justify-content: space-around;
    align-items: center;
    padding: 0 6px;
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-decoration: none;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 500;
    padding: 4px 0;
    transition: color 0.15s ease;
}

.mobile-bottom-nav .nav-item i {
    font-size: 1.15rem;
    margin-bottom: 2px;
}

.mobile-bottom-nav .nav-item.active {
    color: #38bdf8;
    font-weight: 600;
}

/* Tablet & Mobile Sticky Override */
@media (max-width: 991.98px) {
    .sticky-top, .position-lg-sticky {
        position: static !important;
        top: auto !important;
    }
}

/* Mobile Viewport Adjustments (< 768px) */
@media (max-width: 767.98px) {
    body {
        padding-bottom: 74px !important;
    }

    .mobile-bottom-nav {
        display: flex !important;
    }

    .app-header {
        padding-left: 10px !important;
        padding-right: 10px !important;
        min-height: 52px;
    }

    main {
        padding: 12px 8px !important;
    }

    h4, .h4 {
        font-size: 1.22rem !important;
    }

    h5, .h5 {
        font-size: 1.05rem !important;
    }

    .glass-card {
        padding: 12px 14px !important;
        border-radius: var(--radius-md) !important;
        margin-bottom: 12px !important;
    }

    /* Stat Cards on Mobile: 2 per row, clean vertical */
    .stat-card {
        padding: 10px 12px !important;
        min-height: 90px !important;
    }

    .stat-icon {
        width: 26px !important;
        height: 26px !important;
        font-size: 0.8rem !important;
    }

    .stat-value {
        font-size: 1.12rem !important;
    }

    .stat-label {
        font-size: 0.66rem !important;
    }

    .stat-subtext {
        font-size: 0.64rem !important;
    }

    /* Responsive Tables: Smooth touch scrolling */
    .table-responsive {
        border-radius: var(--radius-sm);
        border: 1px solid var(--border-color);
        -webkit-overflow-scrolling: touch;
        margin-bottom: 0.5rem;
    }

    .custom-table th, .custom-table td {
        padding: 8px 10px !important;
        font-size: 0.78rem !important;
    }

    /* Form Controls on Mobile */
    .form-control, .form-select {
        font-size: 0.88rem !important;
        padding: 7px 10px !important;
    }

    /* Buttons minimum height & touch target */
    .btn {
        min-height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .btn-sm {
        min-height: 30px;
        padding-left: 8px;
        padding-right: 8px;
        font-size: 0.76rem !important;
    }

    /* Scrollable pill navigation */
    .nav-pills, .btn-group {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap !important;
    }

    .nav-pills .nav-item, .btn-group .btn {
        flex-shrink: 0;
    }
}

/* Extra Small Phones (< 576px) */
@media (max-width: 575.98px) {
    main {
        padding: 10px 6px !important;
    }

    .glass-card {
        padding: 12px 10px !important;
    }

    .stat-card {
        padding: 8px 10px !important;
        min-height: 84px !important;
    }

    .stat-value {
        font-size: 1rem !important;
    }

    .stat-label {
        font-size: 0.62rem !important;
    }

    .stat-icon {
        width: 22px !important;
        height: 22px !important;
        font-size: 0.72rem !important;
    }

    .modal-dialog {
        margin: 0.5rem auto;
        max-width: calc(100% - 1rem);
    }

    .modal-content {
        border-radius: var(--radius-md) !important;
    }

    .modal-header, .modal-body, .modal-footer {
        padding: 12px 14px !important;
    }

    /* WebRTC Call Popup Modal on Small Handsets */
    #webrtcCallModal .modal-body {
        padding: 16px 12px !important;
    }

    #webrtcCallModal .avatar-circle {
        width: 72px !important;
        height: 72px !important;
    }

    #webrtcCallModal .radar-wave {
        width: 72px !important;
        height: 72px !important;
    }

    #webrtcCallModal #callTimerDisplay {
        font-size: 1.85rem !important;
    }

    .call-action-btn {
        width: 48px !important;
        height: 48px !important;
    }

    .call-hangup-btn {
        width: 56px !important;
        height: 56px !important;
    }
}
