﻿/* =========================
   REKORDY (TargetFan vibe)
   SCOPED: .tf-rekords
   Zero global body, zero konfliktów
========================= */

.tf-rekords {
    --tf-bg: rgba(18, 21, 27, .62);
    --tf-bg-2: rgba(11, 13, 16, .45);
    --tf-border: rgba(255, 255, 255, .08);
    --tf-border-2: rgba(255, 255, 255, .06);
    --tf-text: rgba(229, 231, 235, .86);
    --tf-text-dim: rgba(229, 231, 235, .72);
    --tf-gold: #ffcc00;
    --tf-gold-soft: rgba(255, 204, 0, .92);
    --tf-gold-line: rgba(255, 204, 0, .22);
    --tf-shadow: 0 22px 80px rgba(0, 0, 0, .55);
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px 14px 46px;
    position: relative;
}

    /* Delikatny glow pod contentem */
    .tf-rekords::before {
        content: "";
        position: absolute;
        left: 50%;
        top: 78px;
        transform: translateX(-50%);
        width: min(1200px, calc(100% - 28px));
        height: 420px;
        background: radial-gradient(circle at 18% 18%, rgba(255, 204, 0, .12), transparent 55%), radial-gradient(circle at 82% 26%, rgba(255, 255, 255, .06), transparent 58%);
        opacity: .9;
        pointer-events: none;
        z-index: 0;
    }

    .tf-rekords > * {
        position: relative;
        z-index: 1;
    }

/* =========================
   HEAD (tytuł + opis + akcje)
========================= */

.tf-rekords-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.tf-rekords-title {
    margin: 10px 0 6px;
    font-weight: 950;
    letter-spacing: .2px;
    color: #fff;
    font-size: clamp(28px, 3.2vw, 44px);
    line-height: 1.05;
}

.tf-rekords-sub {
    margin: 0;
    color: var(--tf-text-dim);
    max-width: 760px;
    line-height: 1.55;
    font-size: 14px;
}

.tf-rekords-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* =========================
   PANEL (główne tło pod taby/tabelę)
========================= */

.tf-rekords-panel {
    margin-top: 18px;
    border-radius: 26px;
    padding: 14px;
    background: linear-gradient(180deg, rgba(18, 21, 27, .74), rgba(18, 21, 27, .56));
    border: 1px solid var(--tf-border);
    box-shadow: var(--tf-shadow);
    overflow: hidden;
    position: relative;
    isolation: isolate;
}

    .tf-rekords-panel::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 26px;
        padding: 1px;
        background: linear-gradient(135deg, rgba(255, 204, 0, .18), rgba(255, 255, 255, .06), rgba(255, 204, 0, .12));
        -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        pointer-events: none;
        opacity: .9;
        z-index: 0;
    }

    .tf-rekords-panel > * {
        position: relative;
        z-index: 1;
    }

/* =========================
   TABS
========================= */

.tf-rekords .rekordy-index-tabs {
    background: rgba(11, 13, 16, .35);
    border: 1px solid var(--tf-border);
    border-radius: 18px;
    padding: 10px;
    box-shadow: none;
}

.tf-rekords .nav-tabs {
    border-bottom: 0;
    gap: 8px;
}

    .tf-rekords .nav-tabs .nav-link {
        border: 1px solid var(--tf-border);
        background: rgba(11, 13, 16, .45);
        color: var(--tf-text-dim);
        font-weight: 850;
        border-radius: 14px;
        padding: .55rem .85rem;
        transition: .18s ease;
        line-height: 1;
    }

        .tf-rekords .nav-tabs .nav-link:hover {
            background: rgba(255, 204, 0, .10);
            border-color: rgba(255, 204, 0, .22);
            color: #fff;
        }

        .tf-rekords .nav-tabs .nav-link.active {
            background: rgba(255, 204, 0, .14);
            border-color: rgba(255, 204, 0, .28);
            color: var(--tf-gold-soft);
        }

/* =========================
   TABLE WRAPPER
========================= */

.tf-rekords .rekordy-index-table-container {
    margin-top: 14px;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid var(--tf-border);
    background: rgba(11, 13, 16, .35);
    box-shadow: none;
}

