/* FRY Sportivi – Public CSS
   Stilul replica exact admin-ul: compact, modern, curat.
*/

/* =====================================================================
   CONTAINER
   ===================================================================== */
.fry-public {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    color: #1d2327;
}

/* =====================================================================
   FILTRE — identic cu .fry-topbar din admin
   ===================================================================== */
.fry-public-filters {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    margin-bottom: 16px;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.fry-public-filters input[type="search"],
.fry-public-filters select {
    height: 32px !important;
    line-height: 30px !important;
    padding: 0 8px !important;
    box-sizing: border-box !important;
    border: 1px solid #ccc !important;
    border-radius: 3px !important;
    font-size: 0.88em !important;
    background: #fff !important;
    vertical-align: middle !important;
    width: auto !important;
    max-width: none !important;
    display: inline-block !important;
    flex-shrink: 0;
}

.fry-public-filters input[type="search"] {
    width: 220px !important;
    flex-shrink: 1;
    min-width: 100px;
}

.fry-public-filters select {
    padding-right: 28px !important;
    width: 160px !important;
    flex-shrink: 1;
    min-width: 100px;
}

/* Tablet: filtrele se comprima dar raman pe un rand */
@media (max-width: 768px) {
    .fry-public-filters {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    .fry-public-filters input[type="search"] {
        width: 100% !important;
        flex-shrink: unset;
    }
    .fry-public-filters select {
        width: calc(50% - 4px) !important;
        flex-shrink: unset;
    }
    .fry-public-count {
        width: 100%;
        text-align: right;
        line-height: 1.4;
        margin-left: 0;
    }
}

/* Mobile mic */
@media (max-width: 480px) {
    .fry-public-filters select {
        width: 100% !important;
    }
}

.fry-public-filters input[type="search"]:focus,
.fry-public-filters select:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

.fry-public-count {
    margin-left: auto;
    font-size: 0.82em;
    color: #666;
    white-space: nowrap;
    line-height: 32px;
}

/* Tabel responsive — scroll orizontal pe ecrane mici */
@media (max-width: 768px) {
    .fry-public-table {
        font-size: 0.75em;
    }
    .fry-public-table th,
    .fry-public-table td {
        padding: 4px 2px;
    }
}

/* =====================================================================
   TABEL — identic cu .fry-table din admin
   ===================================================================== */
.fry-table-wrap { width: 100%; overflow-x: auto; }

.fry-public-table {
    font-size: 0.82em;
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.fry-public-table th,
.fry-public-table td {
    padding: 5px 3px;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fry-public-table thead th {
    background: #f0f0f1;
    font-weight: 600;
    font-size: 0.80em;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid #ddd;
    cursor: default;
}

.fry-public-table thead th[title] {
    cursor: help;
    border-bottom: 1px dotted #999;
}

.fry-public-table tbody td {
    border-bottom: 1px solid #f0f0f0;
}

.fry-public-table tbody tr:hover {
    background: #f6f7f7 !important;
}

/* Laturi fixe coloane */
.fry-public-table col.col-nr     { width: 80px;  }
.fry-public-table col.col-nume   { width: 110px; }
.fry-public-table col.col-pren   { width: 120px; }
.fry-public-table col.col-leg    { width: 78px;  }
.fry-public-table col.col-club   { width: auto;  }
.fry-public-table col.col-varsta { width: 36px;  }
.fry-public-table col.col-cat    { width: 58px;  }
.fry-public-table col.col-cert   { width: 60px;  }
.fry-public-table col.col-ad     { width: 34px;  }
.fry-public-table col.col-taxas  { width: 34px;  }
.fry-public-table col.col-taxac  { width: 34px;  }
.fry-public-table col.col-dc     { width: 34px;  }
.fry-public-table col.col-pal    { width: 80px;  }

/* =====================================================================
   ICOANE & BADGES — identic cu admin
   ===================================================================== */
.fry-yes { color: #2e7d32; font-weight: 700; font-size: 1.1em; }
.fry-no  { color: #b71c1c; font-weight: 700; font-size: 1.1em; }

.fry-cert-data {
    font-size: 0.82em;
    color: #1565c0;
    font-weight: 500;
}

/* =====================================================================
   BUTON PALMARES
   ===================================================================== */
.fry-pal-cell { text-align: center; }

.fry-pal-btn {
    display: inline-block;
    padding: 2px 8px;
    background: #e8f0fe;
    color: #1a56db;
    border: 1px solid #c3d4fd;
    border-radius: 12px;
    font-size: 0.78em;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}
.fry-pal-btn:hover {
    background: #1a56db;
    color: #fff;
    border-color: #1a56db;
}
.fry-pal-empty { color: #ccc; font-size: 0.85em; }

/* =====================================================================
   MODAL OVERLAY
   ===================================================================== */
.fry-pal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.fry-pal-overlay.is-open {
    display: flex;
    animation: fryOverlayIn 0.18s ease;
}
@keyframes fryOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.fry-pal-modal {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fryModalIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes fryModalIn {
    from { opacity: 0; transform: scale(0.92) translateY(12px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

.fry-pal-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.fry-pal-modal-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.fry-pal-modal-label {
    font-size: 0.72em;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #999;
    font-weight: 600;
}
.fry-pal-modal-title strong {
    font-size: 1.1em;
    color: #1d2327;
}
.fry-pal-modal-close {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1em;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
    font-family: inherit;
}
.fry-pal-modal-close:hover { background: #f5f5f5; color: #1d2327; }

.fry-pal-modal-body {
    overflow-y: auto;
    padding: 0;
}

/* Tabel modal */
.fry-pal-modal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88em;
}
.fry-pal-modal-table thead tr {
    background: #f7f7f8;
    position: sticky;
    top: 0;
    z-index: 1;
}
.fry-pal-modal-table th {
    padding: 10px 16px;
    text-align: left;
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
    font-weight: 600;
    border-bottom: 1px solid #ebebeb;
}
.fry-pal-modal-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #f4f4f4;
    color: #333;
}
.fry-pal-modal-table tbody tr:last-child td { border-bottom: none; }
.fry-pal-modal-table tbody tr:hover { background: #fafafa; }

/* Animatie randuri */
.fry-pal-modal-table tbody tr {
    animation: fryRowIn 0.25s ease both;
}
@keyframes fryRowIn {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0);    }
}

/* Badge nivel */
.fry-nivel-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.82em;
    font-weight: 600;
}
.fry-nivel-local    { background: #f0f0f0; color: #555; }
.fry-nivel-regional { background: #e3f2fd; color: #1565c0; }
.fry-nivel-naional, .fry-nivel-national { background: #e8f5e9; color: #2e7d32; }
.fry-nivel-european { background: #fff3e0; color: #e65100; }
.fry-nivel-mondial  { background: #fce4ec; color: #880e4f; }

/* Loc — număr evidențiat */
.fry-loc-cell strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #f0f0f1;
    font-size: 0.88em;
    color: #333;
}

@media (max-width: 480px) {
    .fry-pal-modal { max-height: 90vh; }
    .fry-pal-modal-table th,
    .fry-pal-modal-table td { padding: 8px 10px; }
}

/* ---- Sortare coloane ---- */
.fry-public-table thead th[data-sort] {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.fry-public-table thead th[data-sort]:hover {
    background: #e4e4e6;
}
.fry-public-table thead th[data-sort]::after {
    content: ' ⇅';
    opacity: 0.35;
    font-size: 0.85em;
}
.fry-public-table thead th[data-sort].sort-asc::after {
    content: ' ↑';
    opacity: 1;
    color: #2271b1;
}
.fry-public-table thead th[data-sort].sort-desc::after {
    content: ' ↓';
    opacity: 1;
    color: #2271b1;
}
