/* Bot Coach - Clean, Data-Focused Design */

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --neutral-bg: #f3f4f6;
    --neutral-border: #e5e7eb;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --card-bg: #ffffff;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --card-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

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

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--neutral-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 30px 40px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
    box-shadow: var(--card-shadow-lg);
}

.header-content h1 {
    font-size: 32px;
    margin-bottom: 8px;
    font-weight: 700;
}

.tagline {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 300;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-lg);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    font-size: 18px;
}

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

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Cards */
.health-card,
.recommendations-section,
.skills-section,
.parameters-section,
.progress-section {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--neutral-border);
}

.section-header {
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 22px;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
}

.health-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--neutral-border);
}

.health-header h2 {
    font-size: 22px;
}

.last-updated {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Health Score */
.health-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.health-score-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

#healthScoreChart {
    max-width: 200px;
}

.health-info {
    text-align: center;
    margin-top: -60px;
    z-index: 10;
}

.health-score-value {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary-color);
}

.health-score-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.health-status {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    padding: 5px 15px;
    background: var(--neutral-bg);
    border-radius: 20px;
    display: inline-block;
}

.health-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.metric {
    padding: 15px;
    background: var(--neutral-bg);
    border-radius: 6px;
    text-align: center;
}

.metric-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Recommendations Grid */
.recommendations-grid,
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.recommendation-card,
.skill-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid var(--neutral-border);
    border-radius: var(--border-radius);
    padding: 20px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.recommendation-card:hover,
.skill-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--card-shadow-lg);
    transform: translateY(-4px);
}

.recommendation-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.impact-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 15px;
}

.impact-badge.high {
    background: var(--danger-color);
}

.impact-badge.medium {
    background: var(--warning-color);
}

.impact-badge.low {
    background: var(--success-color);
}

.card-content {
    margin-bottom: 15px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.detail-value {
    color: var(--text-primary);
    font-weight: 600;
}

.backtest-preview {
    background: var(--neutral-bg);
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    font-size: 12px;
}

.backtest-stat {
    display: flex;
    justify-content: space-between;
    margin: 4px 0;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-implement {
    flex: 1;
    padding: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
}

.btn-implement:hover {
    background: var(--secondary-color);
}

.btn-details {
    flex: 1;
    padding: 10px;
    background: var(--neutral-bg);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
}

.btn-details:hover {
    background: var(--primary-color);
    color: white;
}

/* Parameters List */
.parameters-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.parameter-item {
    background: var(--neutral-bg);
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
}

.param-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.param-description {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.param-adjustment {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    font-size: 12px;
}

.param-value {
    background: white;
    padding: 5px;
    border-radius: 4px;
    border: 1px solid var(--neutral-border);
}

.param-label {
    color: var(--text-secondary);
    font-weight: 600;
}

.param-amount {
    color: var(--text-primary);
    font-weight: 700;
}

/* Progress Chart */
.progress-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

#progressChart {
    width: 100%;
    max-width: 500px;
}

.progress-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.progress-stat {
    padding: 12px;
    background: var(--neutral-bg);
    border-radius: 6px;
}

.progress-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.progress-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

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

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--card-shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--neutral-border);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 20px;
}

.setting-group {
    margin-bottom: 20px;
}

.label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    font-weight: 500;
    cursor: pointer;
    gap: 10px;
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.select,
input[type="range"],
input[type="email"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--neutral-border);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.select:focus,
input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input[type="range"] {
    padding: 0;
    height: 6px;
}

/* Responsive */
@media (max-width: 1024px) {
    .recommendations-grid,
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .health-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .health-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .header-actions {
        margin-top: 15px;
    }

    .recommendations-grid,
    .skills-grid {
        grid-template-columns: 1fr;
    }

    .progress-content {
        grid-template-columns: 1fr;
    }

    .param-adjustment {
        grid-template-columns: 1fr;
    }

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

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.recommendation-card,
.skill-card {
    animation: slideUp 0.4s ease;
}
