:root {
    --bg-color: #0d1117;
    --card-bg: #161b22;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --accent-color: #58a6ff;
    --accent-hover: #1f6feb;
    --danger-color: #f85149;
    --success-color: #238636;
    --warning-color: #d29922;
    --border-color: #30363d;
    --glass-bg: rgba(22, 27, 34, 0.7);
    --glass-border: rgba(240, 246, 252, 0.1);
    --neon-green: #00ff88;
    --neon-red: #ff4444;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Auth Container */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: radial-gradient(circle at center, #1f2937 0%, var(--bg-color) 100%);
}

/* Glass Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

/* Navbar */
.navbar {
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 1.5rem;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-links a i {
    font-size: 0.9rem;
    opacity: 0.8;
}

.nav-links a:hover {
    color: var(--text-primary);
}

.nav-links a:hover i {
    opacity: 1;
}

/* Main Content */
.container {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}

.header {
    margin-bottom: 2rem;
}

/* Typography */
h1, h2, h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.text-muted {
    color: var(--text-secondary);
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

input, select, textarea {
    width: 100%;
    padding: 0.75rem;
    background-color: #0d1117;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

input[readonly] {
    background-color: rgba(13, 17, 23, 0.5);
    color: var(--text-secondary);
    cursor: not-allowed;
    border-color: rgba(48, 54, 61, 0.5);
}

input[readonly]:focus {
    border-color: rgba(48, 54, 61, 0.5);
}

.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    font-size: 0.9rem;
}

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: var(--card-bg);
    color: var(--text-primary);
    text-align: center;
    border-radius: 6px;
    padding: 0.5rem;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    border: 1px solid var(--border-color);
    font-size: 0.8rem;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.1s;
    text-align: center;
}

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

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

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

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary {
    background-color: rgba(139, 148, 158, 0.15);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background-color: rgba(139, 148, 158, 0.25);
    border-color: var(--text-secondary);
}

.btn-outline.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Dashboard Grid */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
}

.stats-grid-2x2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.stat-item {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-align: center;
}

.stat-item h4 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-item .h2 {
    font-size: 2rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.stat-item small {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Portfolio Summary */
.portfolio-summary {
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.1) 0%, rgba(22, 27, 34, 0.9) 100%);
    border: 1px solid rgba(88, 166, 255, 0.2);
}

.summary-stat {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.summary-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.summary-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.strategy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
}

.card h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card .h2 {
    font-size: 2rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.card small {
    font-size: 0.75rem;
}

.card.status-active {
    border-color: var(--success-color);
}

.strategy-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.strategy-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    border-color: var(--accent-color);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: bold;
}

.badge-active {
    background-color: rgba(35, 134, 54, 0.2);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.badge-inactive {
    background-color: rgba(139, 148, 158, 0.2);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.badge-success {
    background-color: rgba(35, 134, 54, 0.2);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.badge-warning {
    background-color: rgba(210, 153, 34, 0.2);
    color: var(--warning-color);
    border: 1px solid var(--warning-color);
}

.metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
}

.metric {
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Tables */
.table-container {
    overflow-x: auto;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

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

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

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-weight: 600;
}

tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.strategy-row {
    cursor: pointer;
}

.strategy-row:hover {
    background-color: rgba(88, 166, 255, 0.05) !important;
}

.portfolio-row[data-strategy-id] {
    cursor: pointer;
}

.portfolio-row[data-strategy-id]:hover {
    background-color: rgba(88, 166, 255, 0.05) !important;
}

.positive {
    color: var(--success-color);
    font-weight: 500;
}
.negative {
    color: var(--danger-color);
    font-weight: 500;
}

/* Flashes */
.flash-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.flash {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    color: white;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    min-width: 300px;
}

.flash.success { background-color: rgba(35, 134, 54, 0.9); }
.flash.error { background-color: rgba(248, 81, 73, 0.9); }
.flash.warning { background-color: rgba(210, 153, 34, 0.9); }
.flash.info { background-color: rgba(31, 111, 235, 0.9); }

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 1rem 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

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

.tab.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

.tab-content {
    display: none;
}

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Price Chart Styles */
#priceChart {
    background: var(--bg-color);
    border-radius: 8px;
    overflow: hidden;
}

#currentPrice {
    color: var(--text-primary);
    font-size: 1.75rem;
    font-weight: bold;
}

/* Search Container Styles */
.search-container {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 300px;
}

.search-input {
    width: 100%;
    padding: 0.75rem 2.5rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.1);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    pointer-events: none;
}

