/* Modern Financial Analysis Platform Styles */

:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --light: #f9fafb;
    --dark: #1f2937;
    --border: #e5e7eb;
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.2);
    
    /* Light mode colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --card-bg: #ffffff;
    --modal-bg: #ffffff;
}

/* Dark mode theme */
/* Dark theme vars apply when EITHER <html> or <body> carries .dark-mode.
   The shared shell (base.html) sets it on <html> in the <head> before first
   paint (flash-free); app.js continues to set it on <body>. */
html.dark-mode,
body.dark-mode {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3a3a3a;
    --text-primary: #e5e5e5;
    --text-secondary: #a0a0a0;
    --card-bg: #242424;
    --modal-bg: #2d2d2d;
    --border: #404040;
    --light: #2d2d2d;
    --shadow: 0 4px 6px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.5);
}

* {
    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, var(--primary) 0%, var(--secondary) 100%);
    min-height: 100vh;
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background: var(--card-bg);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.5em;
}

.sidebar-section {
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-section h3 {
    font-size: 1em;
    margin-bottom: 10px;
    color: var(--text-primary);
}

/* Portfolio Widget */
.portfolio-summary {
    background: var(--light);
    border-radius: 8px;
    padding: 12px;
}

.portfolio-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.portfolio-stat:last-child {
    border-bottom: none;
}

.portfolio-stat .stat-label {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.portfolio-stat .stat-value {
    font-weight: 600;
    font-size: 0.95em;
}

.portfolio-stat .stat-value.positive {
    color: var(--success);
}

.portfolio-stat .stat-value.negative {
    color: var(--danger);
}

/* Watchlist */
.watchlist-add {
    padding: 15px;
    display: flex;
    gap: 10px;
    border-bottom: 2px solid var(--border);
}

.watchlist-add input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.95em;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.watchlist-add button {
    width: 40px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.5em;
    cursor: pointer;
    transition: background 0.3s;
}

.watchlist-add button:hover {
    background: var(--primary-dark);
}

.watchlist-items {
    flex: 1;
    min-height: 200px;
    overflow-y: auto;
}

.watchlist-item {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s;
}

.watchlist-item:hover {
    background: var(--bg-tertiary);
}

.watchlist-symbol {
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
}

.watchlist-symbol:hover {
    text-decoration: underline;
}

.watchlist-price {
    font-family: monospace;
    font-size: 0.9em;
}

.watchlist-change {
    font-size: 0.85em;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.watchlist-change.positive {
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.watchlist-change.negative {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.watchlist-remove {
    background: none;
    border: none;
    color: var(--danger);
    font-size: 1.5em;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    transition: background 0.2s;
}

.watchlist-remove:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Main Content */
.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    max-width: 100%;
}

.app-header {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 25px 30px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-header h1 {
    font-size: 2em;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-indicator.online {
    background: var(--success);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

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

/* Buttons */
.btn-primary, .btn-secondary, .btn-icon, .icon-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-icon, .icon-btn {
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-icon:hover, .icon-btn:hover {
    background: var(--bg-secondary);
}

/* Analysis Section */
.analysis-section {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.search-card h2 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.form-group input, .form-group select {
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1em;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Loading */
.loading, .loading-small {
    text-align: center;
    padding: 40px;
}

.loading-small {
    padding: 20px;
    font-size: 0.9em;
    color: #666;
}

.spinner {
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.result-card {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.result-card h3 {
    margin-bottom: 15px;
    color: var(--text-primary);
}

.price-display {
    margin: 20px 0;
}

.current-price {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--text-primary);
}

.price-change {
    font-size: 1.2em;
    font-weight: 600;
    margin-top: 5px;
}

.price-change.positive {
    color: var(--success);
}

.price-change.negative {
    color: var(--danger);
}

.indicators-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.indicator {
    padding: 12px;
    background: var(--light);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
}

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

.indicator .value {
    font-weight: 700;
    color: var(--text-primary);
}

.chart-card {
    grid-column: 1 / -1;
}

.analysis-card {
    grid-column: 1 / -1;
}

.analysis-text {
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

/* ML Prediction Card */
.ml-prediction-card {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #667eea10 0%, #764ba210 100%);
    border: 2px solid var(--primary);
}

.ml-prediction-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.prediction-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.prediction-direction {
    font-size: 1.8em;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 8px;
}

.prediction-direction.up {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.prediction-direction.down {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.prediction-direction.sideways {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.prediction-price {
    font-size: 1.3em;
}

.prediction-price strong {
    color: var(--primary);
    font-size: 1.2em;
}

.prediction-change {
    margin-left: 10px;
    font-weight: 600;
}

.prediction-meta {
    display: flex;
    gap: 20px;
    padding-top: 15px;
    border-top: 2px solid var(--border);
}

.prediction-confidence,
.prediction-horizon {
    padding: 8px 15px;
    background: white;
    border-radius: 6px;
    font-weight: 600;
    color: var(--dark);
}

/* ML Patterns Card */
.ml-patterns-card {
    grid-column: 1 / -1;
}

.ml-patterns-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.ml-pattern-item {
    background: var(--light);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ml-pattern-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

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

.pattern-type {
    font-weight: 700;
    font-size: 1.1em;
    color: var(--text-primary);
}

.pattern-confidence {
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.9em;
    font-weight: 600;
}

.pattern-prediction {
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pattern-prediction.bullish {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.pattern-prediction.bearish {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.pattern-prediction.neutral {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.pattern-horizon {
    font-size: 0.85em;
    opacity: 0.8;
}

/* Phase 3: Sentiment Card */
.sentiment-card {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #667eea10 0%, #764ba210 100%);
    border: 2px solid var(--info);
}

.sentiment-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sentiment-main {
    display: flex;
    gap: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.sentiment-gauge {
    text-align: center;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.sentiment-score {
    font-size: 3em;
    font-weight: 700;
    color: var(--primary);
}

.sentiment-label {
    font-size: 1.2em;
    font-weight: 600;
    margin-top: 10px;
}

.sentiment-consensus {
    flex: 1;
    min-width: 200px;
}

.consensus-bar {
    height: 30px;
    background: #ef4444;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
}

.consensus-bullish {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #f59e0b 50%, #ef4444 100%);
    transition: width 0.5s ease;
}

.consensus-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
}

.sentiment-recommendation {
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1em;
    color: var(--text-primary);
}

/* Phase 3: Risk Card */
.risk-card {
    grid-column: 1 / -1;
}

.risk-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.risk-grade-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.risk-grade {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5em;
    font-weight: 700;
    color: white;
    box-shadow: var(--shadow);
}

.risk-description {
    flex: 1;
}

.risk-score {
    margin-top: 5px;
    font-size: 1.1em;
    color: #666;
}

.risk-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.risk-metric {
    padding: 15px;
    background: var(--light);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-label {
    font-weight: 600;
    color: #666;
}

.metric-value {
    font-weight: 700;
    font-size: 1.2em;
    color: var(--dark);
}

.risk-recommendations {
    padding: 15px;
    background: rgba(239, 68, 68, 0.05);
    border-left: 4px solid var(--danger);
    border-radius: 8px;
}

.risk-rec {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.risk-rec:last-child {
    border-bottom: none;
}

/* Phase 3: Timing Card */
.timing-card {
    grid-column: 1 / -1;
}

.timing-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.timing-section {
    padding: 20px;
    background: var(--light);
    border-radius: 12px;
}

.timing-section h4 {
    margin-bottom: 15px;
    color: var(--dark);
}

.timing-score {
    margin-bottom: 15px;
}

.score-bar {
    height: 30px;
    background: #e5e7eb;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 8px;
}

.score-fill {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 15px;
}

.score-label {
    text-align: center;
    font-weight: 700;
    font-size: 1.1em;
}

.timing-recommendation {
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.timing-signals {
    margin-top: 15px;
}

.signal-item {
    padding: 10px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: var(--text-primary);
}

.signal-item:last-child {
    margin-bottom: 0;
}

.price-targets {
    margin-top: 15px;
}

.target-item {
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-weight: 600;
}

.target-item.stop-loss {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.target-item.take-profit {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

/* Modal s */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--modal-bg);
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px 30px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2em;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: background 0.3s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    background: var(--modal-bg);
    color: var(--text-primary);
}

/* Comparison */
.comparison-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.comparison-controls input {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 2px solid var(--border);
    border-radius: 8px;
}

.comparison-options {
    display: flex;
    gap: 10px;
    align-items: center;
}

.symbol-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    min-height: 50px;
}

.symbol-chip {
    padding: 8px 12px;
    background: var(--primary);
    color: white;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.symbol-chip button {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1em;
}

.symbol-chip button:hover {
    background: rgba(255, 255, 255, 0.5);
}

.comparison-chart {
    margin: 20px 0;
    min-height: 400px;
}

.comparison-table {
    margin-top: 20px;
}

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

.data-table th, .data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: var(--light);
    font-weight: 600;
    color: var(--dark);
}

.data-table tr:hover {
    background: var(--light);
}

/* Alerts */
.alert-form {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1.5fr auto;
    gap: 10px;
    margin-bottom: 20px;
}

.alert-form input, .alert-form select {
    padding: 10px;
    border: 2px solid var(--border);
    border-radius: 8px;
}

.alerts-list {
    max-height: 400px;
    overflow-y: auto;
}

.alert-item {
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-item.active {
    border-color: var(--info);
    background: rgba(59, 130, 246, 0.05);
}

.alert-item.triggered {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.05);
}

.alert-symbol {
    font-weight: 700;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.alert-details {
    color: #666;
    font-size: 0.9em;
}

.alert-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 700;
}

.alert-badge.active {
    background: var(--info);
    color: white;
}

.alert-badge.triggered {
    background: var(--success);
    color: white;
}

/* Utilities */
.empty-state {
    padding: 30px;
    text-align: center;
    color: #999;
    font-style: italic;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--danger);
    color: var(--danger);
    padding: 15px 20px;
    border-radius: 10px;
    margin: 20px 0;
}

/* Phase 5: Notification Center */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 0.7em;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.notification-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 450px;
    max-height: 80vh;
    background: var(--modal-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
}

.notification-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.notification-header h3 {
    margin: 0;
    font-size: 1.2em;
}

.notification-body {
    flex: 1 1 auto;
    overflow-y: scroll;
    overflow-x: hidden;
    padding: 15px;
    min-height: 0;
    max-height: calc(80vh - 80px);
}

.notification-body::-webkit-scrollbar {
    width: 8px;
}

.notification-body::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
}

.notification-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.notification-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

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

.suggestion-group-header {
    font-weight: 700;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    padding-left: 10px;
}

.suggestion-item {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border-left: 3px solid var(--info);
    transition: transform 0.2s, box-shadow 0.2s;
}

.suggestion-item:hover {
    transform: translateX(-2px);
    box-shadow: var(--shadow);
}

.suggestion-item.priority-high {
    border-left-color: var(--danger);
}

.suggestion-item.priority-medium {
    border-left-color: var(--warning);
}

.suggestion-item.priority-low {
    border-left-color: var(--info);
}

.suggestion-icon {
    font-size: 1.8em;
    line-height: 1;
}

.suggestion-content {
    flex: 1;
}

.suggestion-message {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
    font-size: 0.95em;
}

.suggestion-reason {
    font-size: 0.85em;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 8px;
}

.suggestion-price {
    font-size: 0.85em;
    color: var(--primary);
    font-weight: 600;
    padding: 4px 8px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 4px;
    display: inline-block;
}

.suggestion-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.btn-accept,
.btn-dismiss {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

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

.btn-accept:hover {
    background: #0ea573;
    transform: scale(1.05);
}

.btn-dismiss {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.btn-dismiss:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Multi-Chart Grid Styles */
.modal-large {
    max-width: 95vw;
    max-height: 95vh;
    width: 1400px;
}

.multi-chart-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.multi-chart-controls input[type="text"] {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1em;
}

.multi-chart-controls select {
    padding: 10px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1em;
    background: white;
}

.multi-chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    max-height: calc(95vh - 200px);
    overflow-y: auto;
    padding: 10px;
}

.multi-chart-item {
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}

.multi-chart-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.multi-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.multi-chart-header h3 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 700;
}

.chart-price {
    font-size: 1em;
    font-weight: 600;
}

.remove-chart-btn {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    font-size: 1.5em;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-chart-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

.multi-chart-body {
    padding: 15px;
}

.multi-chart-body img {
    width: 100%;
    height: auto;
    display: block;
}

.multi-chart-loading {
    padding: 60px 20px;
    text-align: center;
    color: #999;
    font-size: 1.1em;
}

.multi-chart-error {
    padding: 60px 20px;
    text-align: center;
    color: var(--danger);
    font-size: 1.1em;
}

/* Hamburger menu toggle */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1001;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    width: 44px;
    height: 44px;
    font-size: 1.5em;
    cursor: pointer;
    box-shadow: var(--shadow);
}

/* Responsive */
@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: none;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -320px;
        width: 300px;
        height: 100vh;
        max-height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .header-actions {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .header-actions .btn-secondary,
    .header-actions .btn-primary {
        font-size: 0.8em;
        padding: 6px 10px;
    }
    
    .app-header {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
    }
    
    .app-header h1 {
        font-size: 1.2em;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .multi-chart-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-large {
        width: 100%;
    }
    
    .indicators-grid {
        grid-template-columns: 1fr;
    }
    
    .correlation-panel {
        padding: 15px;
    }
    
    .correlation-table {
        font-size: 0.8em;
    }
    
    .correlation-cell {
        padding: 8px 4px;
    }
}

@media (max-width: 480px) {
    .app-header h1 {
        font-size: 1em;
    }
    
    .header-actions .btn-secondary,
    .header-actions .btn-primary {
        font-size: 0.75em;
        padding: 5px 8px;
    }
    
    .search-card h2 {
        font-size: 1.1em;
    }
}

/* =======================
   TECHNICAL CHART MODAL
   ======================= */

.technical-chart-result {
    margin-top: 20px;
}

.technical-chart-result .chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 15px;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.technical-chart-result .chart-header h3 {
    margin: 0;
    font-size: 1.3em;
    color: var(--text);
}

.technical-chart-result .price-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.technical-chart-result .current-price {
    font-size: 1.4em;
    font-weight: bold;
    color: var(--text);
}

.technical-chart-result .price-change {
    font-size: 1.1em;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
}

.technical-chart-result .price-change.positive {
    color: var(--success);
    background: rgba(76, 175, 80, 0.1);
}

.technical-chart-result .price-change.negative {
    color: var(--danger);
    background: rgba(244, 67, 54, 0.1);
}

.indicator-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-top: 15px;
}

.indicator-legend .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: var(--bg);
    border-radius: 6px;
    font-size: 0.9em;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.indicator-legend .legend-item::before {
    content: '✓';
    color: var(--success);
    font-weight: bold;
}

/* ================================================================
   Feature #3: News & Events Feed Styles
   ================================================================ */

.news-panel {
    margin-bottom: 30px;
}

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

.news-header h3 {
    margin: 0;
    font-size: 1.4em;
    color: var(--text);
}

.btn-refresh {
    padding: 8px 12px;
    font-size: 1.2em;
    transition: transform 0.3s ease;
}

.btn-refresh:hover {
    transform: rotate(180deg);
}

.news-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
}

.news-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 6px 6px 0 0;
    position: relative;
}

.news-tab:hover {
    background: var(--bg-secondary);
    color: var(--text);
}

.news-tab.active {
    color: var(--primary);
    background: var(--bg-secondary);
}

.news-tab.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary);
    border-radius: 3px 3px 0 0;
}

.news-content {
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
}

.news-loading, .news-error, .news-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.news-card {
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    cursor: pointer;
}

.news-card:hover {
    transform: translateX(5px);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.news-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.85em;
    color: var(--text-secondary);
}

.news-sentiment {
    font-size: 1.2em;
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--bg-primary);
}

.news-sentiment.positive {
    color: var(--success);
}

.news-sentiment.negative {
    color: var(--danger);
}

.news-sentiment.neutral {
    color: var(--text-secondary);
}

.news-source {
    font-weight: 500;
    color: var(--text);
}

.news-time {
    margin-left: auto;
}

.news-title {
    display: block;
    color: var(--text);
    text-decoration: none;
    font-size: 1.05em;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 8px;
}

.news-title:hover {
    color: var(--primary);
}

.news-meta {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.news-index {
    font-size: 0.85em;
    padding: 3px 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    color: var(--text-secondary);
}

/* Earnings Calendar Styles */

.earnings-calendar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.earnings-day {
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
}

.earnings-day:last-child {
    border-bottom: none;
}

.earnings-date {
    font-size: 1.1em;
    color: var(--text);
    margin-bottom: 12px;
    font-weight: 600;
}

.earnings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.earnings-card {
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.earnings-card:hover {
    border-color: var(--primary);
    background: var(--bg-primary);
}

.earnings-symbol {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.earnings-symbol strong {
    font-size: 1.1em;
    color: var(--primary);
}

.earnings-time {
    font-size: 0.85em;
    color: var(--text-secondary);
    padding: 3px 8px;
    background: var(--bg-primary);
    border-radius: 4px;
}

.earnings-company {
    font-size: 0.9em;
    color: var(--text-secondary);
}

/* Trending Tickers Styles */

.trending-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trending-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    cursor: pointer;
}

.trending-card:hover {
    transform: translateX(5px);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.trending-rank {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--text-secondary);
    min-width: 35px;
    text-align: center;
}

.trending-info {
    flex: 1;
}

.trending-symbol {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.trending-symbol strong {
    font-size: 1.1em;
    color: var(--text);
}

.trending-name {
    font-size: 0.85em;
    color: var(--text-secondary);
}

.trending-stats {
    display: flex;
    gap: 10px;
    align-items: center;
}

.trending-price {
    font-weight: 600;
    color: var(--text);
}

.trending-change {
    font-size: 0.9em;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

.trending-change.positive {
    color: var(--success);
    background: rgba(76, 175, 80, 0.1);
}

.trending-change.negative {
    color: var(--danger);
    background: rgba(244, 67, 54, 0.1);
}

.trending-news-count {
    font-size: 0.85em;
    color: var(--text-secondary);
    padding: 6px 12px;
    background: var(--bg-primary);
    border-radius: 6px;
    white-space: nowrap;
}

/* Symbol News View */

.symbol-news-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border);
}

.btn-back {
    padding: 8px 15px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.btn-back:hover {
    background: var(--bg-primary);
    border-color: var(--primary);
    color: var(--primary);
}

.symbol-news-header h4 {
    margin: 0;
    font-size: 1.2em;
    color: var(--text);
}

/* ============================================================================
   Correlation Matrix & Heat Map Styles (Feature #4)
   ============================================================================ */

.correlation-panel {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    max-width: 100%;
}

.correlation-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    margin-top: 20px;
    overflow-x: auto;
}

@media (min-width: 1400px) {
    .correlation-content {
        grid-template-columns: 400px 1fr;
    }
}

/* Diversification Section */

.diversification-section h3,
.heatmap-section h3 {
    margin: 0 0 20px 0;
    font-size: 1.3em;
    color: var(--text);
    font-weight: 600;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.metric-card {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s ease;
}

.metric-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.metric-card.large-metric {
    grid-column: span 2;
    padding: 30px;
}

@media (max-width: 768px) {
    .metric-card.large-metric {
        grid-column: span 1;
    }
}

.metric-label {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 2.5em;
    font-weight: 700;
    margin: 10px 0;
    line-height: 1;
}

.large-metric .metric-value {
    font-size: 4em;
}

.metric-unit {
    font-size: 0.5em;
    color: var(--text-secondary);
    font-weight: 400;
}

.metric-description,
.metric-sub {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* Sector Exposure */

.sector-exposure-section {
    margin-top: 25px;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.sector-exposure-section h4 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    color: var(--text);
}

.sector-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sector-bar-item {
    display: grid;
    grid-template-columns: 150px 1fr 60px;
    align-items: center;
    gap: 15px;
}

.sector-label {
    font-size: 0.9em;
    color: var(--text);
    font-weight: 500;
}

.sector-bar-container {
    height: 24px;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.sector-bar {
    height: 100%;
    border-radius: 12px;
    transition: width 0.3s ease;
    position: relative;
}

.sector-percentage {
    font-size: 0.9em;
    color: var(--text);
    font-weight: 600;
    text-align: right;
}

/* Recommendations */

.recommendations-section {
    margin-top: 25px;
}

.recommendations-section h4 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    color: var(--text);
}

.recommendation-card {
    display: flex;
    gap: 15px;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 12px;
    border-left: 4px solid;
    transition: all 0.2s ease;
}

.recommendation-card.warning {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: #ef4444;
}

.recommendation-card.info {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: #3b82f6;
}

.recommendation-card.success {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: #10b981;
}

.recommendation-card:hover {
    transform: translateX(5px);
}

.rec-icon {
    font-size: 1.5em;
    line-height: 1;
}

.rec-content {
    flex: 1;
}

.rec-message {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 5px;
    line-height: 1.4;
}

.rec-action {
    font-size: 0.9em;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Heat Map */

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.legend-label {
    font-size: 0.9em;
    color: var(--text-secondary);
    font-weight: 500;
}

.legend-gradient {
    flex: 1;
    height: 20px;
    background: linear-gradient(to right, 
        rgb(255, 100, 100), 
        rgb(255, 200, 200), 
        rgb(255, 255, 255), 
        rgb(200, 255, 200), 
        rgb(100, 255, 100)
    );
    border-radius: 4px;
    border: 1px solid var(--border);
}

.correlation-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px;
    background: var(--bg-primary);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    min-width: 400px;
}

.correlation-table th {
    padding: 12px 8px;
    background: var(--bg-primary);
    color: var(--text);
    font-weight: 600;
    font-size: 0.9em;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.correlation-table th.symbol-header {
    background: var(--primary);
    color: white;
}

.correlation-cell {
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.correlation-cell:hover {
    border: 2px solid var(--primary);
    z-index: 5;
    transform: scale(1.05);
}

.correlation-cell.highlighted {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
    z-index: 4;
}

.correlation-cell.diagonal {
    background: var(--bg-secondary) !important;
    opacity: 0.5;
    cursor: default;
}

.correlation-cell.diagonal:hover {
    transform: none;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.correlation-value {
    font-weight: 600;
    font-size: 0.85em;
    color: rgba(0, 0, 0, 0.8);
}

.correlation-summary {
    margin-top: 30px;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.correlation-summary h4 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    color: var(--text);
}

.avg-correlations {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.avg-correlation-item {
    display: grid;
    grid-template-columns: 80px 1fr 80px;
    align-items: center;
    gap: 15px;
}

.symbol-badge {
    padding: 6px 12px;
    background: var(--primary);
    color: white;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9em;
    text-align: center;
}

.correlation-bar-container {
    height: 24px;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.correlation-bar {
    height: 100%;
    border-radius: 12px;
    transition: width 0.3s ease;
}

.correlation-label {
    font-weight: 600;
    font-size: 0.9em;
    color: var(--text);
    text-align: right;
}

/* Tooltip */

.correlation-tooltip {
    position: absolute;
    background: var(--bg-primary);
    border: 2px solid var(--primary);
    border-radius: 8px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    pointer-events: none;
    display: none;
    min-width: 200px;
}

.tooltip-header {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    font-size: 0.95em;
}

.tooltip-value {
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 6px;
    font-size: 1.1em;
}

.tooltip-interpretation {
    font-size: 0.85em;
    color: var(--text-secondary);
    line-height: 1.4;
}

.heatmap-info {
    margin-top: 20px;
    padding: 15px 20px;
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.heatmap-info p {
    margin: 0 0 10px 0;
    color: var(--text);
    font-weight: 600;
    font-size: 0.95em;
}

.heatmap-info ul {
    margin: 0;
    padding-left: 20px;
    color: var(--text-secondary);
}

.heatmap-info li {
    margin-bottom: 6px;
    font-size: 0.9em;
    line-height: 1.5;
}

/* ============================================================================
   TRADE JOURNAL & AI ANALYTICS (Feature #5)
   ============================================================================ */

.journal-panel {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.journal-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.time-selector {
    padding: 8px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.9em;
    cursor: pointer;
}

.time-selector:hover {
    border-color: var(--primary);
}

.btn-refresh {
    padding: 8px 16px;
    background: var(--primary);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
    transition: background 0.2s;
}

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

.journal-content {
    margin-top: 20px;
}

.performance-section,
.insights-section,
.history-section {
    margin-bottom: 30px;
    background: var(--bg-primary);
    border-radius: 10px;
    padding: 20px;
}

.performance-section h3,
.insights-section h3,
.history-section h3 {
    margin: 0 0 20px 0;
    color: var(--text);
    font-size: 1.3em;
}

/* Performance Metrics */
.best-worst-section {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.trade-highlight {
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.trade-highlight.best {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.trade-highlight.worst {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.trade-highlight .icon {
    font-size: 1.8em;
}

.trade-highlight strong {
    color: var(--text);
}

.trade-highlight .gain {
    color: var(--success);
    font-weight: 600;
}

.trade-highlight .loss {
    color: var(--danger);
    font-weight: 600;
}

/* AI Insights */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.insights-column h4,
.recommendations-column h4 {
    margin: 0 0 15px 0;
    color: var(--primary);
    font-size: 1.1em;
}

.insight-card,
.recommendation-card {
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border-left: 3px solid var(--primary);
    transition: transform 0.2s, box-shadow 0.2s;
}

.insight-card:hover,
.recommendation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.insight-card .icon,
.recommendation-card .icon {
    font-size: 1.3em;
    flex-shrink: 0;
}

.insight-card p,
.recommendation-card p {
    margin: 0;
    color: var(--text);
    font-size: 0.95em;
    line-height: 1.5;
}

/* Trade History */
.history-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.summary-stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.summary-stat .label {
    color: var(--text-secondary);
    font-size: 0.85em;
}

.summary-stat .value {
    color: var(--text);
    font-size: 1.2em;
    font-weight: 600;
}

.summary-stat .value.buy {
    color: var(--success);
}

.summary-stat .value.sell {
    color: var(--danger);
}

.trades-table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
}

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

.trades-table thead {
    background: var(--bg-tertiary);
}

.trades-table th {
    padding: 12px;
    text-align: left;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trades-table td {
    padding: 12px;
    color: var(--text);
    border-top: 1px solid var(--border);
}

.trade-row.buy {
    background: rgba(16, 185, 129, 0.03);
}

.trade-row.sell {
    background: rgba(239, 68, 68, 0.03);
}

.trade-row:hover {
    background: var(--bg-secondary);
}

.trades-footer {
    margin-top: 15px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* Color Classes */
.positive {
    color: var(--success) !important;
}

.negative {
    color: var(--danger) !important;
}

.good {
    color: var(--success);
}

.moderate {
    color: var(--warning);
}

.poor {
    color: var(--danger);
}

/* Empty and Error States */
.empty-state,
.error-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state .icon,
.error-state .icon {
    font-size: 2.5em;
    display: block;
    margin-bottom: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .insights-grid {
        grid-template-columns: 1fr;
    }
    
    .best-worst-section {
        grid-template-columns: 1fr;
    }
    
    .history-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .trades-table {
        font-size: 0.85em;
    }
    
    .trades-table th,
    .trades-table td {
        padding: 8px;
    }
}
/* =============================================================================
   Volatile Stocks Scanner Styles
   ============================================================================= */

.stocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.stock-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.stock-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    gap: 8px;
}

.stock-symbol {
    font-size: 15px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.stock-name {
    font-size: 10px;
    color: var(--text-secondary);
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

.stock-price {
    text-align: right;
    flex-shrink: 0;
}

.price-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
}

.price-change {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

.price-change.positive {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.price-change.negative {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.metric-highlight {
    background: var(--bg-secondary);
    padding: 6px 8px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 11px;
    color: var(--text-secondary);
}

.metric-highlight strong {
    color: var(--text-primary);
    font-size: 13px;
}

.metric-highlight.positive strong {
    color: var(--success);
}

.metric-highlight.negative strong {
    color: var(--danger);
}

.stock-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 8px;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    padding: 3px 0;
    gap: 4px;
}

.metric-label {
    color: var(--text-secondary);
    flex-shrink: 0;
}

.metric-value {
    color: var(--text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
}

.stock-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.stock-action-btn {
    flex: 1;
    padding: 6px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.stock-action-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* Toast Notifications */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}