/* ==========================================================================
   GP Auto Visualizer - Ultra Mobile-Responsive & GeneratePress Styles
   File: assets/css/frontend.css
   ========================================================================== */

/* 1. Quick Answer Box (Bing Featured Snippet / Copilot Ready) */
.gpav-quick-answer-box {
    background: #f0fdf4;
    border-left: 5px solid #16a34a;
    border-top: 1px solid #dcfce7;
    border-right: 1px solid #dcfce7;
    border-bottom: 1px solid #dcfce7;
    border-radius: 0 8px 8px 0;
    padding: 16px 20px;
    margin: 24px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.gpav-quick-answer-box .gpav-box-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #15803d;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gpav-quick-answer-box p {
    margin: 0;
    color: #1f2937;
    font-size: 0.98rem;
    line-height: 1.6;
}

/* 2. Key Takeaways Box */
.gpav-takeaways-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 18px 20px;
    margin: 24px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.gpav-takeaways-box .gpav-box-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

.gpav-takeaways-box ul {
    margin: 0;
    padding-left: 18px;
    list-style-type: none;
}

.gpav-takeaways-box ul li {
    position: relative;
    padding-left: 10px;
    margin-bottom: 8px;
    color: #334155;
    line-height: 1.55;
    font-size: 0.95rem;
}

.gpav-takeaways-box ul li::before {
    content: "✔";
    position: absolute;
    left: -14px;
    color: #2563eb;
    font-weight: bold;
    font-size: 12px;
}

/* 3. Visual Charts (Pie & Bar) Container */
.gpav-chart-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin: 28px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.gpav-chart-heading {
    font-size: 1.15rem;
    font-weight: 700;
    color: #111827;
    text-align: center;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f3f4f6;
    line-height: 1.4;
}

.gpav-canvas-box {
    position: relative;
    margin: 0 auto;
    width: 100%;
}

.gpav-pie-box {
    max-width: 440px;
    height: 320px;
}

.gpav-bar-box {
    max-width: 680px;
    height: 340px;
}

/* 4. Interactive Dynamic Comparison Table */
.gpav-table-container {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 18px;
    margin: 30px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.gpav-table-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.gpav-table-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
}

.gpav-table-filter {
    flex-shrink: 0;
}

.gpav-table-search-input {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    width: 240px;
    max-width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #f8fafc;
}

.gpav-table-search-input:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Scrollable Table with Custom Scrollbar */
.gpav-table-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 6px;
    border: 1px solid #f1f5f9;
}

.gpav-table-scroll-wrapper::-webkit-scrollbar {
    height: 6px;
}

.gpav-table-scroll-wrapper::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.gpav-interactive-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14.5px;
    text-align: left;
    margin: 0;
    min-width: 550px; /* Ensures columns stay comfortable on mobile scroll */
}

.gpav-interactive-table th {
    background-color: #1e293b;
    color: #ffffff;
    padding: 10px 14px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: background 0.2s;
}

.gpav-interactive-table th:hover {
    background-color: #334155;
}

.gpav-interactive-table th::after {
    content: " ⇅";
    font-size: 11px;
    opacity: 0.6;
}

.gpav-interactive-table th.asc::after {
    content: " ▲";
    opacity: 1;
}

.gpav-interactive-table th.desc::after {
    content: " ▼";
    opacity: 1;
}

.gpav-interactive-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    line-height: 1.45;
}

.gpav-interactive-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

.gpav-interactive-table tbody tr:hover {
    background-color: #eff6ff;
}

/* Reliability Badges */
.gpav-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.gpav-badge-avoid {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.gpav-badge-safe {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.gpav-badge-caution {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.gpav-table-hint {
    margin-top: 8px;
    font-size: 11.5px;
    color: #94a3b8;
    text-align: right;
}

/* ==========================================================================
   Mobile & Small Screen Optimizations (< 768px)
   ========================================================================== */
@media (max-width: 768px) {
    .gpav-table-top-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .gpav-table-filter {
        width: 100%;
    }

    .gpav-table-search-input {
        width: 100%;
        box-sizing: border-box;
    }

    .gpav-pie-box {
        max-width: 100%;
        height: 270px;
    }

    .gpav-bar-box {
        max-width: 100%;
        height: 280px;
    }

    .gpav-chart-card {
        padding: 16px 12px;
    }

    .gpav-table-container {
        padding: 14px 10px;
    }

    .gpav-quick-answer-box, 
    .gpav-takeaways-box {
        padding: 14px 16px;
    }

    .gpav-table-hint {
        text-align: left;
    }
}