* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    color: #333;
    font-size: 2rem;
}

.refresh-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

#refreshBtn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

#refreshBtn:hover {
    background: #5568d3;
    transform: translateY(-2px);
}

#lastUpdate {
    color: #666;
    font-size: 0.9rem;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s;
}

.metric-card:hover {
    transform: translateY(-5px);
}

.metric-card h3 {
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #333;
}

.positive {
    color: #10b981;
}

.negative {
    color: #ef4444;
}

.chart-container {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.chart-container h2 {
    color: #333;
    margin-bottom: 20px;
}

.tables-container {
    display: grid;
    gap: 30px;
}

.table-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.table-section h2 {
    color: #333;
    margin-bottom: 20px;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f9fafb;
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

td {
    padding: 15px;
    border-top: 1px solid #e5e7eb;
}

tbody tr:hover {
    background: #f9fafb;
}

.buy-side {
    color: #10b981;
    font-weight: 600;
}

.sell-side {
    color: #ef4444;
    font-weight: 600;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 1.1rem;
}

/* LLM Decisions Section */
.llm-decisions-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.llm-decisions-section h2 {
    color: #333;
    margin-bottom: 10px;
}

.section-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.llm-symbols-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
    gap: 25px;
}

.llm-symbol-card {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    background: #fafafa;
    transition: all 0.3s;
}

.llm-symbol-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
}

.llm-symbol-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.llm-symbol-name {
    font-size: 1.4rem;
    font-weight: bold;
    color: #333;
}

.llm-symbol-stats {
    font-size: 0.85rem;
    color: #666;
}

.llm-decisions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 8px;
}

/* Custom scrollbar */
.llm-decisions-list::-webkit-scrollbar {
    width: 6px;
}

.llm-decisions-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.llm-decisions-list::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.llm-decision-item {
    background: white;
    border-left: 4px solid;
    padding: 12px 15px;
    border-radius: 8px;
    transition: all 0.2s;
}

.llm-decision-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Decision types */
.decision-analysis {
    border-left-color: #667eea;
}

.decision-review {
    border-left-color: #f59e0b;
}

.llm-decision-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.llm-decision-signal {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.95rem;
}

.llm-decision-type {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.llm-decision-timestamp {
    font-size: 0.8rem;
    color: #999;
}

.llm-decision-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    line-height: 1.3;
}

.llm-decision-details span {
    color: #666;
    flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .llm-decision-details {
        gap: 6px 8px;
        font-size: 0.8rem;
    }
    
    .sl-change, .tp-change {
        font-size: 0.75rem;
    }
}

.llm-decision-reasoning {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.5;
    padding: 10px;
    background: #f9fafb;
    border-radius: 6px;
    margin-top: 8px;
    font-style: italic;
}

/* SL/TP changes styling */
.sl-change, .tp-change {
    display: inline-block;
    font-size: 0.8rem;
    margin-right: 8px;
    white-space: nowrap;
}

.sl-change strong, .tp-change strong {
    color: #333;
    font-weight: 600;
}

.sl-change .old-value, .tp-change .old-value {
    color: #666;
    text-decoration: line-through;
    font-size: 0.75rem;
    margin-right: 2px;
}

.sl-change .new-value, .tp-change .new-value {
    font-weight: 600;
    margin-left: 2px;
}

.sl-change .positive, .tp-change .positive {
    color: #10b981;
}

.sl-change .negative, .tp-change .negative {
    color: #ef4444;
}

.llm-confidence {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #e0e7ff;
    color: #4338ca;
}

/* Signal colors */
.signal-buy {
    color: #10b981;
}

.signal-sell {
    color: #ef4444;
}

.signal-hold {
    color: #6b7280;
}

.signal-keep {
    color: #3b82f6;
}

.signal-close {
    color: #dc2626;
}

.signal-adjust_sl,
.signal-adjust_tp,
.signal-adjust_both {
    color: #f59e0b;
}

.signal-reverse {
    color: #8b5cf6;
}

.no-decisions {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

/* Checklists */
.llm-checklists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.llm-checklist {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 8px;
}

.llm-checklist-title {
    font-weight: 600;
    font-size: 0.85rem;
    color: #333;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #e5e7eb;
}

.llm-checklist-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.checklist-item {
    font-size: 0.75rem;
    padding: 3px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.checklist-item.checked {
    color: #059669;
    background: #d1fae5;
}

.checklist-item.unchecked {
    color: #dc2626;
    background: #fee2e2;
}

/* Market Analysis Styles */
.llm-market-analysis {
    margin-top: 15px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.llm-market-analysis-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.llm-market-analysis-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.market-analysis-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.market-analysis-label {
    font-weight: 500;
    color: #475569;
    font-size: 0.8rem;
}

.market-analysis-value {
    color: #1e293b;
    font-size: 0.85rem;
    line-height: 1.4;
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    table {
        font-size: 0.85rem;
    }
    
    th, td {
        padding: 10px;
    }
    
    .llm-symbols-grid {
        grid-template-columns: 1fr;
    }
    
    .llm-checklists {
        grid-template-columns: 1fr;
    }
}