/* Table base */
.tf-rekords .rekordy-index-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    color: var(--tf-text);
}

    .tf-rekords .rekordy-index-table thead th {
        background: rgba(255, 204, 0, .10);
        color: var(--tf-gold-soft);
        font-weight: 950;
        font-size: 13px;
        padding: 14px 14px;
        border-bottom: 1px solid var(--tf-border);
        text-transform: uppercase;
        letter-spacing: .35px;
    }

    .tf-rekords .rekordy-index-table tbody td {
        padding: 14px;
        border-bottom: 1px solid var(--tf-border-2);
        background: rgba(255, 255, 255, .02);
        vertical-align: middle;
    }

    .tf-rekords .rekordy-index-table tbody tr:hover td {
        background: rgba(255, 204, 0, .06);
    }

/* Score badge (jeśli używasz badge.bg-warning) */
.tf-rekords .badge.bg-warning {
    background: rgba(255, 204, 0, .18) !important;
    border: 1px solid rgba(255, 204, 0, .30);
    color: var(--tf-gold-soft) !important;
    font-weight: 950;
    padding: .45rem .6rem;
    border-radius: 14px;
}

/* Actions column */
.tf-rekords .rekordy-index-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* =========================
   BUTTONS (scoped)
========================= */

.tf-rekords .btn,
.tf-rekords .rekordy-button,
.tf-rekords .rekordy-create-button,
.tf-rekords .rekordy-edit-button-save,
.tf-rekords .rekordy-delete-button-danger,
.tf-rekords .rekordy-instrukcja-button {
    border-radius: 14px;
    font-weight: 850;
    border: 1px solid var(--tf-border);
    transition: .18s ease;
}

    .tf-rekords .btn:hover,
    .tf-rekords .rekordy-button:hover,
    .tf-rekords .rekordy-create-button:hover,
    .tf-rekords .rekordy-edit-button-save:hover,
    .tf-rekords .rekordy-delete-button-danger:hover,
    .tf-rekords .rekordy-instrukcja-button:hover {
        transform: translateY(-1px);
    }

/* Primary (dark+gold) */
.tf-rekords .btn-primary {
    background: rgba(18, 21, 27, .55);
    border-color: rgba(255, 204, 0, .22);
    color: var(--tf-gold-soft);
}

    .tf-rekords .btn-primary:hover {
        background: rgba(255, 204, 0, .12);
        border-color: rgba(255, 204, 0, .28);
        color: #fff;
    }

/* Warning (gold fill) */
.tf-rekords .btn-warning,
.tf-rekords .rekordy-button,
.tf-rekords .rekordy-create-button,
.tf-rekords .rekordy-edit-button-save,
.tf-rekords .rekordy-delete-button-danger {
    background: linear-gradient(135deg, #ffcc00, #e6b800);
    border-color: rgba(255, 204, 0, .35);
    color: #111;
}

    .tf-rekords .btn-warning:hover,
    .tf-rekords .rekordy-button:hover,
    .tf-rekords .rekordy-create-button:hover,
    .tf-rekords .rekordy-edit-button-save:hover,
    .tf-rekords .rekordy-delete-button-danger:hover {
        filter: brightness(1.07);
    }

/* Danger */
.tf-rekords .btn-danger {
    background: rgba(255, 80, 80, .12);
    border-color: rgba(255, 80, 80, .22);
    color: rgba(255, 220, 220, .92);
}

/* Instrukcja button (outline gold) */
.tf-rekords .rekordy-instrukcja-button {
    background: transparent;
    color: var(--tf-gold-soft);
    border: 1px solid rgba(255, 204, 0, .28);
    padding: 8px 12px;
}

    .tf-rekords .rekordy-instrukcja-button:hover {
        background: rgba(255, 204, 0, .12);
        border-color: rgba(255, 204, 0, .36);
        color: #fff;
    }

/* Links */
.tf-rekords .rekordy-link,
.tf-rekords .rekordy-create-link,
.tf-rekords .rekordy-edit-link,
.tf-rekords .rekordy-delete-link {
    display: inline-block;
    margin-top: 10px;
    text-decoration: none;
    color: var(--tf-gold-soft);
    font-weight: 850;
}

    .tf-rekords .rekordy-link:hover,
    .tf-rekords .rekordy-create-link:hover,
    .tf-rekords .rekordy-edit-link:hover,
    .tf-rekords .rekordy-delete-link:hover {
        text-decoration: underline;
    }

/* =========================
   MODAL (scoped)
========================= */

.tf-rekords .modal-content {
    background: rgba(18, 21, 27, .96);
    border: 1px solid var(--tf-border);
    border-radius: 18px;
    box-shadow: 0 18px 60px rgba(0,0,0,.55);
}

.tf-rekords .modal-header {
    border-bottom: 1px solid var(--tf-border-2);
}

.tf-rekords .modal-footer {
    border-top: 1px solid var(--tf-border-2);
}

.tf-rekords .btn-close {
    filter: invert(1);
    opacity: .75;
}

    .tf-rekords .btn-close:hover {
        opacity: 1;
    }

/* =========================
   DETAILS / CREATE / EDIT / DELETE (karty)
========================= */

.tf-rekords .rekordy-details-wrapper,
.tf-rekords .rekordy-index-wrapper,
.tf-rekords .rekordy-create-wrapper,
.tf-rekords .rekordy-edit-wrapper,
.tf-rekords .rekordy-delete-wrapper {
    background: linear-gradient(180deg, rgba(18,21,27,.72), rgba(18,21,27,.56));
    border-radius: 22px;
    border: 1px solid var(--tf-border);
    box-shadow: var(--tf-shadow);
    max-width: 900px;
    margin: 0 auto;
    padding: 22px;
    animation: rekordy-fadeIn .45s ease-in-out;
}

/* Header w details */
.tf-rekords .rekordy-header,
.tf-rekords .rekordy-index-header,
.tf-rekords .rekordy-create-header,
.tf-rekords .rekordy-edit-header,
.tf-rekords .rekordy-delete-header {
    text-align: center;
    font-size: 28px;
    font-weight: 950;
    color: var(--tf-gold-soft);
    margin-bottom: 20px;
}

/* Result card */
.tf-rekords .rekordy-card {
    background: rgba(11, 13, 16, .35);
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--tf-border);
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
    color: var(--tf-text);
}

