/* ═══════════════════════════════════════════════════════════════════
   Paket Karşılaştırma Tablosu — gh_render_package_comparison()
   2026-05-13: Eko hosting (ucuz-hosting.php) için ilk implementasyon.
   Pattern: sticky first col + scroll wrapper + semantic <table>
   ═══════════════════════════════════════════════════════════════════ */

/* ── Toggle butonu (kapalı/açık) ── */
.gh-compare-toggle-wrap {
    display: flex;
    justify-content: center;
    margin: 28px 0 12px;
}

.gh-compare-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--gh-brand-light, #4d9aff) 0%, var(--gh-brand-mid, #1e40af) 100%);
    color: #fff;
    font-family: 'Rubik', sans-serif;
    font-size: 15px;
    font-weight: 600;
    padding: 13px 28px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(30, 64, 175, 0.25);
    transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}

.gh-compare-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(30, 64, 175, 0.4);
}

.gh-compare-toggle:focus-visible {
    outline: 3px solid rgba(77, 154, 255, 0.5);
    outline-offset: 3px;
}

.gh-compare-toggle svg {
    display: block;
    flex-shrink: 0;
}

.gh-compare-toggle-chevron {
    transition: transform .35s cubic-bezier(.4, 0, .2, 1);
}

.gh-compare-toggle[aria-expanded="true"] .gh-compare-toggle-chevron {
    transform: rotate(180deg);
}

.gh-compare-toggle[aria-expanded="true"] .gh-compare-toggle-label::before {
    content: 'Karşılaştırmayı Gizle';
}

.gh-compare-toggle[aria-expanded="true"] .gh-compare-toggle-label {
    visibility: hidden;
    position: relative;
}

.gh-compare-toggle[aria-expanded="true"] .gh-compare-toggle-label::before {
    visibility: visible;
    position: absolute;
    left: 0;
    white-space: nowrap;
}

/* ── Panel (açık/kapalı animasyon) ── */
.gh-compare-panel {
    margin-top: 16px;
    padding: 0;
    overflow: hidden;
    animation: gh-cmp-expand .4s cubic-bezier(.2, 1, .3, 1) 1;
}

@keyframes gh-cmp-expand {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Scroll wrapper (mobile horizontal scroll) ── */
.gh-cmp-scroll-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08), 0 0 0 1px rgba(15, 23, 42, 0.04);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--gh-brand-light, #4d9aff) #f1f5f9;
}

.gh-cmp-scroll-wrap::-webkit-scrollbar {
    height: 10px;
}

.gh-cmp-scroll-wrap::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 5px;
}

.gh-cmp-scroll-wrap::-webkit-scrollbar-thumb {
    background: var(--gh-brand-light, #4d9aff);
    border-radius: 5px;
}

.gh-cmp-scroll-wrap:focus-visible {
    outline: 3px solid rgba(77, 154, 255, 0.5);
    outline-offset: 2px;
}

/* ── Tablo temel stil ── */
.gh-cmp-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-family: 'Karla', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    color: #1f2937;
    background: #fff;
    min-width: 720px; /* mobile altında horizontal scroll */
}

/* ── Header (paket adı + fiyat + CTA) ── */
.gh-cmp-table thead th {
    background: linear-gradient(135deg, #0a1a35 0%, #1e40af 100%);
    color: #fff;
    padding: 18px 16px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    position: sticky;
    top: 0;
    z-index: 2;
}

.gh-cmp-th-feature {
    text-align: left !important;
    background: linear-gradient(135deg, #0a1a35 0%, #1e3a8a 100%) !important;
    width: 220px;
    min-width: 200px;
}

.gh-cmp-th-pkg {
    min-width: 160px;
}

.gh-cmp-pkg-name {
    font-family: 'Rubik', sans-serif;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.2px;
    margin-bottom: 6px;
}

.gh-cmp-pkg-price {
    font-family: 'Rubik', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: #fbbf24;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.gh-cmp-pkg-price small {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.85;
    letter-spacing: 0;
}

.gh-cmp-pkg-cta {
    display: inline-block;
    background: #fff;
    color: #1e40af !important;
    text-decoration: none !important;
    padding: 7px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    transition: transform .2s ease, background .2s ease;
}

.gh-cmp-pkg-cta:hover {
    transform: translateY(-1px);
    background: #fbbf24;
    color: #0a1a35 !important;
}

/* ── Body satırları ── */
.gh-cmp-table tbody tr {
    transition: background .15s ease;
}

.gh-cmp-table tbody tr:nth-child(even) {
    background: #f8fafc; /* zebra stripe — okunabilirlik için */
}

.gh-cmp-table tbody tr:hover {
    background: #eff6ff;
}

.gh-cmp-row-label {
    text-align: left;
    font-weight: 600;
    color: #0f172a;
    padding: 13px 16px;
    /* Sticky first column — yatay scroll'da görünür kalır */
    position: sticky;
    left: 0;
    background: inherit !important; /* row'un kendi bg'sini al (zebra/hover compatible) */
    z-index: 1;
    border-right: 1px solid #e2e8f0;
    width: 220px;
    min-width: 200px;
}

/* Sticky col hover fix — zebra ile uyumlu */
.gh-cmp-table tbody tr:nth-child(even) .gh-cmp-row-label {
    background: #f8fafc !important;
}
.gh-cmp-table tbody tr:nth-child(odd) .gh-cmp-row-label {
    background: #ffffff !important;
}
.gh-cmp-table tbody tr:hover .gh-cmp-row-label {
    background: #eff6ff !important;
}

.gh-cmp-cell {
    text-align: center;
    padding: 13px 14px;
    color: #334155;
    vertical-align: middle;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 500;
}

.gh-cmp-table tbody tr:last-child .gh-cmp-cell,
.gh-cmp-table tbody tr:last-child .gh-cmp-row-label {
    border-bottom: none;
}

/* Boolean ✓ değerleri — yeşil checkmark vurgusu */
.gh-cmp-cell--check {
    color: #059669;
    font-size: 18px;
    font-weight: 800;
}

/* Dash (yok) değerleri — silik */
.gh-cmp-cell--dash {
    color: #94a3b8;
    font-style: italic;
}

/* ── Footer note ── */
.gh-cmp-note {
    margin: 16px 4px 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.55;
    text-align: center;
    padding: 0 12px;
}

/* ── Mobile breakpoint ── */
@media (max-width: 768px) {
    .gh-compare-toggle {
        padding: 11px 20px;
        font-size: 14px;
    }
    .gh-cmp-scroll-wrap {
        border-radius: 12px;
    }
    .gh-cmp-table {
        font-size: 13px;
        min-width: 600px;
    }
    .gh-cmp-th-feature,
    .gh-cmp-row-label {
        width: 160px;
        min-width: 150px;
        padding: 12px;
    }
    .gh-cmp-table thead th {
        padding: 14px 10px;
    }
    .gh-cmp-pkg-name { font-size: 15px; }
    .gh-cmp-pkg-price { font-size: 19px; }
    .gh-cmp-pkg-cta {
        padding: 6px 14px;
        font-size: 12px;
    }
    .gh-cmp-cell {
        padding: 11px 10px;
    }
}

/* ── Reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
    .gh-compare-panel { animation: none !important; }
    .gh-compare-toggle-chevron { transition: none !important; }
    .gh-compare-toggle { transition: opacity 0.2s ease !important; }
}
