/* Market Pattern Recognition Application Styles */

:root {
    --text-color: #333333;
    --text-secondary: #666666;
}

[data-theme="dark"] {
    --text-color: #ffffff;
    --text-secondary: #b3b3b3;
    --button-background: #3d3d3d;
    --button-hover-background: #4d4d4d;
    --input-background: #3d3d3d;
}

/* ===== UNIVERSAL NAVIGATION STYLES ===== */
.universal-navigation {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--nav-background, #ffffff);
    border-bottom: 1px solid var(--nav-border, #e0e0e0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

[data-theme="dark"] .universal-navigation {
    background: var(--nav-background, #1e1e1e);
    border-bottom-color: var(--nav-border, #404040);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    height: 60px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 1.2em;
    color: var(--text-color, #333333);
}

.nav-applications {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-app-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color, #666666);
    transition: all 0.2s ease;
    position: relative;
}

.nav-app-link:hover {
    background: var(--hover-background, #f5f5f5);
    color: var(--text-color, #333333);
}

.nav-app-link.active {
    background: var(--primary-color, #2196F3);
    color: white;
}

.nav-app-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 2px;
    background: var(--primary-color, #2196F3);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-action-btn, .theme-btn, .help-btn, .settings-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    background: var(--button-background, #f8f9fa);
    color: var(--text-color, #333333);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 4px;
}

.quick-action-btn:hover, .theme-btn:hover, .help-btn:hover, .settings-btn:hover {
    background: var(--button-hover-background, #e9ecef);
    transform: translateY(-1px);
}

.theme-selector {
    display: flex;
    gap: 2px;
}

.theme-btn.active {
    background: var(--primary-color, #2196F3);
    color: white;
}

/* ===== APPLICATION HEADER STYLES ===== */
.app-header {
    background: linear-gradient(135deg, var(--primary-color, #2196F3) 0%, var(--secondary-color, #1976D2) 100%);
    color: white;
    padding: 24px 0;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-title h1 {
    margin: 0 0 8px 0;
    font-size: 2.2em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-icon {
    font-size: 1.1em;
}

.header-description {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1em;
    font-weight: 300;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-btn {
    padding: 10px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(10px);
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

.header-btn.primary {
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary-color, #2196F3);
    border-color: transparent;
}

.header-btn.primary:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ===== TRANSFER NOTIFICATION STYLES ===== */
.transfer-notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    background: var(--success-color, #4CAF50);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
}

.notification-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===== MAIN CONTENT STYLES ===== */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.content-section {
    background: var(--card-background, #ffffff);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.content-section:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .content-section {
    background: var(--card-background, #2d2d2d);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    background: var(--section-header-background, #f8f9fa);
}

[data-theme="dark"] .section-header {
    background: var(--section-header-background, #3d3d3d);
    border-bottom-color: var(--border-color, #555555);
}

.section-header h2 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 600;
    color: var(--text-color, #333333);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 6px;
    background: var(--button-background, #ffffff);
    color: var(--text-color, #333333);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9em;
}

.section-btn:hover {
    background: var(--button-hover-background, #f5f5f5);
    border-color: var(--primary-color, #2196F3);
}

/* ===== WATCHLIST FILTERS STYLES ===== */
.watchlist-filters {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: var(--filter-background, #f8f9fa);
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    flex-wrap: wrap;
}

[data-theme="dark"] .watchlist-filters {
    background: var(--filter-background, #3d3d3d);
    border-bottom-color: var(--border-color, #555555);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-weight: 500;
    color: var(--text-color, #666666);
    font-size: 0.9em;
    white-space: nowrap;
}

.filter-select {
    padding: 6px 12px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    background: var(--input-background, #ffffff);
    color: var(--text-color, #333333);
    font-size: 0.9em;
    min-width: 140px;
}

.filter-clear-btn {
    padding: 6px 12px;
    border: 1px solid var(--error-color, #f44336);
    border-radius: 6px;
    background: transparent;
    color: var(--error-color, #f44336);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9em;
}

.filter-clear-btn:hover {
    background: var(--error-color, #f44336);
    color: white;
}

.analysis-card.expanded {
    position: fixed;
    top: 5%;
    left: 5%;
    width: 90%;
    height: 90%;
    z-index: 10000;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.analysis-card.expanded .card-content {
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

.analysis-card.expanded .vwap-chart-container,
.analysis-card.expanded .pattern-chart-container,
.analysis-card.expanded .institutional-chart-container,
.analysis-card.expanded .trend-monster-chart-container {
    flex: 1;
    height: auto !important;
    min-height: 400px;
}

/* Expanded state for Strategy Tester and Alerts */
.analysis-card.expanded #btTradeLog,
.analysis-card.expanded #alertsDashboardList {
    flex: 1;
    height: auto !important;
    max-height: none !important;
    min-height: 200px; /* Ensure at least some height */
}

.analysis-card.expanded .strategy-config,
.analysis-card.expanded .strategy-metrics {
    flex-shrink: 0;
}

/* Backdrop for expanded card */
.card-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    backdrop-filter: blur(5px);
    display: none;
}

.card-backdrop.active {
    display: block;
}

/* ===== ENHANCED WATCHLIST STYLES ===== */
.enhanced-watchlist {
    padding: 24px;
}

.watchlist-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-color, #666666);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color, #e0e0e0);
    border-top: 3px solid var(--primary-color, #2196F3);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

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

/* ===== ANALYSIS DASHBOARD STYLES ===== */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 24px;
}

.analysis-card {
    background: var(--card-background, #ffffff);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

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

[data-theme="dark"] .analysis-card {
    background: var(--card-background, #2d2d2d);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--card-header-background, #f8f9fa);
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    flex-wrap: wrap; /* Allow wrapping */
    gap: 10px; /* Add gap for wrapped items */
}

[data-theme="dark"] .card-header {
    background: var(--card-header-background, #3d3d3d);
    border-bottom-color: var(--border-color, #555555);
}

.card-header h3 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-color, #333333);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap; /* Prevent title from breaking awkwardly */
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap; /* Allow actions to wrap if needed */
    justify-content: flex-end; /* Keep them to the right */
    flex: 1; /* Take available space */
}

.card-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-btn, .card-select {
    padding: 4px 8px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 4px;
    background: var(--input-background, #ffffff);
    color: var(--text-color, #333333);
    cursor: pointer;
    font-size: 0.85em;
}

.card-content {
    padding: 20px;
}

/* ===== PATTERN SUMMARY STYLES ===== */
.pattern-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    background: var(--summary-background, #f8f9fa);
    border-radius: 8px;
    text-align: center;
}

[data-theme="dark"] .summary-item {
    background: var(--summary-background, #3d3d3d);
}

.summary-label {
    font-size: 0.85em;
    color: var(--text-color, #666666);
    font-weight: 500;
}

.summary-value {
    font-size: 1.4em;
    font-weight: 700;
    color: var(--primary-color, #2196F3);
}

/* ===== VWAP METRICS STYLES ===== */
.vwap-metrics {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.metric-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.metric-label {
    font-size: 0.85em;
    color: var(--text-color, #666666);
    font-weight: 500;
}

.metric-value {
    font-size: 1.3em;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 6px;
}

.metric-value.above-vwap {
    background: var(--success-color, #4CAF50);
    color: white;
}

.metric-value.below-vwap {
    background: var(--error-color, #f44336);
    color: white;
}

.metric-value.vwap-breakout {
    background: var(--warning-color, #FF9800);
    color: white;
}

/* ===== INSTITUTIONAL ACTIVITY STYLES ===== */
.institutional-metrics {
    margin-bottom: 20px;
}

.activity-meter {
    margin-bottom: 16px;
}

.meter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.meter-bar {
    width: 100%;
    height: 8px;
    background: var(--meter-background, #e0e0e0);
    border-radius: 4px;
    overflow: hidden;
}

.meter-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.meter-fill.buying {
    background: linear-gradient(90deg, var(--success-color, #4CAF50), #66BB6A);
}

.meter-fill.selling {
    background: linear-gradient(90deg, var(--error-color, #f44336), #EF5350);
}

.meter-value {
    font-weight: 600;
    color: var(--primary-color, #2196F3);
}

/* ===== CHART CONTAINER STYLES ===== */
.pattern-chart-container,
.vwap-chart-container,
.institutional-chart-container {
    height: 200px;
    position: relative;
}

.pattern-chart-container canvas,
.vwap-chart-container canvas,
.institutional-chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ===== PATTERN DETAILS STYLES ===== */
.pattern-details-content {
    min-height: 200px;
}

.no-selection {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-color, #999999);
    font-style: italic;
}

/* ===== REAL-TIME PANEL STYLES ===== */
.real-time-panel {
    position: fixed;
    right: 0;
    top: 60px;
    height: calc(100vh - 60px);
    width: 320px;
    background: var(--panel-background, #ffffff);
    border-left: 1px solid var(--border-color, #e0e0e0);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.1);
    transform: translateX(280px);
    transition: transform 0.3s ease;
    z-index: 999;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.real-time-panel.open {
    transform: translateX(0);
}

[data-theme="dark"] .real-time-panel {
    background: var(--panel-background, #2d2d2d);
    border-left-color: var(--border-color, #555555);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--panel-header-background, #f8f9fa);
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

[data-theme="dark"] .panel-header {
    background: var(--panel-header-background, #3d3d3d);
    border-bottom-color: var(--border-color, #555555);
}

.panel-header h3 {
    margin: 0;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-color, #333333);
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.update-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color, #4CAF50);
}

.status-indicator.active {
    animation: pulse 2s infinite;
}

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

.panel-toggle {
    background: none;
    border: none;
    color: var(--text-color, #666666);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.panel-toggle:hover {
    background: var(--button-hover-background, #f5f5f5);
    color: var(--text-color, #333333);
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.panel-section {
    margin-bottom: 24px;
}

.panel-section h4 {
    margin: 0 0 12px 0;
    font-size: 0.95em;
    font-weight: 600;
    color: var(--text-color, #333333);
    display: flex;
    align-items: center;
    gap: 6px;
}

.live-patterns, .market-alerts, .recent-activity {
    background: var(--section-background, #f8f9fa);
    border-radius: 8px;
    padding: 12px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .live-patterns,
[data-theme="dark"] .market-alerts,
[data-theme="dark"] .recent-activity {
    background: var(--section-background, #3d3d3d);
}

.no-alerts, .no-activity {
    color: var(--text-color, #999999);
    font-style: italic;
    font-size: 0.9em;
}

/* ===== MODAL STYLES ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    z-index: 1002;
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--modal-background, #ffffff);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease;
}

[data-theme="dark"] .modal-content {
    background: var(--modal-background, #2d2d2d);
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: var(--modal-header-background, #f8f9fa);
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

[data-theme="dark"] .modal-header {
    background: var(--modal-header-background, #3d3d3d);
    border-bottom-color: var(--border-color, #555555);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
    color: var(--text-color, #333333);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-color, #666666);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 1.2em;
}

.modal-close:hover {
    background: var(--button-hover-background, #f5f5f5);
    color: var(--text-color, #333333);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* ===== FORM STYLES ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--text-color, #333333);
}

.form-input, .form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    background: var(--input-background, #ffffff);
    color: var(--text-color, #333333);
    font-size: 1em;
    transition: border-color 0.2s ease;
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary-color, #2196F3);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

[data-theme="dark"] .form-input, 
[data-theme="dark"] .form-select {
    background-color: var(--card-bg, #343a40);
    color: var(--text-primary, #f8f9fa);
    border-color: var(--border-color, #495057);
}

[data-theme="dark"] .form-input:focus, 
[data-theme="dark"] .form-select:focus {
    border-color: var(--primary-color, #0d6efd);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color, #e0e0e0);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn.primary {
    background: var(--primary-color, #2196F3);
    color: white;
}

.btn.primary:hover {
    background: var(--primary-hover, #1976D2);
    transform: translateY(-1px);
}

.btn.secondary {
    background: var(--button-background, #f8f9fa);
    color: var(--text-color, #333333);
    border: 1px solid var(--border-color, #ddd);
}

.btn.secondary:hover {
    background: var(--button-hover-background, #e9ecef);
}

/* ===== LOADING OVERLAY STYLES ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1003;
    backdrop-filter: blur(4px);
}

.loading-content {
    background: var(--modal-background, #ffffff);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .loading-content {
    background: var(--modal-background, #2d2d2d);
}

.loading-spinner.large {
    width: 60px;
    height: 60px;
    border-width: 4px;
    margin-bottom: 20px;
}

.loading-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--text-color, #333333);
}

.loading-icon {
    font-size: 1.5em;
}

.loading-message {
    font-size: 1.1em;
    font-weight: 500;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 10px;
    }
    
    .nav-app-link .app-name {
        display: none;
    }
    
    .quick-action-btn, .header-btn {
        padding: 6px 8px;
        font-size: 0.85em;
    }
    
    .header-container {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .header-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .analysis-grid {
        grid-template-columns: 1fr;
        padding: 16px;
    }
    
    .watchlist-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .real-time-panel {
        width: 100%;
        transform: translateY(100%);
    }
    
    .real-time-panel.open {
        transform: translateY(0);
    }
    
    .modal-content {
        width: 95%;
        margin: 10px;
    }
}

@media (max-width: 480px) {
    .nav-applications {
        flex-wrap: wrap;
        gap: 2px;
    }
    
    .nav-app-link {
        padding: 6px 8px;
        font-size: 0.85em;
    }
    
    .header-title h1 {
        font-size: 1.6em;
    }
    
    .header-description {
        font-size: 0.95em;
    }
    
    .pattern-summary {
        grid-template-columns: 1fr;
    }
    
    .vwap-metrics {
        flex-direction: column;
        gap: 12px;
    }
}

/* Chart Settings Dropdown */
.chart-settings-dropdown {
    position: relative;
    display: inline-block;
    margin-right: 8px;
}

.settings-btn {
    background: transparent;
    border: 1px solid var(--border-color, #e0e0e0);
    color: var(--text-secondary, #666);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    height: 28px; /* Match other card-btns */
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .settings-btn {
    border-color: rgba(255, 255, 255, 0.1);
    color: #b3b3b3;
}

.settings-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--primary-color, #2196f3);
}

[data-theme="dark"] .settings-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.settings-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--surface-color, #ffffff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 10px;
    min-width: 200px;
    z-index: 100;
    margin-top: 5px;
    max-height: 400px;
    overflow-y: auto;
}

/* Custom Scrollbar for Settings Menu */
.settings-menu::-webkit-scrollbar {
    width: 6px;
}

.settings-menu::-webkit-scrollbar-track {
    background: transparent;
}

.settings-menu::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

[data-theme="dark"] .settings-menu::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .settings-menu {
    background: #2d2d2d;
    border-color: #404040;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.settings-menu.active {
    display: block;
}

.settings-group {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color, #eee);
}

[data-theme="dark"] .settings-group {
    border-bottom-color: #404040;
}

.settings-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.settings-group h4 {
    margin: 0 0 8px 0;
    font-size: 0.85em;
    text-transform: uppercase;
    color: var(--text-secondary, #666);
    letter-spacing: 0.5px;
}

[data-theme="dark"] .settings-group h4 {
    color: #999;
}

.setting-item {
    display: flex;
    align-items: center;
    padding: 4px 0;
    cursor: pointer;
    font-size: 0.9em;
    color: var(--text-primary, #333);
}

[data-theme="dark"] .setting-item {
    color: #e0e0e0;
}

.setting-item:hover {
    color: var(--primary-color, #2196f3);
}

.setting-item input {
    margin-right: 8px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--card-background, #ffffff);
    margin: 10% auto;
    padding: 20px;
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 12px;
    width: 400px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    color: var(--text-color, #333);
}

[data-theme="dark"] .modal-content {
    background-color: #1e293b;
    border-color: #334155;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    padding-bottom: 10px;
}

[data-theme="dark"] .modal-header {
    border-bottom-color: #334155;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-color, #333);
}

[data-theme="dark"] .modal-header h3 {
    color: #f1f5f9;
}

.close-modal {
    color: var(--text-secondary, #aaa);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--text-color, #000);
    text-decoration: none;
    cursor: pointer;
}

[data-theme="dark"] .close-modal:hover {
    color: #fff;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--text-secondary, #666);
}

[data-theme="dark"] .form-group label {
    color: #94a3b8;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color, #ccc);
    border-radius: 6px;
    background-color: var(--input-background, #fff);
    color: var(--text-color, #333);
    font-size: 14px;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select {
    background-color: #0f172a;
    border-color: #334155;
    color: #f1f5f9;
}

.primary-btn {
    width: 100%;
    padding: 10px;
    background-color: var(--primary-color, #2196F3);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 10px;
}

.primary-btn:hover {
    background-color: var(--primary-hover, #1976D2);
}
/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--card-bg, #ffffff);
    color: var(--text-primary, #333);
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
    border-left: 4px solid var(--primary-color, #2196F3);
}

.toast.show {
    transform: translateX(0);
}

.toast-icon {
    font-size: 1.2em;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.95em;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.85em;
    color: var(--text-secondary, #666);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary, #999);
    cursor: pointer;
    padding: 4px;
    font-size: 1.1em;
}

.toast-close:hover {
    color: var(--text-primary, #333);
}

/* Toast Types */
.toast.success { border-left-color: #4CAF50; }
.toast.success .toast-icon { color: #4CAF50; }

.toast.error { border-left-color: #F44336; }
.toast.error .toast-icon { color: #F44336; }

.toast.warning { border-left-color: #FF9800; }
.toast.warning .toast-icon { color: #FF9800; }

.toast.info { border-left-color: #2196F3; }
.toast.info .toast-icon { color: #2196F3; }

[data-theme='dark'] .toast {
    background: #333;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme='dark'] .toast-message {
    color: #ccc;
}

