:root {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent-color: #bb86fc;
    --success-color: #03dac6;
    --error-color: #cf6679;
    --border-radius: 12px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid #333;
    margin-bottom: 30px;
}

h1,
h2,
h3 {
    margin: 0;
    font-weight: 600;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: opacity 0.2s;
}

a:hover {
    opacity: 0.8;
}

.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--accent-color);
    color: #000;
    border-radius: var(--border-radius);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-secondary {
    background-color: #333;
    color: var(--text-primary);
}

.btn-danger {
    background-color: var(--error-color);
    color: #000;
}

.btn-success {
    background-color: var(--success-color);
    color: #000;
}

input,
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    background-color: #2c2c2c;
    border: 1px solid #333;
    border-radius: var(--border-radius);
    color: var(--text-primary);
    box-sizing: border-box;
}

input:focus,
select:focus {
    outline: 2px solid var(--accent-color);
    border-color: transparent;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #333;
}

th {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    background: var(--card-bg);
    border: 1px solid #333;
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: var(--accent-color);
    color: black;
    border-color: var(--accent-color);
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

.flash-messages {
    margin-bottom: 20px;
}

.flash {
    padding: 10px;
    background-color: rgba(187, 134, 252, 0.1);
    border: 1px solid var(--accent-color);
    border-radius: var(--border-radius);
    color: var(--accent-color);
}

.rank-1 {
    color: #ffd700;
}

.rank-2 {
    color: #c0c0c0;
}

.rank-3 {
    color: #cd7f32;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Heatmap Styles */
.heatmap-container {
    overflow-x: auto;
    padding-bottom: 10px;
    display: flex;
    gap: 5px;
}

.heatmap-labels {
    display: grid;
    grid-template-rows: repeat(7, 16px);
    /* 7 days a week */
    gap: 3px;
    margin-right: 5px;
    font-size: 10px;
    line-height: 16px;
    color: var(--text-secondary);
    text-align: right;
    padding-top: 20px;
    /* Align with cells (16px month height + 4px margin) */
}

.heatmap-grid {
    display: grid;
    grid-template-rows: repeat(7, 16px);
    /* 7 days a week */
    grid-auto-flow: column;
    /* Fill columns first (weeks) */
    /* Fill columns first (weeks) */
    gap: 3px;
}

.heatmap-grid-wrapper {
    display: flex;
    flex-direction: column;
}

.heatmap-months {
    height: 16px;
    margin-bottom: 4px;
    position: relative;
    /* Width will be set by JS or naturally expand */
}

.heatmap-month-label {
    position: absolute;
    font-size: 10px;
    color: var(--text-secondary);
    top: 0;
}

.heatmap-cell {
    width: 16px;
    height: 16px;
    background-color: #2d333b;
    /* Default empty color */
    border-radius: 2px;
    cursor: pointer;
}

.heatmap-cell:hover {
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Win Colors (Green) */
.heatmap-cell[data-level="1"] {
    background-color: #0e4429;
}

.heatmap-cell[data-level="2"] {
    background-color: #006d32;
}

.heatmap-cell[data-level="3"] {
    background-color: #26a641;
}

.heatmap-cell[data-level="4"] {
    background-color: #39d353;
}

/* Loss Colors (Red) */
.heatmap-cell[data-level="-1"] {
    background-color: #490c10;
}

.heatmap-cell[data-level="-2"] {
    background-color: #7d1a1f;
}

.heatmap-cell[data-level="-3"] {
    background-color: #b8252a;
}

.heatmap-cell[data-level="-4"] {
    background-color: #e63238;
}

/* Global Activity Colors (Blue/Purple) */
/* Global Activity Colors (Blue/Purple) */
.heatmap-cell[data-level="10"] {
    background-color: #1f6feb;
    opacity: 0.2;
}

.heatmap-cell[data-level="20"] {
    background-color: #1f6feb;
    opacity: 0.4;
}

.heatmap-cell[data-level="30"] {
    background-color: #1f6feb;
    opacity: 0.7;
}

.heatmap-cell[data-level="40"] {
    background-color: #1f6feb;
    opacity: 1.0;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background-color: var(--card-bg);
    margin: 3% auto;
    padding: 20px;
    border: 1px solid #333;
    width: 90%;
    max-width: 500px;
    border-radius: var(--border-radius);
    position: relative;
    animation: fadeIn 0.3s;
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: var(--text-primary);
}