.search-clear {
    position: absolute;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.search-clear:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.search-clear i {
    font-size: 0.85rem;
}

/* View Toggle Styles */
.view-toggle {
    display: flex;
    gap: 0.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.25rem;
}

.view-toggle-btn {
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-toggle-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.view-toggle-btn.active {
    background: var(--accent-color);
    color: white;
}

.view-toggle-btn i {
    font-size: 1rem;
}

/* View Transition Styles */
.strategy-grid,
.strategy-list {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.strategy-list {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pagination Styles */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 1rem 0;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 0 1rem;
}

.pagination .btn-sm {
    min-width: 70px;
}

.pagination .btn-sm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modern Stats Strip for Details Page */
.stats-strip {
    display: flex;
    align-items: stretch;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    gap: 1.5rem;
}

.stat-item-modern {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.stat-details {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.stat-value-main {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.stat-sublabel {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
    margin-top: 0.25rem;
}

.stat-divider {
    width: 1px;
    background: linear-gradient(to bottom, transparent, var(--border-color), transparent);
    align-self: stretch;
}

/* Responsive stats strip - stack on smaller screens */
@media (max-width: 1024px) {
    .stats-strip {
        flex-wrap: wrap;
    }

    .stat-item-modern {
        min-width: calc(50% - 0.75rem);
    }

    .stat-divider {
        display: none;
    }
}

@media (max-width: 640px) {
    .stats-strip {
        flex-direction: column;
        gap: 1rem;
    }

    .stat-item-modern {
        min-width: 100%;
    }
}

/* ==================== Comparative Backtesting Styles ==================== */

/* Parameter Range Input */
.param-range-group {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.param-preview {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: monospace;
}

/* Job Status Progress */
.job-status-card {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.1) 0%, rgba(22, 27, 34, 0.9) 100%);
    border: 1px solid rgba(88, 166, 255, 0.2);
    border-radius: 8px;
    margin-bottom: 2rem;
}

.progress-bar-container {
    width: 100%;
    height: 24px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), var(--success-color));
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.5rem;
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Results Table - Enhanced */
.results-table-container {
    margin-top: 2rem;
}

.config-summary {
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--text-secondary);
    line-height: 1.4;
}

.metric-highlight {
    font-weight: 600;
    color: var(--text-primary);
}

.rank-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: bold;
}

.rank-1 { background: gold; color: black; }
.rank-2 { background: silver; color: black; }
.rank-3 { background: #cd7f32; color: white; }

/* Monte Carlo Chart */
.monte-carlo-chart-container {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.equity-curve-best { stroke: var(--success-color); stroke-width: 2; }
.equity-curve-worst { stroke: var(--danger-color); stroke-width: 2; }
.equity-curve-other { stroke: var(--accent-color); stroke-width: 1; opacity: 0.3; }

.chart-legend {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.legend-color {
    width: 20px;
    height: 3px;
    border-radius: 2px;
}

/* Grid helpers */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* ==================== News Sentiment Styles ==================== */

/* Sentiment Label Colors */
.sentiment-bullish {
    color: #22c55e;
    font-weight: 600;
}

.sentiment-somewhat-bullish {
    color: #86efac;
    font-weight: 600;
}

.sentiment-neutral {
    color: var(--text-secondary);
    font-weight: 600;
}

.sentiment-somewhat-bearish {
    color: #fb923c;
    font-weight: 600;
}

.sentiment-bearish {
    color: #ef4444;
    font-weight: 600;
}

/* News Item Card */
.news-item {
    padding: 1.25rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.news-item:hover {
    border-color: var(--accent-color);
    transform: translateX(4px);
}

.news-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.news-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.news-item-title a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s;
}

.news-item-title a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.news-item-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.news-item-meta span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.news-item-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.news-metric {
    display: flex;
    flex-direction: column;
}

.news-metric-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.news-metric-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Badge for sentiment labels */
.sentiment-badge {
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: bold;
    display: inline-block;
}

.sentiment-badge.bullish {
    background-color: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid #22c55e;
}

.sentiment-badge.somewhat-bullish {
    background-color: rgba(134, 239, 172, 0.2);
    color: #86efac;
    border: 1px solid #86efac;
}

.sentiment-badge.neutral {
    background-color: rgba(139, 148, 158, 0.2);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.sentiment-badge.somewhat-bearish {
    background-color: rgba(251, 146, 60, 0.2);
    color: #fb923c;
    border: 1px solid #fb923c;
}

.sentiment-badge.bearish {
    background-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid #ef4444;
}

/* News Sentiment Sub-Tabs */
.news-subtabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.news-subtab-btn {
    padding: 0.65rem 1.25rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.news-subtab-btn:hover {
    background-color: rgba(88, 166, 255, 0.1);
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-1px);
}

.news-subtab-btn.active {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    border-color: var(--accent-color);
    color: white;
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
}

.news-subtab-content {
    display: none;
}

.news-subtab-content.active {
    display: block;
    animation: fadeInNews 0.3s ease;
}

@keyframes fadeInNews {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* News Results Container */
.news-results-container {
    min-height: 200px;
}

.news-loading {
    text-align: center;
    padding: 3rem;
}

.news-error {
    padding: 2rem;
    text-align: center;
    background: rgba(248, 81, 73, 0.1);
    border: 1px solid var(--danger-color);
    border-radius: 8px;
}

.news-empty {
    text-align: center;
    padding: 3rem;
}

.news-summary {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(88, 166, 255, 0.1) 0%, rgba(22, 27, 34, 0.9) 100%);
    border: 1px solid rgba(88, 166, 255, 0.2);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.news-items-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* AI Magic Button */
.ai-magic-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.ai-magic-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.ai-magic-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* AI Summary Container */
.ai-summary-container {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.ai-summary-text {
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 0.95rem;
}

.ai-summary-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Credential Configuration Blur */
.config-blurred {
    filter: blur(5px);
    user-select: none;
    pointer-events: none;
    transition: filter 0.3s ease;
}

.config-blurred:focus {
    filter: blur(5px);
}

/* Copy Button for Alpaca Order IDs */
.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
    padding: 0.25rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.75rem;
    vertical-align: middle;
}

.copy-btn:hover {
    background: rgba(88, 166, 255, 0.1);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.copy-btn.copied {
    background: rgba(35, 134, 54, 0.2);
    border-color: var(--success-color);
    color: var(--success-color);
}

.copy-btn i {
    font-size: 0.75rem;
}

/* Strategy Config Parameters Display */
.config-param {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.3);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
}

.config-param i {
    color: var(--accent-color);
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Strategy Info Pills */
.info-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(139, 148, 158, 0.1);
    border: 1px solid rgba(139, 148, 158, 0.2);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.info-pill i {
    opacity: 0.7;
}

/* Price Pill - Prominent styling */
.price-pill {
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.3);
    gap: 0.75rem;
    padding: 0.5rem 1.25rem;
}

.price-pill .price-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    font-weight: 500;
}

.price-pill .price-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-color);
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', monospace;
}

/* Daily PnL Delta Display */
.pnl-delta {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-left: 0.5rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', monospace;
}

.pnl-delta.positive {
    color: var(--success-color);
    background-color: rgba(35, 134, 54, 0.15);
    border: 1px solid rgba(35, 134, 54, 0.3);
}

.pnl-delta.negative {
    color: var(--danger-color);
    background-color: rgba(248, 81, 73, 0.15);
    border: 1px solid rgba(248, 81, 73, 0.3);
}
