/* Professional Volatility Tags CSS - New 6-Level System
 * STABLE → MODERATE → ACTIVE → VOLATILE → HIGHLY VOLATILE → EXTREMELY VOLATILE
 * Based on 7-day rolling volatility (annualized percentage)
 * Clear meaning: Expected annual price movement range
 */

/* Base volatility tag styling - completely static elements */
.volatility-tag {
    display: block;
    padding: 6px 8px !important;
    margin: 0 auto;
    border-radius: 8px;
    font-weight: 400;
    font-size: 9px;
    text-align: center;
    width: 72%;
    max-width: 85px;
    text-transform: uppercase;
    letter-spacing: 0.1px;
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    line-height: 1.2;
    border: 1px solid transparent;
    cursor: default;
    user-select: none;
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    position: relative;
    white-space: nowrap;
    pointer-events: none !important; /* Ensure no interaction events */
}

/* Apply opacity to background only using pseudo-element */
.volatility-tag::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 8px;
    opacity: 0.4;
    z-index: -1;
}

/* STABLE (0-20%) - Deep Blue - Expected annual price swings ±0-20% */
.volatility-stable::after {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    border: 1px solid #3B82F6;
}

/* MODERATE (20-30%) - Blue - Expected annual price swings ±20-30% */
.volatility-moderate::after {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    border: 1px solid #60A5FA;
}

/* ACTIVE (30-40%) - Teal - Expected annual price swings ±30-40% */
.volatility-active::after {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    border: 1px solid #06b6d4;
}

/* VOLATILE (40-50%) - Orange - Expected annual price swings ±40-50% */
.volatility-volatile::after {
    background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
    border: 1px solid #fb923c;
}

/* HIGHLY VOLATILE (50-65%) - Red - Expected annual price swings ±50-65% */
.volatility-highly-volatile::after {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border: 1px solid #f87171;
}

/* EXTREMELY VOLATILE (65%+) - Dark Red - Expected annual price swings ±65%+ */
.volatility-extremely-volatile::after {
    background: linear-gradient(135deg, #991b1b 0%, #7f1d1d 100%);
    border: 1px solid #ef4444;
    animation: volatility-pulse 2s ease-in-out infinite;
}

.volatility-extremely-volatile::before {
    content: '⚠️';
    margin-right: 3px;
    font-size: 0.7em;
}

@keyframes volatility-pulse {
    0%, 100% { 
        opacity: 0.4;
    }
    50% { 
        opacity: 0.7;
    }
}

/* Container for volatility column */
.volatility-cell {
    text-align: center !important;
    padding: 12px 8px !important;
    vertical-align: middle !important;
}

/* Tooltip for volatility explanation - disabled to ensure static behavior */
.volatility-tooltip {
    display: none !important; /* Completely hide tooltips to ensure no interference */
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 5px;
    opacity: 0;
    pointer-events: none;
    transition: none; /* Remove transition to ensure static behavior */
}

/* Removed hover effect for tooltip - volatility tags now behave as static elements */
/* .volatility-tag:hover + .volatility-tooltip {
    opacity: 1;
} */

/* Comprehensive rule to ensure ALL volatility elements are completely static */
.volatility-tag,
.volatility-tag *,
.volatility-tag::before,
.volatility-tag::after,
.volatility-stable,
.volatility-moderate,
.volatility-active,
.volatility-volatile,
.volatility-highly-volatile,
.volatility-extremely-volatile {
    pointer-events: none !important;
    cursor: default !important;
    transition: none !important;
    transform: none !important;
}

/* COMPLETELY DISABLE ALL HOVER EFFECTS - Make volatility tags truly static */
.volatility-tag:hover,
.volatility-tag:hover *,
.volatility-tag:hover::before,
.volatility-tag:hover::after,
.volatility-stable:hover,
.volatility-moderate:hover,
.volatility-active:hover,
.volatility-volatile:hover,
.volatility-highly-volatile:hover,
.volatility-extremely-volatile:hover {
    background: inherit !important;
    box-shadow: inherit !important;
    opacity: inherit !important;
    transform: none !important;
    color: inherit !important;
    border: inherit !important;
}

/* Prevent volatility cells from triggering parent row hover effects */
.volatility-cell:hover {
    pointer-events: none !important;
}

/* Completely disable volatility cell interactions */
.volatility-cell {
    pointer-events: none !important;
    user-select: none !important;
    cursor: default !important;
}

.volatility-cell * {
    pointer-events: none !important;
    user-select: none !important;
    cursor: default !important;
}

/* Fallback for browsers that don't support :has() - force override table hover */
.volatility-cell:hover,
.volatility-tag:hover {
    background: transparent !important;
    color: inherit !important;
}

/* Additional fallback to prevent any background color changes */
tr .volatility-cell:hover,
tbody tr:hover .volatility-cell,
tbody tr:hover .volatility-tag {
    background-color: transparent !important;
    background: transparent !important;
}

/* Override any table row hover effects when hovering over volatility elements */
tr:has(.volatility-tag:hover),
tr:has(.volatility-cell:hover),
tr:has(.volatility-stable:hover),
tr:has(.volatility-moderate:hover),
tr:has(.volatility-active:hover),
tr:has(.volatility-volatile:hover),
tr:has(.volatility-highly-volatile:hover),
tr:has(.volatility-extremely-volatile:hover) {
    background-color: transparent !important;
}

tr:has(.volatility-tag:hover) .crypto-icon,
tr:has(.volatility-cell:hover) .crypto-icon {
    transform: none !important;
    box-shadow: none !important;
}

tr:has(.volatility-tag:hover) .coin-name,
tr:has(.volatility-cell:hover) .coin-name {
    color: inherit !important;
    transform: none !important;
    filter: none !important;
    z-index: auto !important;
    position: relative !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .volatility-tag {
        font-size: 8px;
        padding: 3px 6px;
        border-radius: 4px;
    }
}

@media (max-width: 480px) {
    .volatility-tag {
        font-size: 7px;
        padding: 2px 5px;
        border-radius: 3px;
        letter-spacing: 0.1px;
    }
}

/* Loading state */
.volatility-tag.loading {
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    color: transparent;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Error state */
.volatility-tag.error {
    background: linear-gradient(135deg, #6b7280 0%, #9ca3af 100%);
    color: #f9fafb;
    border-color: #4b5563;
}