/* Zenith Data Lab - Weapon Analytics Dashboard Styles */
/* Author: grimothy */

:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #242424;
    --bg-tertiary: #2e2e2e;
    --accent-primary: #d4af37;
    --accent-secondary: #ffd700;
    --text-primary: #ffffff;
    --text-secondary: #a8a8a8;
    --success: #d4af37;
    --warning: #ffaa00;
    --danger: #ff3366;
    --gradient-1: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    --gradient-2: linear-gradient(135deg, #ffd700 0%, #d4af37 100%);
    --card-bg: #242424;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    padding: 30px 0;
    background: var(--gradient-1);
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.logo {
    height: 80px;
    width: auto;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.3));
    transition: all 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.header-text {
    text-align: left;
}

h1 {
    font-size: 3em;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2em;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.author {
    font-size: 0.9em;
    color: var(--text-secondary);
    font-style: italic;
}

.controls {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.upload-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-label {
    display: inline-block;
    padding: 12px 24px;
    background: var(--accent-primary);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.file-label:hover {
    background: #ff5577;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.4);
}

.file-label input {
    display: none;
}


.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 1em;
}

.btn-primary {
    background: var(--accent-secondary);
    color: var(--bg-primary);
}

.btn-primary:hover {
    background: #00bbdd;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 217, 255, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: #1a4d7d;
}

.filter-section {
    display: flex;
    gap: 15px;
}

select {
    padding: 10px 15px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
}

select:hover {
    border-color: var(--accent-secondary);
}

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s;
    border: 2px solid transparent;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-secondary);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.stat-card h3 {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 2.5em;
    font-weight: 700;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.visualization-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--bg-secondary);
    padding-bottom: 10px;
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1em;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

.tab-btn.active {
    color: var(--text-primary);
    background: var(--bg-secondary);
    border-bottom: 3px solid var(--accent-secondary);
}

.tab-content {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: 10px;
    min-height: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.heatmap-controls {
    margin-bottom: 20px;
}

.property-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.property-checkboxes label {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-secondary);
    cursor: pointer;
}

.property-checkboxes input[type="checkbox"] {
    cursor: pointer;
}

.heatmap-grid-container {
    background: var(--bg-primary);
    border-radius: 10px;
    padding: 10px;
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

.heatmap-grid {
    display: table;
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px;
}

.heatmap-header {
    display: table-row;
    position: sticky;
    top: 0;
    z-index: 10;
}

.heatmap-header-cell {
    display: table-cell;
    padding: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    text-align: center;
    font-size: 0.9em;
    white-space: nowrap;
    border-radius: 4px;
}

.heatmap-row {
    display: table-row;
    transition: all 0.3s;
    cursor: pointer;
}

.heatmap-row:hover {
    filter: brightness(1.2);
}

.heatmap-row.selected {
    outline: 2px solid var(--accent-secondary);
    background: rgba(0, 217, 255, 0.1);
}

.heatmap-weapon-name {
    display: table-cell;
    padding: 8px 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    position: sticky;
    left: 0;
    z-index: 5;
    min-width: 150px;
}

.heatmap-cell {
    display: table-cell;
    padding: 8px;
    text-align: center;
    color: var(--bg-primary);
    font-weight: 600;
    font-size: 0.85em;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
}

.heatmap-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    z-index: 20;
}

.remove-weapon-btn {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 8px;
    background: var(--danger);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.3s;
}

.remove-weapon-btn:hover {
    background: #ff5577;
    transform: scale(1.1);
}

.legend {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-gradient {
    width: 200px;
    height: 20px;
    background: linear-gradient(90deg, #00ff00, #ffff00, #ff0000);
    border-radius: 5px;
}

.legend-labels {
    display: flex;
    justify-content: space-between;
    width: 200px;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.balance-section {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: 10px;
}

.balance-section h3 {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.weapon-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.weapon-card {
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border-left: 4px solid;
    transition: all 0.3s;
}

.weapon-card:hover {
    transform: translateX(5px);
}

.weapon-card.op {
    border-color: var(--danger);
}

.weapon-card.balanced {
    border-color: var(--warning);
}

.weapon-card.up {
    border-color: var(--accent-secondary);
}

.weapon-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.weapon-stats {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.outliers-section {
    background: var(--bg-primary);
    padding: 20px;
    border-radius: 10px;
    margin-top: 30px;
}

.outlier-item {
    padding: 10px;
    margin-bottom: 10px;
    background: rgba(255, 170, 0, 0.1);
    border-left: 4px solid var(--warning);
    border-radius: 5px;
}

.table-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 15px;
}

#tableSearch {
    flex: 1;
    max-width: 300px;
    padding: 10px 15px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    font-size: 1em;
}

.table-container {
    overflow-x: auto;
    background: var(--bg-primary);
    border-radius: 10px;
    padding: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 12px;
    text-align: left;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

th:hover {
    background: #1a4d7d;
}

th[data-sort]:after {
    content: ' ↕';
    opacity: 0.5;
}

th.sort-asc:after {
    content: ' ↑';
    opacity: 1;
}

th.sort-desc:after {
    content: ' ↓';
    opacity: 1;
}

td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--text-secondary);
}

tr:hover td {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
}

.tooltip {
    position: absolute;
    background: var(--bg-primary);
    border: 1px solid var(--accent-secondary);
    padding: 10px;
    border-radius: 8px;
    pointer-events: none;
    z-index: 1000;
    display: none;
    max-width: 300px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.tooltip.active {
    display: block;
}

.tooltip h4 {
    color: var(--accent-secondary);
    margin-bottom: 8px;
}

.tooltip p {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin: 4px 0;
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    max-height: 500px;
    overflow: hidden;
}

canvas {
    max-width: 100%;
    max-height: 100%;
}

.scatter-outliers {
    margin-top: 20px;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: 10px;
}

.scatter-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.scatter-stat-card {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.scatter-stat-card:hover {
    border-color: var(--accent-secondary);
}

.scatter-stat-card h4 {
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-bottom: 5px;
}

.scatter-stat-card .value {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--accent-secondary);
}

.outliers-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
}

.outlier-weapon {
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid var(--warning);
    transition: all 0.3s;
}

.outlier-weapon:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.outlier-weapon .weapon-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.outlier-weapon .outlier-reason {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.focus-indicator {
    background: rgba(0, 217, 255, 0.1);
    color: var(--accent-secondary);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
    border: 1px solid var(--accent-secondary);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: var(--accent-secondary);
}

.modal-content label {
    display: block;
    margin: 15px 0;
    color: var(--text-primary);
}

.modal-content input[type="number"] {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--accent-secondary);
    padding: 5px 10px;
    border-radius: 4px;
    margin-left: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header-logo {
        flex-direction: column;
        gap: 15px;
    }
    
    .header-text {
        text-align: center;
    }
    
    .logo {
        height: 60px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .upload-section {
        flex-direction: column;
        width: 100%;
    }
    
    .filter-section {
        width: 100%;
        flex-direction: column;
    }
    
    .visualization-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .tab-btn {
        white-space: nowrap;
    }
}