/**
 * Table Selector - Shared styles for all pages
 * Used in sidebar for table selection
 */

/* ================================================
   TABLE STATUS INDICATOR
   ================================================ */
.table-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 12px;
    color: #4caf50;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.table-status-badge i {
    font-size: 0.5rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ================================================
   TABLE SELECTOR SECTION
   ================================================ */
.table-selector-section {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.02);
}

/* Header row for table selector (label + status indicator) */
.table-selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

/* Hidden by default, shown via JS when a table is loaded */
#table-status-indicator {
    display: none;
}

.table-selector-section label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

.table-selector-section label i {
    margin-right: 4px;
}

/* Improved table selector styling */
.table-selector-section select {
    position: relative;
    width: 100%;
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s;
    cursor: pointer;
}

.table-selector-section select:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: #252525;
}

.table-selector-section select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.1);
}

.table-selector-section select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.table-loading-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 6px;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    z-index: 10;
}

.table-loading-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

.table-loading-overlay i {
    color: var(--color-accent);
    font-size: 1.2rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.table-selector-section .quantlib-btn {
    transition: all 0.2s ease;
    width: 100%;
    justify-content: center;
    padding: 8px;
    border-radius: 6px;
    font-weight: 500;
}

.table-selector-section .quantlib-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.table-selector-section .quantlib-btn:active {
    transform: translateY(0);
}

.table-selector-section .quantlib-btn.primary {
    background: linear-gradient(135deg, var(--color-accent), #c62828);
}

.table-selector-section .quantlib-btn.secondary {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.table-selector-section .quantlib-btn.secondary:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.08));
    border-color: rgba(255, 255, 255, 0.3);
}

.table-selector-section .toolbar-group {
    position: relative;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    display: flex;
}

.table-selector-section .toolbar-group>div {
    position: relative;
}