/* ============================================================================
   EEG Widgets Styles
   ============================================================================ */

/* Live EEG Chart Widget */
.live-eeg-chart-widget {
    width: 100%;
    height: 100%;
}

.live-eeg-chart-widget .widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.live-eeg-chart-widget .widget-content {
    position: relative;
    background: #000000;
    border-radius: 0.375rem;
    overflow: hidden;
}

.live-eeg-chart-widget #eeg-chart-canvas {
    width: 100%;
    display: block;
    background: #000000;
}

.live-eeg-chart-widget .channel-labels {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    height: 100%;
    padding: 0.5rem;
    pointer-events: none;
}

.live-eeg-chart-widget .channel-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.5);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    height: 60px;
    display: flex;
    align-items: center;
}

/* Personal Brainwave Widget */
.personal-brainwave-widget .widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.eeg-connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--bs-secondary);
}

.status-dot.connected {
    background-color: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.status-dot.disconnected {
    background-color: #ef4444;
}

.status-dot.error {
    background-color: #f97316;
}

/* Band Powers */
.band-powers {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.band-power-item {
    display: grid;
    grid-template-columns: 60px 1fr 50px;
    gap: 0.75rem;
    align-items: center;
}

.band-label {
    font-size: 0.875rem;
    font-weight: 600;
}

.band-bar-container {
    height: 20px;
    background: rgba(var(--bs-secondary-rgb), 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.band-bar {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

.band-delta { background: linear-gradient(90deg, #6366f1, #8b5cf6); }
.band-theta { background: linear-gradient(90deg, #3b82f6, #06b6d4); }
.band-alpha { background: linear-gradient(90deg, #10b981, #22c55e); }
.band-beta  { background: linear-gradient(90deg, #f59e0b, #f97316); }
.band-gamma { background: linear-gradient(90deg, #ef4444, #dc2626); }

.band-value {
    text-align: right;
    font-size: 0.875rem;
    font-family: monospace;
    font-weight: 600;
}

/* Vertical Band Powers */
.band-powers-vertical {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    gap: 1rem;
    height: 150px;
    padding: 0.5rem;
}

.band-power-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.band-bar-vertical-container {
    width: 100%;
    height: 100px;
    background: rgba(var(--bs-secondary-rgb), 0.1);
    border-radius: 0.375rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.band-bar-vertical {
    width: 100%;
    transition: height 0.3s ease;
    border-radius: 0.375rem 0.375rem 0 0;
}

.band-power-column .band-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.band-power-column .band-value {
    text-align: center;
    font-size: 0.75rem;
    font-family: monospace;
    font-weight: 600;
}

/* Mental Metrics */
.mental-metrics {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: rgba(var(--bs-secondary-rgb), 0.05);
    border-radius: 0.375rem;
}

.metric-icon {
    font-size: 1.25rem;
}

.metric-label {
    flex: 1;
    margin-left: 0.75rem;
    font-size: 0.875rem;
}

.metric-value {
    font-family: monospace;
    font-weight: 600;
    font-size: 0.875rem;
}

.sharing-control {
    padding-top: 1rem;
    border-top: 1px solid var(--bs-border-color);
}

/* Peer EEG Badges */
.peer-eeg-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.85);
    border-radius: 0.375rem;
    padding: 0.375rem 0.5rem;
    z-index: 15;
    cursor: pointer;
    transition: all 0.2s ease;
}

.peer-eeg-badge:hover {
    background: rgba(0, 0, 0, 0.95);
    transform: scale(1.05);
}

.badge-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dominant-band {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
}

.calm-emoji {
    font-size: 1.25rem;
}

.badge-detail {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-family: monospace;
    font-weight: 600;
}

/* Group Brain Widget */
.group-brain-widget .widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.participant-count {
    font-size: 0.75rem;
}

.group-averages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.avg-metric {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(var(--bs-secondary-rgb), 0.05);
    border-radius: 0.5rem;
}

.avg-icon {
    font-size: 1.5rem;
}

.avg-details {
    flex: 1;
}

.avg-label {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
    margin-bottom: 0.25rem;
}

.avg-value {
    font-size: 1.125rem;
    font-family: monospace;
    font-weight: 700;
}

/* Heatmap */
.participant-heatmap {
    margin-top: 1.5rem;
}

.heatmap-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.heatmap-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: white;
    transition: transform 0.2s ease;
}

.heatmap-cell:hover {
    transform: scale(1.1);
    cursor: pointer;
}

.heatmap-cell.local-user {
    border: 2px solid white;
}

.calm-low { background: linear-gradient(135deg, #ef4444, #dc2626); }
.calm-medium { background: linear-gradient(135deg, #f59e0b, #f97316); }
.calm-high { background: linear-gradient(135deg, #10b981, #22c55e); }

.heatmap-legend {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
}

/* Live Mental Metrics Widget - Full Width with Charts */

/* Make the widget container take full width in the grid */
#widget-live-mental-metrics {
    grid-column: 1 / -1; /* Full width across all columns */
}

.live-mental-metrics-widget {
    width: 100%;
}

.live-mental-metrics-widget .widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.metric-count {
    font-size: 0.75rem;
}

.metric-category {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.category-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--bs-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metrics-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 1rem;
}

.metric-item {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(var(--bs-secondary-rgb), 0.05);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-item:hover {
    background: rgba(var(--bs-secondary-rgb), 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

.metric-left {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.metric-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.metric-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--bs-body-color);
}

.metric-value-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.metric-gauge {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

.metric-item .metric-value {
    font-family: monospace;
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
}

.metric-item .metric-value.active {
    color: var(--bs-success);
}

.metric-info {
    font-size: 0.7rem;
    color: rgba(var(--bs-secondary-rgb), 0.9);
    line-height: 1.3;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.metric-formula {
    font-family: 'Courier New', monospace;
    color: var(--bs-info);
    font-weight: 600;
}

.metric-interpretation {
    font-style: italic;
    color: rgba(var(--bs-secondary-rgb), 1);
}

.metric-range {
    color: var(--bs-warning);
    font-weight: 500;
}

.metric-chart {
    position: relative;
    height: 120px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.375rem;
    padding: 0.5rem;
}

.metric-chart canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Snapshot Widget */
.snapshot-widget .widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.recording-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recording-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #ef4444;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.recording-time {
    font-family: monospace;
    font-weight: 600;
    font-size: 1rem;
}

.recording-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-record, .btn-stop, .btn-cancel {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon {
    font-size: 1.125rem;
}

.duration-selector label {
    font-size: 0.875rem;
    font-weight: 600;
}

/* Markers */
.markers-section, .snapshots-section {
    margin-top: 1.5rem;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.markers-list, .snapshots-list {
    max-height: 300px;
    overflow-y: auto;
}

.marker-item {
    padding: 0.75rem;
    background: rgba(var(--bs-secondary-rgb), 0.05);
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

.marker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.marker-time {
    font-family: monospace;
    font-size: 0.875rem;
    font-weight: 600;
}

.marker-type {
    font-size: 0.75rem;
}

.marker-text {
    font-size: 0.875rem;
    color: var(--bs-body-color);
}

.snapshot-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(var(--bs-secondary-rgb), 0.05);
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

.snapshot-info {
    flex: 1;
}

.snapshot-name {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.snapshot-meta {
    font-size: 0.75rem;
    color: var(--bs-secondary-color);
}

.snapshot-actions {
    display: flex;
    gap: 0.5rem;
}

/* Snapshot Progress Bar */
.snapshot-progress-bar {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.95);
    padding: 2rem;
    border-radius: 0.5rem;
    z-index: 9999;
    min-width: 300px;
}

.progress-content {
    text-align: center;
}

/* Snapshot Alert */
.snapshot-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 250px;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--bs-secondary-color);
    font-style: italic;
    font-size: 0.875rem;
}

/* ============================================================================
   Snapshot Analysis Modal
   ============================================================================ */

.stat-card {
    background: var(--bs-secondary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--bs-body-color);
}

.analysis-summary h6,
.channel-statistics h6 {
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--bs-secondary-color);
}

/* Analysis Modal Tabs */
#analysisModal .nav-tabs {
    border-bottom: 2px solid var(--bs-border-color);
}

#analysisModal .nav-tabs .nav-link {
    color: var(--bs-body-color);
    border: none;
    border-bottom: 3px solid transparent;
    padding: 0.75rem 1.5rem;
}

#analysisModal .nav-tabs .nav-link:hover {
    border-bottom-color: var(--bs-primary);
}

#analysisModal .nav-tabs .nav-link.active {
    color: var(--bs-primary);
    background: transparent;
    border-bottom-color: var(--bs-primary);
}

#analysisModal .card {
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
}

#analysisModal .card-header {
    background: var(--bs-secondary-bg);
    border-bottom: 1px solid var(--bs-border-color);
}

/* Brain Heatmap Band Selector */
.band-selector .btn-check:checked + .btn {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

/* Fullscreen Modal Adjustments */
.modal-fullscreen .modal-body {
    overflow-y: auto;
    max-height: calc(100vh - 150px);
}

.modal-fullscreen canvas {
    max-width: 100%;
    height: auto !important;
}

/* ============================================================================
   EEG Simulator Widget Styles
   ============================================================================ */

/* Mode Toggle Button */
.simulator-mode-toggle {
    margin-bottom: 15px;
    padding: 8px 20px;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.simulator-mode-toggle.live-mode {
    background-color: #28a745;
    border-color: #28a745;
}

.simulator-mode-toggle.live-mode:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.simulator-mode-toggle.simulator-mode {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #000;
}

.simulator-mode-toggle.simulator-mode:hover {
    background-color: #e0a800;
    border-color: #d39e00;
}

/* Status Indicator */
.simulator-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 14px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #6c757d;
}

.status-dot.live {
    background-color: #28a745;
    animation: pulse-green 2s infinite;
}

.status-dot.simulating {
    background-color: #ffc107;
    animation: pulse-yellow 2s infinite;
}

@keyframes pulse-green {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
}

@keyframes pulse-yellow {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }
    50% {
        opacity: 0.7;
        box-shadow: 0 0 0 10px rgba(255, 193, 7, 0);
    }
}

/* Snapshot Selection */
.simulator-snapshot-select {
    margin-bottom: 15px;
}

.simulator-snapshot-select select {
    background-color: var(--bs-secondary-bg);
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
    border-radius: 6px;
    padding: 8px 12px;
    width: 100%;
}

/* Snapshot Info */
.simulator-snapshot-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 15px;
    font-size: 13px;
}

.simulator-snapshot-info div {
    margin-bottom: 4px;
}

.simulator-snapshot-info div:last-child {
    margin-bottom: 0;
}

/* Playback Controls */
.simulator-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.simulator-controls .btn {
    flex: 1;
    min-width: 60px;
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 6px;
}

/* Progress Bar and Time Display */
.simulator-progress-container {
    margin-bottom: 15px;
}

.simulator-time-display {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #adb5bd;
    margin-bottom: 5px;
}

.simulator-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    margin-bottom: 8px;
}

.simulator-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0d6efd 0%, #0a58ca 100%);
    border-radius: 4px;
    transition: width 0.1s linear;
}

/* Seek Slider */
.simulator-seek-slider {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.simulator-seek-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #0d6efd;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.simulator-seek-slider::-webkit-slider-thumb:hover {
    background: #0a58ca;
    transform: scale(1.2);
}

.simulator-seek-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #0d6efd;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.simulator-seek-slider::-moz-range-thumb:hover {
    background: #0a58ca;
    transform: scale(1.2);
}

/* Speed Control */
.simulator-speed-control {
    margin-bottom: 15px;
}

.simulator-speed-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 5px;
    color: #adb5bd;
}

.simulator-speed-slider {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.simulator-speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: #6c757d;
    border-radius: 50%;
    cursor: pointer;
}

.simulator-speed-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #6c757d;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Loop Toggle */
.simulator-loop-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 14px;
}

.simulator-loop-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Marker Display */
.simulator-marker-display {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 107, 157, 0.95);
    color: #fff;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    animation: marker-fade-in 0.3s ease;
    pointer-events: none;
}

@keyframes marker-fade-in {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.simulator-marker-display.fade-out {
    animation: marker-fade-out 0.5s ease forwards;
}

@keyframes marker-fade-out {
    from {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
}

/* ============================================================================
   Game Widget Base Class Styles
   ============================================================================ */

/* Game Widget Container */
.game-widget {
    padding: 15px;
}

.game-widget h6 {
    margin-bottom: 10px;
    font-weight: 600;
}

/* 3-Panel Layout */
.game-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    height: calc(100vh - 70px);
    gap: 0;
}

.game-panel {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--bs-border-color);
    overflow: hidden;
}

.game-panel:last-child {
    border-right: none;
}

.panel-header {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--bs-border-color);
    font-weight: 600;
    font-size: 16px;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* YouTube Container */
.youtube-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 400px;
}

.youtube-container iframe {
    width: 100%;
    height: 100%;
}

/* Smile Tracker Styles */
.smile-tracker {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.smile-status-icon i {
    font-size: 72px;
    transition: all 0.3s ease;
}

.smile-status-text h3 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    transition: color 0.3s ease;
}

.smile-status-gif img {
    transition: border-color 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Progress Bars */
.scoring-progress {
    width: 100%;
    max-width: 350px;
}

.scoring-progress .progress {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.scoring-progress .progress-bar {
    transition: width 0.2s ease;
}

/* Score Display */
.score-display-header {
    font-size: 18px;
    font-weight: 600;
}

.score-pulse {
    animation: pulse-score 0.5s ease;
}

@keyframes pulse-score {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* Game Widget Badge */
#game-score .badge {
    font-size: 14px;
    padding: 6px 12px;
}

/* Multiplayer Leaderboard */
.leaderboard-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.leaderboard-list {
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-item {
    transition: all 0.2s ease;
}

.leaderboard-item:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.rank-badge {
    font-size: 1.2rem;
    font-weight: bold;
    min-width: 30px;
    display: inline-block;
}

.score-badge {
    font-size: 1rem;
    padding: 0.25rem 0.5rem;
}

/* Highlight local player */
.leaderboard-item.border-primary {
    border-width: 2px !important;
}

.score-display-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .game-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .game-panel {
        border-right: none;
        border-bottom: 1px solid var(--bs-border-color);
    }

    .game-panel:last-child {
        border-bottom: none;
    }
}

/* ============================================================================
   Band Power Charts Widget
   ============================================================================ */

.band-power-charts-widget .widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.band-chart-container {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 1rem;
}

.band-chart-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #9aa8b2;
}

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

.band-chart-container canvas {
    height: 150px !important;
}

/* Moving Average Slider (for snapshot analysis) */
#ma-slider {
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    border-radius: 8px;
    height: 6px;
}

#ma-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #00bfbf;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid #021018;
}

#ma-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #00bfbf;
    cursor: pointer;
    border-radius: 50%;
    border: 2px solid #021018;
}

#ma-slider:hover::-webkit-slider-thumb {
    background: #00d4d4;
}

#ma-slider:hover::-moz-range-thumb {
    background: #00d4d4;
}
/* ============================================================================
   Brain Grid Widget - Multi-Band Topographic Maps
   ============================================================================ */

.brain-grid-widget {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 1rem;
}

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

.brain-grid-header h5 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #9aa8b2;
}

.brain-grid-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.brain-grid-controls .btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
}

.brain-grid-container {
    width: 100%;
}

.brain-grid-cell {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.2s ease;
}

.brain-grid-cell:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.brain-grid-cell h6 {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #9aa8b2;
    text-align: center;
}

.brain-grid-cell canvas {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

.brain-grid-footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.brain-grid-footer small {
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Responsive grid adjustments */
@media (max-width: 1400px) {
    .brain-grid-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .brain-grid-container {
        grid-template-columns: 1fr !important;
    }
    
    .brain-grid-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .brain-grid-controls .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================================================
   Brain Grid Comparison Widget - Difference Visualization
   ============================================================================ */

.brain-grid-comparison .comparison-legend {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.brain-grid-comparison .legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brain-grid-comparison .legend-color-box {
    width: 40px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.brain-grid-comparison .legend-label {
    font-size: 0.875rem;
    color: #9aa8b2;
    font-weight: 500;
}

.brain-grid-comparison .diff-summary {
    min-height: 24px;
    padding: 0.25rem;
}

.brain-grid-comparison .diff-summary small {
    font-size: 0.75rem;
}

/* Override grid cell hover for comparison to maintain visibility */
.brain-grid-comparison .brain-grid-cell:hover {
    background: rgba(255, 255, 255, 0.07);
}

.brain-grid-comparison .overall-change-badge {
    padding: 0.5rem;
}

.brain-grid-comparison .overall-change-badge .badge {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    font-weight: 600;
}
