/* ==========================================================================
   Plik: assets/css/shortcode-top-firms.css
   Wersja: 13.6 – Layout: logo+nazwa | zniżka+kupon | donut | 2 przyciski
   ========================================================================== */

/* --------------------------------------------------------------------------
   STYL DOMYŚLNY (ciemne tło) – bez zmian
   -------------------------------------------------------------------------- */
.dashboard-column {
    background: rgba(22, 28, 44, 0.7);
    border: 1px solid;
    border-radius: 12px;
    padding: 25px;
    height: 100%;
    transition: all 0.2s ease-in-out;
}
.dashboard-column:hover {
    transform: translateY(-5px);
    background: rgba(30, 38, 58, 0.9);
}
.cfd-column     { border-color: rgba(0, 123, 255, 0.4); }
.cfd-column:hover { border-color: rgba(0, 123, 255, 0.7); }
.futures-column { border-color: rgba(74, 222, 128, 0.4); }
.futures-column:hover { border-color: rgba(74, 222, 128, 0.7); }

.dashboard-title {
    color: rgba(255,255,255,0.9) !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    margin: 0 0 20px !important;
    text-align: left;
}

.firms-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px 15px;
}
.firm-item {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
    padding: 5px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}
.firm-item:hover { background-color: rgba(255,255,255,0.05); }
.firm-item img {
    width: 36px; height: 36px;
    object-fit: contain;
    background-color: #fff;
    border: 1px solid #374151;
    border-radius: 6px;
    padding: 4px;
    flex-shrink: 0;
}
.firm-item span { font-size: 12px !important; font-weight: 500; color: #e2e8f0; transition: color 0.2s; }
.firm-item:hover span { color: #fff; }

.prop-score-badge {
    position: relative;
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    background: conic-gradient(var(--score-color) var(--score-percent), rgba(0,0,0,0.2) 0);
}
.prop-score-badge::before {
    content: '';
    position: absolute;
    left: 4px; top: 4px; right: 4px; bottom: 4px;
    background: #10192b;
    border-radius: 50%;
    transition: background-color 0.2s ease-in-out;
}
.dashboard-column:hover .prop-score-badge::before { background: #1e263a; }
.prop-score-badge span {
    position: relative; z-index: 1;
    font-size: 14px; font-weight: 700; color: #f0fdf4;
}
@media (max-width: 1024px) { .firms-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 767px)  { .firms-grid { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 480px)  { .firms-grid { grid-template-columns: repeat(2,1fr); } }

/* --------------------------------------------------------------------------
   STYL CARDS v13.7 – jasne tło (style="cards")
   ZMIANY vs 13.6:
   – wrapper dostał tło + padding (sekcja wyróżnia się od treści strony)
   – tytuł sekcji większy + label "Popularne"
   – karty: górny pasek akcentu, więcej oddychania, większe logo
   – przycisk "Sprawdź" wyższy i wyraźniejszy
   -------------------------------------------------------------------------- */

/* Akcent koloru per kategoria */
.top-firms-cards--cfd    { --tf-accent: #1a56db; --tf-accent-hover: #1447c0; --tf-border: rgba(26,86,219,0.25); --tf-top: #1a56db; }
.top-firms-cards--futures{ --tf-accent: #16a34a; --tf-accent-hover: #15803d; --tf-border: rgba(22,163,74,0.25);  --tf-top: #16a34a; }

/* [1] WRAPPER – sekcja dostaje własne tło, żeby była wyraźnie oddzielona */
.top-firms-cards-wrapper {
    margin: 0 0 8px;
    background: #f5f7ff;
    border: 1px solid #e4e9f7;
    border-radius: 14px;
    padding: 20px 20px 18px;
}

/* [2] HEADER – etykieta "Popularne" + większy tytuł */
.top-firms-cards-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* Mała etykieta przed tytułem – dodaj ją przez ::before na wrapperze albo jako osobny span w PHP */
/* Jeśli chcesz dodać ją w PHP: <span class="tfc-label">🔥 Popularne</span> */
.tfc-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #060097;
    color: #ffcd57;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 20px;
    flex-shrink: 0;
    line-height: 1.5;
}

.top-firms-cards-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    text-decoration: none!important;
    display: inline-block;
    line-height: 1.2;
    transition: color 0.2s ease;
}
.top-firms-cards-title:hover { color: var(--tf-accent); }

/* [3] SIATKA – minimalnie większy gap */
.top-firms-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

/* [4] KARTA – górny pasek akcentu, więcej paddingu */
.top-firms-card {
    background: #fff;
    border: 1.5px solid var(--tf-border);
    border-top: 3px solid var(--tf-top);   /* ← kolorowy pasek na górze karty */
    border-radius: 10px;
    padding: 16px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.top-firms-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.11);
    transform: translateY(-3px);
}

/* ── Górna sekcja: 3 kolumny ── */
.tfc-body {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* LEWA – logo + nazwa */
.tfc-identity {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    flex-shrink: 0;
    width: 88px;            /* [5] odrobinę szerzej = loga nie są ściskane */
}
.tfc-logo {
    max-width: 80px;        /* [5] powiększone z 72px */
    max-height: 40px;       /* [5] powiększone z 36px */
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
.tfc-name {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 88px;
}

/* ŚRODEK – zniżka + kupon */
.tfc-middle {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

/* Zniżka */
.tfc-discount {
    display: flex;
    align-items: center;
}
.tfc-discount .promo-cell-content {
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 3px 9px !important;
    border-radius: 20px !important;
    white-space: nowrap;
    display: inline-block;
}

/* Kupon z kopiowaniem */
.tfc-coupon {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #f0fdf4;
    border: 1.5px dashed #16a34a;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.18s ease, border-color 0.18s ease;
    position: relative;
    overflow: hidden;
}
.tfc-coupon:hover          { background: #dcfce7; border-color: #15803d; }
.tfc-coupon:focus-visible  { outline: 2px solid #16a34a; outline-offset: 2px; }

.tfc-coupon-label {
    font-size: 9px;
    font-weight: 700;
    color: #15803d;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}
.tfc-coupon-code {
    font-size: 11px;
    font-weight: 800;
    color: #166534;
    letter-spacing: 0.05em;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tfc-coupon-icon {
    color: #16a34a;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: color 0.18s;
}
.tfc-coupon:hover .tfc-coupon-icon { color: #15803d; }

/* Overlay "Skopiowano!" */
.tfc-coupon-confirm {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #16a34a;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}
.tfc-coupon.is-copied .tfc-coupon-confirm {
    opacity: 1;
    transform: scale(1);
}

/* PRAWA – donut PropIndeks */
.tfc-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.tfc-donut {
    position: relative;
    width: 48px; height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: conic-gradient(var(--score-color) var(--score-percent), #e5e7eb 0);
}
.tfc-donut::before {
    content: '';
    position: absolute;
    left: 6px; top: 6px; right: 6px; bottom: 6px;
    background: #fff;
    border-radius: 50%;
}
.tfc-donut-value {
    position: relative; z-index: 1;
    font-size: 13px; font-weight: 800;
    color: #111827; line-height: 1;
}
.tfc-score-label {
    font-size: 8px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: center;
}
/* Link owijający logo + nazwę */
.tfc-identity-link {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    text-decoration: none !important;
    color: inherit;
}
.tfc-identity-link:hover .tfc-name {
    color: var(--tf-accent, #1a56db) !important;
}


/* ── Dolna sekcja: dwa przyciski obok siebie ── */
.tfc-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}
/* Jeśli tylko jeden przycisk – zajmuje całą szerokość */
.tfc-actions .tfc-btn:only-child {
    grid-column: 1 / -1;
}

.tfc-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    height: 36px;
    padding: 0 8px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none !important;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid transparent; /* zapobiega przesunięciu przez border secondary */
}

/* [6] Zielony – "Sprawdź →" (affiliate) – wyższy i bardziej widoczny */
.tfc-btn--primary {
    background-color: #18a34a;
    color: #fff !important;
    border-color: #18a34a;
    font-size: 13px;
    font-weight: 700;
    height: 38px;
    letter-spacing: 0.01em;
}
.tfc-btn--primary:hover {
    background-color: #15803d;
    color: #fff !important;
    box-shadow: 0 3px 10px rgba(22,163,74,0.35);
}

/* Biały – "Recenzja" */
.tfc-btn--secondary {
    background-color: transparent;
    color: #374151 !important;
    border: 1px solid #d1d5db;
}
.tfc-btn--secondary:hover {
    background-color: #f3f4f6;
    color: #111827 !important;
    border-color: #9ca3af;
}

/* --------------------------------------------------------------------------
   RESPONSYWNOŚĆ – CARDS
   -------------------------------------------------------------------------- */
@media (min-width: 600px) and (max-width: 900px) {
    .top-firms-cards-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 599px) {
    .top-firms-cards-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .top-firms-card { padding: 10px; }
    .tfc-identity   { width: 70px; }
    .tfc-logo       { max-width: 60px; max-height: 30px; }
    .tfc-name       { max-width: 70px; font-size: 11px !important; }
    .tfc-donut      { width: 42px; height: 42px; }
    .tfc-donut-value { font-size: 12px; }
    .tfc-actions    { grid-template-columns: 1fr 1fr; }
}

/* ==========================================================================
   STYL POPULAR-DARK – poziomy pasek popularne firmy (homepage hero)
   Użycie: [top_firms popular="true" style="popular-dark" count="3"]
   ========================================================================== */

/* Akcent koloru per typ */
.tpd--cfd    { --tpd-accent: #3b82f6; --tpd-btn: #1a56db; --tpd-btn-hover: #1447c0; }
.tpd--futures{ --tpd-accent: #22c55e; --tpd-btn: #16a34a; --tpd-btn-hover: #15803d; }

/* Wrapper – dopasowany do ciemnego tła hero */
.tpd-wrapper {
    background: rgba(22, 28, 44, 0.75);
    border: 1px solid rgba(255,255,255,0.1);
    border-top: 2px solid var(--tpd-accent);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 16px;
}

/* Nagłówek: etykieta + tytuł */
.tpd-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.tpd-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 205, 87, 0.15);
    border: 1px solid rgba(255, 205, 87, 0.35);
    color: #ffcd57;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 20px;
    flex-shrink: 0;
}
.tpd-title {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    line-height: 1.2;
}

/* Siatka firm – 1 kolumna (boxy siedzą obok siebie, firmy jedna pod drugą) */
.tpd-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Karta firmy */
.tpd-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 12px 14px;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.tpd-card:hover {
    background: rgba(255,255,255,0.09);
    border-color: rgba(255,255,255,0.18);
}

/* ── CARD: CSS Grid – 4 stałe kolumny, idealnie wyrównane we wszystkich kartach ──
   [donut 40px] [logo+nazwa 100px] [promo flex] [button 130px]
   Dzięki grid każda kolumna ma tę samą szerokość niezależnie od treści.       */
.tpd-card {
    display: grid !important;
    grid-template-columns: 40px 100px 1fr 130px;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 12px 14px;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.tpd-card:hover {
    background: rgba(255,255,255,0.09);
    border-color: rgba(255,255,255,0.18);
}

/* Kolumna 1: sam donut */
.tpd-donut {
    position: relative;
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: conic-gradient(var(--score-color) var(--score-percent), rgba(255,255,255,0.1) 0);
}
.tpd-donut::before {
    content: '';
    position: absolute;
    left: 5px; top: 5px; right: 5px; bottom: 5px;
    background: #10192b;
    border-radius: 50%;
}
.tpd-donut-val {
    position: relative; z-index: 1;
    font-size: 11px; font-weight: 800;
    line-height: 1;
}

/* Kolumna 2: logo + nazwa (stała szerokość 100px) */
.tpd-identity {
    display: contents; /* donut i logo-link stają się bezpośrednimi dziećmi grida */
}
.tpd-logo-link {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    text-decoration: none !important;
    overflow: hidden;
}
.tpd-logo {
    max-width: 72px;
    max-height: 28px;
    width: auto; height: auto;
    object-fit: contain;
    background: rgba(255,255,255,0.9);
    border-radius: 5px;
    padding: 3px 5px;
    display: block;
}
.tpd-name {
    font-size: 11px !important;
    font-weight: 600 !important;
    color: rgba(255,255,255,0.75) !important;
    margin: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    line-height: 1.2 !important;
    transition: color 0.2s;
}
.tpd-logo-link:hover .tpd-name { color: #fff !important; }

/* Kolumna 3: zniżka + kupon w jednej linii, flex */
.tpd-promo {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
}
/* Zniżka: stała szerokość 48px żeby kod kuponu zawsze zaczyna się w tym samym miejscu */
.tpd-discount {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    width: 48px;
    justify-content: center;
}
.tpd-discount .promo-cell-content {
    font-size: 11px !important;
    font-weight: 700 !important;
    padding: 2px 6px !important;
    border-radius: 20px !important;
    white-space: nowrap;
    display: inline-block;
}
.tpd-coupon {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;           /* zajmuje resztę miejsca w .tpd-promo */
    min-width: 0;
    background: rgba(22,163,74,0.15);
    border: 1px dashed rgba(34,197,94,0.5);
    border-radius: 5px;
    padding: 3px 7px;
    cursor: pointer;
    user-select: none;
    position: relative;
    overflow: hidden;
    transition: background 0.18s, border-color 0.18s;
}
.tpd-coupon:hover { background: rgba(22,163,74,0.25); border-color: #22c55e; }
.tpd-coupon-label { font-size: 9px; font-weight: 700; color: #86efac; text-transform: uppercase; letter-spacing: 0.05em; flex-shrink: 0; }
.tpd-coupon-code  { font-size: 10px; font-weight: 800; color: #dcfce7; letter-spacing: 0.05em; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpd-coupon-icon  { color: #86efac; display: flex; align-items: center; flex-shrink: 0; }
.tpd-coupon-confirm {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: #16a34a; color: #fff; font-size: 10px; font-weight: 700;
    border-radius: 4px; opacity: 0; transform: scale(0.95);
    transition: opacity 0.18s, transform 0.18s; pointer-events: none;
}
.tpd-coupon.is-copied .tpd-coupon-confirm { opacity: 1; transform: scale(1); }

/* Kolumna 4: CTA button – STAŁA szerokość = zawsze wyrównany w każdej karcie */
.tpd-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 130px;           /* stała szerokość – niezależna od tekstu */
    height: 38px;
    padding: 0;
    background: var(--tpd-btn);
    color: #fff !important;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background 0.2s, box-shadow 0.2s;
    letter-spacing: 0.01em;
}
.tpd-btn:hover {
    background: var(--tpd-btn-hover);
    box-shadow: 0 3px 12px rgba(0,0,0,0.35);
    color: #fff !important;
}

/* --------------------------------------------------------------------------
   RESPONSYWNOŚĆ – POPULAR-DARK
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
    /* Na mobile grid zamienia się w 2 kolumny: [donut+logo | button] i [promo pod spodem] */
    .tpd-card {
        grid-template-columns: 40px 1fr 110px !important;
        grid-template-rows: auto auto;
    }
    .tpd-logo-link { grid-column: 2; grid-row: 1; }
    .tpd-donut     { grid-column: 1; grid-row: 1; }
    .tpd-promo     { grid-column: 1 / -1; grid-row: 2; }
    .tpd-btn       { grid-column: 3; grid-row: 1; width: 110px; font-size: 11px; }
}