/**
 * Greeks Display Stylesheet
 * Styles for Greeks toggle button and Greeks columns in options chain
 */

/* ============================================================================
   GREEKS TOGGLE BUTTON
   ============================================================================ */
.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.slider-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.greeks-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.greeks-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.greeks-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    outline: none;
}

.greeks-toggle:hover {
    background: #eeeeee;
    border-color: #d0d0d0;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.greeks-toggle.active {
    background: #e3f2fd;
    border-color: #1976d2;
    color: #1976d2;
}

.greeks-toggle.active:hover {
    background: #bbdefb;
    border-color: #1565c0;
}

.greeks-status-indicator {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.greeks-toggle.active .greeks-status-indicator {
    transform: scale(1.1);
}

.greeks-status-text {
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* ============================================================================
   GREEKS TABLE COLUMNS
   ============================================================================ */
.greeks-header {
    background: #fafafa !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    color: #1976d2 !important;
    padding: 10px 8px !important;
    border-left: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.greeks-cell {
    font-size: 12px !important;
    font-weight: 500;
    padding: 10px 8px !important;
    text-align: center;
    background: #fafafa;
    border-left: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
    cursor: help;
    /* Removed transition to prevent blinking on updates */
}

.greeks-cell:hover {
    background: #f0f0f0;
    font-weight: 600;
    /* Removed transform to prevent jitter */
}

/* ATM row Greeks cells - more prominent */
tr.atm .greeks-cell {
    background: #fff8e1;
    font-weight: 600;
    border-color: #ffe0b2;
}

tr.atm .greeks-cell:hover {
    background: #ffecb3;
}

/* Specific Greeks styling */
.greeks-iv {
    /* Color set dynamically in JS based on IV level */
    font-weight: 600;
}

.greeks-delta {
    color: #2e7d32; /* Green for CE delta, will be overridden for PE */
}

.greeks-gamma {
    color: #f57c00; /* Orange for gamma */
}

.greeks-theta {
    color: #c62828; /* Red for time decay */
}

.greeks-vega {
    color: #7b1fa2; /* Purple for vega */
}

/* Unavailable Greeks (deep OTM or no data) */
.greeks-unavailable {
    color: #999 !important;
    font-style: italic;
    background: #fafafa !important;
    cursor: help;
}

.greeks-unavailable:hover {
    background: #f5f5f5 !important;
    color: #777 !important;
}

tr.atm .greeks-unavailable {
    background: #fff8e1 !important;
}

tr.atm .greeks-unavailable:hover {
    background: #ffecb3 !important;
}

/* ============================================================================
   GREEKS COLUMNS ANIMATION
   ============================================================================ */
/* Animation removed to prevent blinking on WebSocket updates */
/* Columns appear instantly without fade effect */

/* ============================================================================
   GREEKS TOOLTIP ENHANCEMENT
   ============================================================================ */
.greeks-cell[title] {
    position: relative;
}

.greeks-cell[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #1a1a1a;
    color: white;
    font-size: 11px;
    white-space: pre-line;
    border-radius: 6px;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    pointer-events: none;
    margin-bottom: 8px;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */
@media (max-width: 1200px) {
    .greeks-toggle-wrapper {
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
    }
    
    .greeks-label {
        font-size: 10px;
    }
    
    .greeks-toggle {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .greeks-cell {
        font-size: 11px !important;
        padding: 8px 6px !important;
    }
    
    .greeks-header {
        font-size: 9px !important;
        padding: 8px 6px !important;
    }
}

@media (max-width: 768px) {
    /* On mobile, stack toggle button below slider */
    .slider-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .greeks-toggle-wrapper {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
    }
    
    /* Make Greeks columns scrollable horizontally if needed */
    .chain-container {
        overflow-x: auto;
    }
}

/* ============================================================================
   TABLE WIDTH ADJUSTMENT
   ============================================================================ */
/* Ensure table doesn't overflow when Greeks are enabled */
.chain-table {
    table-layout: auto;
    width: 100%;
}

.chain-table th,
.chain-table td {
    white-space: nowrap;
}

/* Slightly reduce column widths when Greeks enabled */
.greeks-enabled .chain-table td:not(.greeks-cell) {
    padding-left: 10px;
    padding-right: 10px;
}

