/* Dashboard Styles */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a1a;
    color: #e0e0e0;
    padding: 0;
    margin: 0;
}

/* Top Navigation */
.top-nav {
    background: #0d0d0d;
    padding: 0;
    display: flex;
    border-bottom: 2px solid #333;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-link {
    padding: 16px 32px;
    color: #888;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.nav-link:hover {
    color: #fff;
    background: #1a1a1a;
}

.nav-link.active {
    color: #4caf50;
    border-bottom-color: #4caf50;
    background: #1a1a1a;
}

/* Content wrapper */
.header,
.error {
    margin: 20px;
}

/* Table container for horizontal scrolling - only scroll when needed */
.table-container {
    overflow-x: auto;
    margin: 20px;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    width: calc(100vw - 40px);
    max-width: calc(100% - 40px);
}

.table-container table {
    margin: 0;
    width: 100%;
    table-layout: auto;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

/* Period selector */
/* Selectors container */
.selectors {
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}

.period-selector,
.fund-selector {
    margin: 0;
    display: flex;
    justify-content: center;
}

/* Controls container for multiple selectors */
.controls-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
}

/* Team selector */
.team-selector {
    margin: 0;
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
}

.team-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    padding: 0 20px;
}

.team-option {
    padding: 6px 14px;
    background: #2a2a2a;
    color: #e0e0e0;
    border: 2px solid #444;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    white-space: nowrap;
}

.team-option:hover {
    background: #333;
    border-color: #555;
    color: #fff;
}

.team-option.active {
    background: #4caf50;
    border-color: #4caf50;
    color: #fff;
    font-weight: 600;
}

.period-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.period-option {
    padding: 8px 16px;
    background: #2a2a2a;
    color: #e0e0e0;
    border: 2px solid #444;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.period-option:hover {
    background: #333;
    border-color: #555;
    color: #fff;
}

.period-option.active {
    background: #4caf50;
    border-color: #4caf50;
    color: #fff;
    font-weight: 600;
}

.header h1 {
    margin: 10px 0;
    color: #ffffff;
}

.header .info {
    color: #888;
    font-size: 14px;
}

.btc-price {
    color: #f7931a;
    font-weight: bold;
}

.status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 10px;
}

.status.loading {
    background: #444;
    color: #aaa;
}

.status.live {
    background: #1a4d1a;
    color: #4caf50;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #2a2a2a;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    margin-bottom: 20px;
}

th {
    background: #333;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #444;
    position: sticky;
    top: 0;
    font-size: 12px;
    z-index: 10;
}

td {
    padding: 10px 8px;
    border-bottom: 1px solid #333;
    font-size: 13px;
}

tr:hover {
    background: #333;
}

.positive {
    color: #4caf50;
}

.negative {
    color: #f44336;
}

.neutral {
    color: #888;
}

.total-row {
    background: #1a3a1a;
    font-weight: bold;
    border-top: 3px solid #4caf50;
}

.total-row:hover {
    background: #1a3a1a !important;
}

.right {
    text-align: right;
}

.error {
    background: #4d1a1a;
    color: #f44336;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
}

/* Responsive design */
@media (max-width: 1200px) {
    body {
        padding: 10px;
    }
    
    table {
        font-size: 11px;
    }
    
    th, td {
        padding: 8px 4px;
    }
}

/* Loading animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.status.loading {
    animation: pulse 2s ease-in-out infinite;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #1a1a1a;
    padding: 20px;
}

.login-form {
    background: #2a2a2a;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-form h1 {
    color: #ffffff;
    margin: 0 0 10px 0;
    font-size: 24px;
}

.login-form h2 {
    color: #888;
    margin: 0 0 30px 0;
    font-size: 16px;
    font-weight: normal;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    color: #e0e0e0;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #444;
    border-radius: 4px;
    background: #1a1a1a;
    color: #e0e0e0;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #4caf50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

.btn-primary {
    background: #4caf50;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #45a049;
}

.login-error {
    background: #4d1a1a;
    color: #f44336;
    padding: 12px;
    border-radius: 4px;
    margin-top: 20px;
    font-size: 14px;
}

/* Exposures pills */
.pill {
    display: inline-block;
    padding: 2px 6px;
    margin: 2px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
}
.pill-long {
    background: #1a3a1a;
    border: 1px solid #2e7d32;
    color: #66bb6a;
}
.pill-short {
    background: #3a1a1a;
    border: 1px solid #c62828;
    color: #ef5350;
}

/* Subtype pills - different colors (not green or red) */
.pill-purple {
    background: #2a1a3a;
    border: 1px solid #7b1fa2;
    color: #ba68c8;
}
.pill-yellow {
    background: #3a3a1a;
    border: 1px solid #f57f17;
    color: #ffd54f;
}
.pill-blue {
    background: #1a1a3a;
    border: 1px solid #1976d2;
    color: #64b5f6;
}
.pill-orange {
    background: #3a2a1a;
    border: 1px solid #e65100;
    color: #ffb74d;
}
.pill-cyan {
    background: #1a3a3a;
    border: 1px solid #00838f;
    color: #4dd0e1;
}
.pill-pink {
    background: #3a1a2a;
    border: 1px solid #c2185b;
    color: #f48fb1;
}
.pill-gray {
    background: #2a2a2a;
    border: 1px solid #616161;
    color: #bdbdbd;
}

/* Balance cell with tooltip */
.balance-cell {
    cursor: help;
    position: relative;
}

.balance-cell:hover {
    color: #4caf50;
    text-decoration: underline;
}

/* Tooltip styles */
.tooltip {
    position: fixed;
    background: #1a1a1a;
    border: 2px solid #4caf50;
    border-radius: 6px;
    padding: 10px 12px;
    color: #e0e0e0;
    font-size: 12px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    max-width: 300px;
    line-height: 1.6;
}

.tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: #4caf50;
}

.tooltip strong {
    color: #4caf50;
    font-weight: 600;
}