/* Score */
.tf-rekords .rekordy-score {
    font-size: 34px;
    font-weight: 950;
    color: var(--tf-gold);
    margin: 12px 0 10px;
}

/* Details list */
.tf-rekords .rekordy-details-list dt {
    font-weight: 900;
    color: var(--tf-gold-soft);
    margin-top: 10px;
}

.tf-rekords .rekordy-details-list dd {
    color: var(--tf-text);
    margin-left: 0;
}

/* Previous record */
.tf-rekords .rekordy-previous-record {
    background: rgba(11, 13, 16, .35);
    padding: 14px 16px;
    border-radius: 18px;
    margin-top: 18px;
    border: 1px solid rgba(255, 204, 0, .22);
    color: var(--tf-text);
}

/* Hall of fame block */
.tf-rekords .rekordy-hall-of-fame {
    margin-top: 18px;
    background: rgba(11, 13, 16, .35);
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--tf-border);
}

    .tf-rekords .rekordy-subheader,
    .tf-rekords .rekordy-hall-of-fame h3 {
        color: #fff;
        font-weight: 950;
        margin-bottom: 12px;
    }

/* Simple table for details view (custom, nie bootstrap) */
.tf-rekords .rekordy-table-wrap {
    overflow-x: auto;
}

.tf-rekords .rekordy-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--tf-text);
    border-radius: 16px;
    overflow: hidden;
}

    .tf-rekords .rekordy-table thead th {
        background: rgba(255, 204, 0, .10);
        color: var(--tf-gold-soft);
        font-weight: 950;
        font-size: 13px;
        padding: 12px 12px;
        border-bottom: 1px solid var(--tf-border);
        text-transform: uppercase;
        letter-spacing: .35px;
    }

    .tf-rekords .rekordy-table tbody td {
        padding: 12px;
        border-bottom: 1px solid var(--tf-border-2);
        background: rgba(255,255,255,.02);
    }

    .tf-rekords .rekordy-table tbody tr:hover td {
        background: rgba(255, 204, 0, .06);
    }

    .tf-rekords .rekordy-table tbody tr.rekordy-top td {
        background: rgba(255, 204, 0, .07);
    }

.tf-rekords .rekordy-empty {
    text-align: center;
    padding: 14px;
    color: var(--tf-text-dim);
}

/* Chart */
.tf-rekords .rekordy-chart-container {
    margin-top: 18px;
    background: rgba(11, 13, 16, .35);
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid var(--tf-border);
    height: 320px; /* żeby chart miał miejsce */
}

/* Actions row */
.tf-rekords .rekordy-actions {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* =========================
   Anim
========================= */

@keyframes rekordy-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================
   Mobile polish
========================= */
@media (max-width: 992px) {
    .tf-rekords-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .tf-rekords-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .tf-rekords .rekordy-index-actions {
        justify-content: flex-start;
    }

    .tf-rekords .rekordy-chart-container {
        height: 280px;
    }
}
