/* Dashboard Styles - Dark Theme */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    color: #e0e0e0;
}

/* Top Navigation */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 30px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-brand a {
    font-size: 20px;
    font-weight: 700;
    color: #60a5fa;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: #9ca3af;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: #e0e0e0;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-name {
    color: #e0e0e0;
    font-size: 14px;
}

.user-tier {
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    text-transform: uppercase;
}

/* Loading Screen */
.loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    color: #9ca3af;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #60a5fa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Auth Required */
.auth-required {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.auth-card {
    text-align: center;
    padding: 50px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-card h2 {
    margin-bottom: 15px;
    color: #e0e0e0;
}

.auth-card p {
    margin-bottom: 25px;
    color: #9ca3af;
}

/* Dashboard Container */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px;
}

/* Header */
.dashboard-header {
    margin-bottom: 40px;
}

.back-link {
    color: #9ca3af;
    text-decoration: none;
    font-size: 14px;
    display: inline-block;
    margin-bottom: 10px;
    transition: color 0.2s;
}

.back-link:hover {
    color: #6366f1;
}

.dashboard-header h1 {
    font-size: 32px;
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 8px;
    margin-top: 0;
}

.dashboard-header .subtitle {
    color: #6b7280;
    font-size: 14px;
}

/* Stats Section */
.stats-section {
    margin-bottom: 40px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.8) 0%, rgba(22, 33, 62, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 25px;
}

.stat-card.positive {
    border-left: 4px solid #4ade80;
}

.stat-card.negative {
    border-left: 4px solid #f87171;
}

.stat-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 5px;
}

.stat-card.positive .stat-value {
    color: #4ade80;
}

.stat-card.negative .stat-value {
    color: #f87171;
}

.stat-detail {
    font-size: 12px;
    color: #6b7280;
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

.chart-card {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.8) 0%, rgba(22, 33, 62, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 25px;
}

.chart-card h3 {
    font-size: 16px;
    font-weight: 500;
    color: #e0e0e0;
    margin-bottom: 20px;
}

.chart-container {
    height: 250px;
}

/* Analyses Section */
.analyses-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 500;
    color: #e0e0e0;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9ca3af;
    font-size: 13px;
    cursor: pointer;
}

.filter-checkbox input {
    accent-color: #60a5fa;
}

.limit-info {
    color: #6b7280;
    font-size: 13px;
}

/* Analyses Table */
.analyses-table-wrapper {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.8) 0%, rgba(22, 33, 62, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
}

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

.analyses-table th,
.analyses-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.analyses-table th {
    background: rgba(0, 0, 0, 0.3);
    color: #6b7280;
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analyses-table td {
    color: #e0e0e0;
    font-size: 13px;
}

.analyses-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.analyses-table tr.favorite {
    background: rgba(96, 165, 250, 0.05);
}

.favorite-cell {
    width: 40px;
}

.favorite-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s;
}

.favorite-btn:hover {
    color: #fbbf24;
}

tr.favorite .favorite-btn {
    color: #fbbf24;
}

.name-cell a {
    color: #60a5fa;
    text-decoration: none;
}

.name-cell a:hover {
    text-decoration: underline;
}

.model-badge {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(96, 165, 250, 0.15);
    color: #60a5fa;
    border-radius: 4px;
    font-size: 11px;
}

.positive {
    color: #4ade80;
}

.negative {
    color: #f87171;
}

.actions-cell {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    color: #9ca3af;
    font-size: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #e0e0e0;
}

.action-btn.delete:hover {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.8) 0%, rgba(22, 33, 62, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
}

.empty-state h3 {
    color: #e0e0e0;
    margin-bottom: 10px;
}

.empty-state p {
    color: #6b7280;
    margin-bottom: 25px;
}

/* Best/Worst Section */
.best-worst-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.bw-card {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.8) 0%, rgba(22, 33, 62, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 25px;
}

.bw-card.best {
    border-left: 4px solid #4ade80;
}

.bw-card.worst {
    border-left: 4px solid #f87171;
}

.bw-card h3 {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 15px;
}

.bw-name {
    font-size: 18px;
    color: #e0e0e0;
    margin-bottom: 10px;
}

.bw-pnl {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 15px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
}

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

.modal-header h2 {
    font-size: 18px;
    color: #e0e0e0;
}

.modal-close {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 24px;
    cursor: pointer;
}

.modal-close:hover {
    color: #e0e0e0;
}

.modal-body {
    padding: 25px;
}

.share-link-box {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.share-link-box input {
    flex: 1;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 13px;
}

.share-notice {
    color: #6b7280;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .nav-links {
        display: none;
    }

    .best-worst-section {
        grid-template-columns: 1fr;
    }

    .analyses-table {
        font-size: 12px;
    }

    .analyses-table th,
    .analyses-table td {
        padding: 10px;
    }

    .actions-cell {
        flex-direction: column;
    }
}
