/* Container pentru tabel cu scroll */
.sticky-table-container {
    position: relative;
    overflow: auto;
    max-height: 70vh; /* Se adaptează la înălțimea ecranului */
    border: 1px solid #dee2e6;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 1rem;
}

/* Tabelul principal */
.sticky-table {
    margin-bottom: 0;
    min-width: 100%; /* Asigură lățimea minimă */
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8rem;      /* text mai mic, ca să încapă mai multe coloane */
    line-height: 1.3;
}

/* Sticky pentru antet */
.sticky-table thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    background-color: var(--secondary-color);
    color: var(--light-color);
    font-weight: 600;
    font-size: 0.74rem;
    line-height: 1.25;
    padding: 0.55rem 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    transition: var(--transition);
}

/* Sticky pentru prima coloană */
.sticky-col {
    position: sticky;
    left: 0;
    z-index: 15;
    background-color: white;
    min-width: 118px; /* Lățime minimă pentru prima coloană */
    #max-width: 300px; /* Lățime maximă */
    padding: 0.4rem 0.6rem;
    border-right: 2px solid #e9ecef;
    transition: var(--transition);
}

/* Prima coloană din antet are prioritate mai mare */
.sticky-table thead .sticky-col {
    z-index: 25;
    background-color: var(--secondary-color);
    border-right: 2px solid var(--primary-color);
}

/* Hover pentru rânduri */
.sticky-table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.3) !important; /* Albastru deschis */
    cursor: pointer;
    transition: var(--transition);
}

/* Stil pentru rând selectat */
.sticky-table tbody tr.selected {
    background-color: rgba(255, 182, 193, 0.3) !important; /* Roșu pal */
    border-left: 3px solid #ff6b6b;
    transition: var(--transition);
}

/* Pentru a preveni ascunderea sticky sub barele de scroll */
.sticky-table-container::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.sticky-table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: var(--border-radius);
}

.sticky-table-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: var(--border-radius);
}

.sticky-table-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Stilizare pentru celulele cu numere */
.sticky-table td:not(.sticky-col) {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-weight: 500;
    padding: 0.4rem 0.5rem;
    white-space: nowrap; /* Previne împărțirea numerelor */
}

/* Antet pentru coloanele numerice */
.sticky-table th:not(.sticky-col) {
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .sticky-col {
        min-width: 110px;
        max-width: 200px;
    }
    
    .sticky-table {
        font-size: 0.75rem;
    }

    .sticky-table thead th {
        font-size: 0.7rem;
    }

    .sticky-table-container {
        max-height: 60vh;
    }
}

/*---------------------------------------------------*/
/* Reset culoare la Hover pentru tabele */
.table-hover.sticky-table > tbody > tr:hover {
    --bs-table-hover-bg: rgba(102, 126, 234, 0.3) !important;
    background-color: rgba(102, 126, 234, 0.3) !important;
}
/*---------------------------------------------------*/

/* ATAȚĂ ACEST COD LA FINALUL FIȘIERULUI CSS */

/* Folosește ID-uri sau clase adiționale pentru specificitate */
.sticky-table-container .sticky-table tbody tr.selected {
    background-color: rgba(255, 182, 193, 0.4) !important;
    --bs-table-bg: rgba(255, 182, 193, 0.4) !important;
    --bs-table-color: inherit !important;
}

/* Pentru hover pe rând selectat */
.sticky-table-container .sticky-table tbody tr.selected:hover {
    background-color: rgba(255, 182, 193, 0.6) !important;
    --bs-table-bg-state: rgba(255, 182, 193, 0.6) !important;
}

/* Pentru stripe rows (dacă folosești .table-striped) */
.sticky-table-container .sticky-table.table-striped tbody tr.selected:nth-of-type(odd) {
    background-color: rgba(255, 182, 193, 0.5) !important;
    --bs-table-striped-bg: rgba(255, 182, 193, 0.5) !important;
}

.sticky-table-container .sticky-table.table-striped tbody tr.selected:nth-of-type(even) {
    background-color: rgba(255, 182, 193, 0.3) !important;
    --bs-table-striped-bg: rgba(255, 182, 193, 0.3) !important;
}

