/* hate-speech-viz.css */
.hate-speech-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.hate-speech-overlay.active {
    opacity: 1;
    visibility: visible;
}

.hate-speech-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 95%;
    height: 90vh;
    background: #0a0a12;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.hate-speech-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: rgba(20, 20, 30, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-icon {
    font-size: 2rem;
    color: #FF6B6B;
}

.header-text h2 {
    margin: 0;
    font-size: 1.8rem;
    color: white;
    font-weight: 700;
}

.header-subtitle {
    margin: 5px 0 0 0;
    color: #8a8f9c;
    font-size: 0.9rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-stats {
    display: flex;
    gap: 15px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.stat-label {
    font-size: 0.8rem;
    color: #8a8f9c;
}

.stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: white;
    font-family: 'JetBrains Mono', monospace;
}

.close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 107, 107, 0.2);
    border-color: #FF6B6B;
    transform: rotate(90deg);
}

/* Modal Body */
.modal-body {
    flex: 1;
    padding: 0;
    position: relative;
}

.viz-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
}

#hate-speech-3d-canvas {
    flex: 1;
    width: 100%;
    height: 100%;
}

/* Control Panel */
.control-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 300px;
    background: rgba(20, 20, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 10;
    max-height: calc(100% - 40px);
    overflow-y: auto;
}

.control-section {
    margin-bottom: 25px;
}

.control-section:last-child {
    margin-bottom: 0;
}

.control-section h4 {
    margin: 0 0 15px 0;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #8a8f9c;
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.control-btn.active {
    background: rgba(78, 205, 196, 0.2);
    border-color: #4ECDC4;
    color: white;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #8a8f9c;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.filter-btn.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.toggle-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toggle-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #8a8f9c;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.toggle-btn.active {
    background: rgba(69, 183, 209, 0.2);
    border-color: #45B7D1;
    color: white;
}

.slider-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.slider-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.slider-container label {
    font-size: 0.8rem;
    color: #8a8f9c;
}

.slider-container input[type="range"] {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #4ECDC4;
    border-radius: 50%;
    cursor: pointer;
}

.slider-container span {
    font-size: 0.8rem;
    color: white;
    font-family: 'JetBrains Mono', monospace;
    margin-top: 5px;
}

.legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #8a8f9c;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}

/* Detail Panel */
.detail-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 400px;
    max-height: 300px;
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 10;
    overflow-y: auto;
}

.detail-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #8a8f9c;
    gap: 15px;
}

.detail-placeholder i {
    font-size: 2rem;
    opacity: 0.5;
}

.detail-placeholder p {
    margin: 0;
    text-align: center;
}

/* Detail View Content */
.detail-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-header h3 {
    margin: 0 0 15px 0;
    color: white;
    font-size: 1.2rem;
}

.detail-class-badges {
    display: flex;
    gap: 10px;
}

.class-badge {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.class-badge.true {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.class-badge.predicted {
    background: rgba(255, 255, 255, 0.05);
    color: #8a8f9c;
}

.class-badge.hate-speech {
    border-left: 3px solid #FF6B6B;
}

.class-badge.offensive {
    border-left: 3px solid #4ECDC4;
}

.class-badge.neither {
    border-left: 3px solid #45B7D1;
}

.detail-text {
    margin-bottom: 20px;
}

.detail-text p {
    margin: 0;
    color: #8a8f9c;
    font-size: 0.9rem;
    line-height: 1.5;
}

.detail-metrics {
    margin-bottom: 20px;
}

.metric-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.metric-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
}

.metric-title {
    font-size: 0.8rem;
    color: #8a8f9c;
    margin-bottom: 5px;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 10px;
}

.metric-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    background: #4ECDC4;
    border-radius: 2px;
}

.metric-fill.entropy {
    background: #FF6B6B;
}

.distance-metrics {
    margin-top: 20px;
}

.distance-metrics h4 {
    margin: 0 0 10px 0;
    color: white;
    font-size: 0.9rem;
}

.distance-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.distance-row:last-child {
    border-bottom: none;
}

.distance-label {
    font-size: 0.85rem;
    color: #8a8f9c;
}

.distance-label.hate-speech {
    color: #FF6B6B;
}

.distance-label.offensive {
    color: #4ECDC4;
}

.distance-label.neither {
    color: #45B7D1;
}

.distance-value {
    font-size: 0.85rem;
    color: white;
    font-family: 'JetBrains Mono', monospace;
}

.detail-embeddings h4 {
    margin: 0 0 15px 0;
    color: white;
    font-size: 0.9rem;
}

.embedding-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.embedding-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.embedding-label {
    width: 50px;
    font-size: 0.8rem;
    color: #8a8f9c;
}

.embedding-bar-container {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.embedding-fill {
    height: 100%;
    border-radius: 3px;
}

.embedding-value {
    width: 60px;
    text-align: right;
    font-size: 0.8rem;
    color: white;
    font-family: 'JetBrains Mono', monospace;
}

/* Modal Footer */
.modal-footer {
    padding: 15px 30px;
    background: rgba(20, 20, 30, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-hotkeys {
    display: flex;
    gap: 20px;
}

.hotkey {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: #8a8f9c;
}

.hotkey kbd {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
}

.footer-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-text {
    font-size: 0.8rem;
    color: #8a8f9c;
}

.info-text i {
    color: #4ECDC4;
    margin-right: 5px;
}

/* Tooltip */
.hate-speech-tooltip {
    position: fixed;
    background: rgba(20, 20, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    color: white;
    font-family: 'Inter', sans-serif;
    max-width: 300px;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    display: none;
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip-class {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.tooltip-class.hate-speech {
    background: rgba(255, 107, 107, 0.2);
    color: #FF6B6B;
}

.tooltip-class.offensive {
    background: rgba(78, 205, 196, 0.2);
    color: #4ECDC4;
}

.tooltip-class.neither {
    background: rgba(69, 183, 209, 0.2);
    color: #45B7D1;
}

.tooltip-status {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 6px;
}

.tooltip-status.correct {
    background: rgba(150, 206, 180, 0.2);
    color: #96CEB4;
}

.tooltip-status.incorrect {
    background: rgba(255, 209, 102, 0.2);
    color: #FFD166;
}

.tooltip-text {
    font-size: 0.85rem;
    color: #8a8f9c;
    line-height: 1.4;
    margin-bottom: 15px;
}

.tooltip-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.metric {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.75rem;
    color: #8a8f9c;
    margin-bottom: 2px;
}

.metric-value {
    font-size: 0.85rem;
    color: white;
    font-family: 'JetBrains Mono', monospace;
}

.metric-value.hate-speech {
    color: #FF6B6B;
}

.metric-value.offensive {
    color: #4ECDC4;
}

.metric-value.neither {
    color: #45B7D1;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .hate-speech-modal {
        width: 98%;
        height: 95vh;
    }
    
    .control-panel {
        width: 280px;
    }
    
    .detail-panel {
        width: 350px;
    }
}

@media (max-width: 768px) {
    .hate-speech-modal {
        border-radius: 10px;
    }
    
    .modal-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .control-panel {
        position: static;
        width: 100%;
        max-height: 200px;
        border-radius: 0;
        border: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .detail-panel {
        position: static;
        width: 100%;
        max-height: 250px;
        border-radius: 0;
        border: none;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .viz-container {
        flex-direction: column;
    }
    
    #hate-speech-3d-canvas {
        height: 50vh;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .footer-hotkeys {
        flex-wrap: wrap;
        justify-content: center;
    }
}