/**
 * AiPBX.bid — Tables, Tech Grid & Interactive Components CSS
 * High-end corporate telecom SaaS aesthetics, responsive design, dark/light contrast.
 */

/* ── Section Containers & Headers ─────────────────────────────────────────── */
.section-wrapper {
    padding: 90px 24px;
    max-width: 1280px;
    margin: 0 auto;
}

.section-header-center {
    text-align: center;
    max-width: 820px;
    margin: 0 auto 50px auto;
}

.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--primary);
    background: var(--primary-light);
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 16px;
    border: 1px solid rgba(2, 132, 199, 0.2);
}

.section-title-large {
    font-size: clamp(2rem, 3.5vw, 2.75rem);
    font-weight: 800;
    color: var(--text-heading);
    line-height: 1.25;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.section-subtitle-muted {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.65;
}

/* ── Flagship Tech Features Grid ──────────────────────────────────────────── */
.tech-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.tech-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px 28px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
}

.tech-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--card-accent, var(--primary)), #38bdf8);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tech-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -15px rgba(2, 132, 199, 0.12), 0 0 0 1px rgba(2, 132, 199, 0.25);
    border-color: rgba(2, 132, 199, 0.3);
}

.tech-card:hover::before {
    opacity: 1;
}

.tech-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.tech-icon-box {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #ffffff;
    background: var(--card-accent, var(--primary));
    box-shadow: 0 8px 18px -4px var(--card-accent, var(--primary));
}

.tech-badge {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 10px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.tech-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 12px;
    line-height: 1.35;
}

.tech-card-desc {
    font-size: 0.94rem;
    color: var(--text-muted);
    line-height: 1.6;
    flex-grow: 1;
}

/* ── JSON Tables Tabs & Filter Navigation ─────────────────────────────────── */
.table-system-container {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 36px 32px;
    box-shadow: 0 20px 50px -10px rgba(15, 23, 42, 0.05);
    margin-top: 30px;
}

.table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.table-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.table-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.table-tab-btn i {
    font-size: 1rem;
    color: #64748b;
    transition: color 0.2s ease;
}

.table-tab-btn:hover {
    background: #f1f5f9;
    color: var(--text-heading);
    border-color: #cbd5e1;
}

.table-tab-btn.active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.2);
}

.table-tab-btn.active i {
    color: #38bdf8;
}

.table-search-box {
    position: relative;
    min-width: 260px;
}

.table-search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.9rem;
}

.table-search-input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-size: 0.9rem;
    color: var(--text-heading);
    outline: none;
    transition: all 0.2s ease;
}

.table-search-input:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* ── Tab Panels ───────────────────────────────────────────────────────────── */
.table-tab-panel {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.table-tab-panel.active {
    display: block;
}

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

/* ── Modern Table Styling ─────────────────────────────────────────────────── */
.table-responsive-wrapper {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.02);
}

.aipbx-data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.92rem;
    white-space: normal;
}

.aipbx-data-table thead th {
    background: #f8fafc;
    color: #0f172a;
    font-weight: 700;
    padding: 16px 20px;
    border-bottom: 2px solid #e2e8f0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
}

.aipbx-data-table thead th.col-aipbx {
    background: #f0fdf4;
    color: #166534;
    border-bottom-color: #bbf7d0;
}

.aipbx-data-table tbody td {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
    line-height: 1.55;
}

.aipbx-data-table tbody tr:last-child td {
    border-bottom: none;
}

.aipbx-data-table tbody tr:hover td {
    background: #f8fafc;
}

.aipbx-data-table tbody td.col-aipbx {
    background: rgba(240, 253, 244, 0.4);
    font-weight: 600;
}

/* Badges & Chips */
.category-pill {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 700;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.3;
}

.status-badge.yes {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.status-badge.no {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.status-badge.warning {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.chip-port {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.88rem;
    color: #0284c7;
    background: #e0f2fe;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    border: 1px solid #bae6fd;
}

.chip-proto {
    font-weight: 600;
    font-size: 0.8rem;
    color: #475569;
    background: #f1f5f9;
    padding: 3px 7px;
    border-radius: 6px;
    margin-left: 6px;
}

.star-code-pill {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f172a;
    background: #f8fafc;
    padding: 4px 10px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ── Technical Deep Dive Section ──────────────────────────────────────────── */
.deepdive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 28px;
    margin-top: 36px;
}

.deepdive-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px 28px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
}

.deepdive-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.deepdive-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.deepdive-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.3;
}

.deepdive-text {
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.7;
}

/* Architecture Flow ASCII Diagram Box */
.diagram-terminal {
    background: #0f172a;
    border-radius: 16px;
    padding: 24px;
    margin-top: 20px;
    border: 1px solid #1e293b;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
    overflow-x: auto;
}

.diagram-terminal pre {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #38bdf8;
    line-height: 1.6;
    margin: 0;
}

/* ── FAQ Accordion ────────────────────────────────────────────────────────── */
.faq-accordion {
    max-width: 920px;
    margin: 40px auto 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.faq-item {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.25s ease;
}

.faq-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.faq-item.active {
    border-color: var(--primary);
    box-shadow: 0 10px 25px -5px rgba(2, 132, 199, 0.1);
}

.faq-question {
    padding: 20px 24px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-heading);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.faq-question i {
    font-size: 0.9rem;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    padding: 0 24px;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
    background: #f8fafc;
}

.faq-item.active .faq-answer {
    max-height: 400px;
    padding: 16px 24px 24px 24px;
    border-top: 1px solid #f1f5f9;
}

/* ── Responsive Mobile Adjustments ────────────────────────────────────────── */
@media (max-width: 768px) {
    .section-wrapper {
        padding: 60px 16px;
    }
    .table-system-container {
        padding: 20px 16px;
    }
    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .table-search-box {
        width: 100%;
    }
    .table-tab-btn {
        padding: 8px 12px;
        font-size: 0.82rem;
    }
    .aipbx-data-table thead th,
    .aipbx-data-table tbody td {
        padding: 12px 14px;
        font-size: 0.86rem;
    }
    .deepdive-grid {
        grid-template-columns: 1fr;
    }
}
