/* Learnbin Lab Universal Tool Modules CSS*/
/* Version 1.0 */


.lb-grid-wrapper {
    width: 100%;
    background-color: var(--_lb-t-bg);
    border: 1px solid var(--_lb-t-border);
    border-radius: var(--_lb-t-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Scroll Area: Handles BOTH Vertical and Horizontal Scroll */
.lb-grid-scroll-area {
    overflow: auto; /* Auto enables scrollbars when needed */
    max-height: 500px;
    background-color: var(--_lb-t-input-bg);
    position: relative;
    width: 100%;
}

.lb-grid-table {
    /* Ensure table doesn't shrink below its content width */
    width: max-content; 
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-family: var(--_lb-t-font-body);
    font-size: 0.9rem;
}

/* --- HEADERS --- */
.lb-grid-table thead th {
    background-color: #262626;
    color: var(--_lb-t-text);
    position: sticky;
    top: 0;
    z-index: 10; /* Higher than index col */
    padding: 0;
    border-bottom: 1px solid var(--_lb-t-border);
    border-right: 1px solid var(--_lb-t-border);
    /* Prevent headers from squishing */
    min-width: 150px; 
    max-width: 250px;
}

.lb-grid-header-input {
    background: transparent;
    border: 1px solid transparent;
    color: var(--_lb-t-text);
    font-family: var(--_lb-t-font-heading);
    font-weight: 600;
    text-align: center;
    width: 100%;
    padding: 10px 4px;
    outline: none;
}
.lb-grid-header-input:focus {
    background-color: rgba(255, 255, 255, 0.05);
    border-bottom: 2px solid var(--_lb-t-accent);
}

/* --- CELLS --- */
.lb-grid-table td {
    border-bottom: 1px solid var(--_lb-t-border);
    border-right: 1px solid var(--_lb-t-border);
    padding: 0;
    height: 36px;
    background-color: var(--_lb-t-input-bg);
    /* Match header min-width to ensure alignment */
    min-width: 150px;
    max-width: 250px;
}

.lb-grid-cell-input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--_lb-t-text);
    padding: 0 8px;
    font-family: var(--_lb-t-font-body);
    font-size: 0.85rem;
    outline: none;
    text-align: center;
}
.lb-grid-cell-input:focus {
    background-color: rgba(59, 130, 246, 0.1);
    box-shadow: inset 0 0 0 2px var(--_lb-t-accent);
}
._lb-grid-cell-select option{
    background-color:#262626;
    color: var(--_lb-t-text);
    font-size: 0.8rem;
}

/* Row Number Column - STICKY LEFT */
.lb-grid-index-col {
    width: 50px !important;
    min-width: 50px!important; /* Fixed width */
    max-width: 50px!important;
    background-color: #2c2c2c;
    color: var(--_lb-t-text-2);
    font-size: 0.8rem;
    text-align: center;
    border-right: 1px solid var(--_lb-t-border);
    position: sticky;
    left: 0;
    z-index: 5;
}
.lb-grid-action-btn-col{
    width: 50px !important;
    min-width: 50px!important; /* Fixed width */
    max-width: 50px!important;
}
/* Ensure top-left corner stays on top of everything */
.lb-grid-table thead th.lb-grid-index-col {
    z-index: 20; 
}

/* --- TOOLBAR --- */
.lb-grid-toolbar {
    background-color: #262626;
    border-top: 1px solid var(--_lb-t-border);
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* Quick Input Wrapper */
.lb-grid-quick-input {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #3e3c3c;
    padding: 2px 5px;
    border-radius: var(--_lb-t-radius);
    border: 1px solid var(--_lb-t-border);
}

.lb-grid-quick-input input {
    background: transparent;
    border: none;
    color: white;
    width: 50px;
    text-align: center;
    font-family: inherit;
    font-size: 0.9rem;
}
.lb-grid-quick-input span {
    font-size: 0.8rem;
    color: #aaa;
    user-select: none;
}

/* Delete Buttons */
.lb-grid-action-btn {
    background: transparent;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
    width: 100%;
    height: 100%;
}
.lb-grid-action-btn:hover { background-color: rgba(239, 68, 68, 0.1); }

.lb-grid-del-col {
    cursor: pointer;
    color: #ef4444;
    font-size: 14px;
    padding: 0 5px;
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
}