/* === Utility Classes for Inline Styles moved from index.html === */
.api-live-notice {
    margin: 10px 0;
    padding: 10px;
    background: #2a2a3e;
    border-radius: 5px;
    border-left: 3px solid #ffaa00;
}
.controls-actions {
    display: flex;
    gap: 10px;
}
.btn-orange {
    background: linear-gradient(135deg, #ff9800, #f57c00) !important;
}
.mb-10 {
    margin-bottom: 10px;
}
.bg-bullish-candle {
    background: rgba(0, 255, 136, 0.8);
}
.bg-bearish-candle {
    background: rgba(255, 107, 107, 0.8);
}
.bg-bullish-ob {
    background: rgba(0, 255, 136, 0.7);
}
.bg-bearish-ob {
    background: rgba(255, 107, 107, 0.7);
}
.bg-bullish-fvg {
    background: rgba(0, 212, 170, 0.5);
}
.bg-bearish-fvg {
    background: rgba(255, 170, 0, 0.5);
}
.bg-support {
    background: #00d4aa;
}
.bg-resistance {
    background: #ff9800;
}
.bg-breaker {
    background: #9c27b0;
}
.bg-entry {
    background: #00ff88;
}
.bg-stop {
    background: #ff4444;
}
.bg-take-profit {
    background: #ffaa00;
}
.d-none {
    display: none !important;
}
.fs-24 {
    font-size: 24px;
}
.fs-20 {
    font-size: 20px;
}
.fs-18 {
    font-size: 18px;
}
.fw-bold {
    font-weight: bold;
}
/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0f0f0f;
    color: #ffffff;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ===== CONTAINER & LAYOUT - MOBILE FIRST ===== */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 15px; /* Adjust padding for smaller screens */
}

.main-layout {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
}

.chart-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    order: 1; /* Chart at the top on mobile */
}

.analysis-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
    order: 2; /* Analysis content below the chart on mobile */
}

/* Make all sections full width on small screens */
.api-setup,
.controls,
.session-info,
.price-display,
.chart-container,
.chart-controls,
.legend,
.trade-setup-card,
.trade-bias,
.indicators-panel,
.smc-analysis,
.key-levels {
    width: 100%;
}

/* ===== HEADER SECTION ===== */
.header {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 15px;
    border: 1px solid #333;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.header h1 {
    font-size: 1.8rem; /* Smaller font size for mobile */
    background: linear-gradient(135deg, #00d4aa, #007a6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.header p {
    color: #888;
    font-size: 0.9rem; /* Smaller font for mobile */
}

/* ===== API SETUP ===== */
.api-setup {
    background: #1a1a2e;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid #333;
}

.api-setup h3 {
    margin-bottom: 15px;
    color: #00d4aa;
}

.api-setup input {
    width: 100%;
    padding: 12px;
    background: #2a2a3e;
    border: 1px solid #444;
    border-radius: 8px;
    color: white;
    margin-bottom: 15px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.api-setup input:focus {
    outline: none;
    border-color: #00d4aa;
    box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.2);
}

/* ===== BUTTONS ===== */
.btn {
    background: linear-gradient(135deg, #00d4aa, #007a6b);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 170, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: linear-gradient(135deg, #666, #444) !important;
    border: 1px solid #777;
    font-size: 12px;
    padding: 8px 16px;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #777, #555) !important;
    transform: translateY(-1px);
}

/* ===== CONTROLS SECTION ===== */
.controls {
    background: #1a1a2e;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #333;
    margin-bottom: 15px;
}

.controls h3 {
    margin-bottom: 15px;
    color: #00d4aa;
}

.controls-grid {
    display: grid;
    grid-template-columns: 1fr; /* Stack on mobile */
    gap: 15px;
    margin-top: 15px;
}

.controls-grid label {
    display: block;
    margin-bottom: 5px;
    color: #ccc;
    font-weight: 500;
}

select {
    background: #2a2a3e;
    border: 1px solid #444;
    border-radius: 8px;
    color: white;
    padding: 12px;
    width: 100%;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

select:focus {
    outline: none;
    border-color: #00d4aa;
    box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.2);
}

/* ===== INSTRUMENT SEARCH STYLING ===== */
#instrumentSearch {
    background: #2a2a3e !important;
    border: 1px solid #444 !important;
    border-radius: 8px !important;
    color: white !important;
    font-size: 14px !important;
    transition: border-color 0.3s ease !important;
}

#instrumentSearch:focus {
    outline: none !important;
    border-color: #00d4aa !important;
    box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.2) !important;
}

#instrumentSearch::placeholder {
    color: #888 !important;
}

/* Search result feedback */
#instrumentSearch.search-has-results {
    border-color: #00d4aa !important;
    box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.2) !important;
}

#instrumentSearch.search-no-results {
    border-color: #ff6b6b !important;
    box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.2) !important;
}

/* Enhanced dropdown styling for search results */
#currencyPair[size] {
    max-height: 300px;
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#currencyPair[size] option {
    padding: 8px 12px;
    background: #2a2a3e;
    color: white;
    border-bottom: 1px solid #444;
}

#currencyPair[size] option:hover {
    background: #00d4aa !important;
    color: #000 !important;
}

#currencyPair[size] option:first-child {
    border-top: 2px solid #00d4aa;
    font-weight: bold;
    background: linear-gradient(135deg, #00d4aa, #007a6b);
    color: white;
}

#currencyPair[size] optgroup {
    background: #1a1a2e;
    color: #00d4aa;
    font-weight: bold;
    padding: 8px 12px;
    border-bottom: 1px solid #444;
}

/* Priority indicators for search results */
#currencyPair[size] option[style*="font-weight: bold"] {
    background: linear-gradient(135deg, #003d2e, #00d4aa) !important;
    color: white !important;
    border-left: 3px solid #00ff88;
}

#currencyPair[size] option[style*="font-weight: 600"] {
    background: linear-gradient(135deg, #2a2a3e, #3a3a4e) !important;
    color: #00d4aa !important;
    border-left: 2px solid #00d4aa;
}

/* ===== ENHANCED SESSION INFO ===== */
.session-info {
    background: #2a2a3e;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #444;
    transition: all 0.3s ease;
    position: relative;
}

.session-active {
    background: linear-gradient(135deg, #003d2e, #2a2a3e);
    border: 1px solid #00ff88;
    color: #00ff88;
}

.session-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.session-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #888;
    border-top: 1px solid #333;
    padding-top: 8px;
}

/* ===== ENHANCED DATA QUALITY INDICATORS ===== */
.time-sync {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 8px;
    position: relative;
}

.time-sync.excellent,
.time-sync.live {
    background: #00ff88;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
    animation: pulse-excellent 2s infinite;
}

.time-sync.good {
    background: #00d4aa;
    box-shadow: 0 0 8px rgba(0, 212, 170, 0.5);
    animation: pulse-good 2s infinite;
}

.time-sync.pending {
    background: #ffaa00;
    box-shadow: 0 0 8px rgba(255, 170, 0, 0.5);
    animation: pulse-warning 1.5s infinite;
}

.time-sync.offline {
    background: #ff6b6b;
    box-shadow: 0 0 8px rgba(255, 107, 107, 0.5);
    animation: pulse-error 1s infinite;
}

@keyframes pulse-excellent {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

@keyframes pulse-good {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.08); }
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.05); }
}

@keyframes pulse-error {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.02); }
}

/* ===== LAG INDICATORS ===== */
.lag-indicator {
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    display: inline-block;
}

.lag-indicator.live {
    background: rgba(0, 255, 136, 0.2);
    color: #00ff88;
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.lag-indicator.delayed {
    background: rgba(255, 170, 0, 0.2);
    color: #ffaa00;
    border: 1px solid rgba(255, 170, 0, 0.3);
}

.lag-indicator.offline {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

/* ===== CONNECTION QUALITY INDICATORS ===== */
.quality-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 8px;
    position: relative;
    animation: pulse-quality 2s infinite;
}

.quality-indicator.excellent {
    background: #00ff88;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.8);
    animation: pulse-excellent 2s infinite;
}

.quality-indicator.good {
    background: #00d4aa;
    box-shadow: 0 0 6px rgba(0, 212, 170, 0.6);
    animation: pulse-good 2s infinite;
}

.quality-indicator.fair {
    background: #ffaa00;
    box-shadow: 0 0 6px rgba(255, 170, 0, 0.6);
    animation: pulse-warning 1.5s infinite;
}

.quality-indicator.poor {
    background: #ff6b6b;
    box-shadow: 0 0 6px rgba(255, 107, 107, 0.6);
    animation: pulse-error 1s infinite;
}

.quality-indicator.unknown {
    background: #666;
    box-shadow: 0 0 4px rgba(102, 102, 102, 0.4);
}

.quality-indicator.offline {
    background: #333;
    box-shadow: none;
    animation: none;
}

/* ===== LAG INDICATORS ===== */
.lag-excellent {
    color: #00ff88 !important;
    font-weight: bold;
}

.lag-good {
    color: #00d4aa !important;
    font-weight: bold;
}

.lag-fair {
    color: #ffaa00 !important;
    font-weight: bold;
    animation: lag-warning 2s infinite;
}

.lag-poor {
    color: #ff6b6b !important;
    font-weight: bold;
    animation: lag-error 1s infinite;
}

.lag-offline {
    color: #666 !important;
    font-weight: bold;
    font-style: italic;
}

@keyframes lag-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes lag-error {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

/* Live data flash animation */
@keyframes liveDataPulse {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 0;
        transform: scale(1);
    }
}

/* ===== PRICE DISPLAY ===== */
.price-display {
    background: #2a2a3e;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #444;
    text-align: center;
    display: grid;
    grid-template-columns: 1fr; /* Stack on mobile */
    gap: 15px;
    transition: all 0.3s ease;
}

.price-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.price-item {
    text-align: center;
}

.price-item > div:first-child {
    font-size: 14px;
    color: #888;
    margin-bottom: 8px;
    font-weight: 500;
}

.price-value {
    font-size: 24px;
    font-weight: bold;
    color: #00d4aa;
    transition: color 0.3s ease;
}

.price-change {
    font-size: 16px;
    margin-top: 5px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.price-up { 
    color: #00ff88;
    animation: price-flash-up 0.5s ease-out;
}

.price-down { 
    color: #ff6b6b;
    animation: price-flash-down 0.5s ease-out;
}

@keyframes price-flash-up {
    0% { background: rgba(0, 255, 136, 0.3); }
    100% { background: transparent; }
}

@keyframes price-flash-down {
    0% { background: rgba(255, 107, 107, 0.3); }
    100% { background: transparent; }
}

/* ===== CHART CONTAINER ===== */
.chart-container {
    background: #1a1a2e;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #333;
    position: relative;
    height: 300px; /* Adjusted height for mobile */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.chart-container:hover {
    border-color: #00d4aa;
    box-shadow: 0 8px 32px rgba(0, 212, 170, 0.1);
}

/* ===== SMC LEVELS OVERLAY ===== */
.smc-levels-overlay {
    background: rgba(26, 26, 46, 0.95);
    border: 1px solid #444;
    border-radius: 10px;
    padding: 15px;
    max-width: 280px;
    z-index: 10;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    
    /* Initially static for mobile */
    position: static;
    margin-bottom: 15px;
}

.smc-levels-overlay:hover {
    background: rgba(26, 26, 46, 0.98);
    border-color: #00d4aa;
}

.smc-levels-overlay h4 {
    color: #00d4aa;
    font-size: 14px;
    margin-bottom: 10px;
}

.level-overlay-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
    padding: 4px 0;
    border-bottom: 1px solid #333;
    transition: all 0.2s ease;
}

.level-overlay-item:hover {
    background: rgba(0, 212, 170, 0.1);
    border-radius: 4px;
    padding: 4px 6px;
}

.level-overlay-item:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.level-overlay-item span:first-child {
    color: #ccc;
    font-weight: 500;
}

.level-overlay-item span:last-child {
    color: #00d4aa;
    font-weight: 600;
}

/* ===== CHART CONTROLS ===== */
.chart-controls {
    background: #1a1a2e;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #333;
    display: flex;
    flex-direction: column; /* Stack controls on mobile */
    gap: 10px;
    align-items: stretch;
    flex-wrap: wrap;
    transition: all 0.3s ease;
}

.chart-controls:hover {
    border-color: #444;
}

.chart-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #ccc;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 4px 8px;
    border-radius: 6px;
}

.chart-controls label:hover {
    color: #00d4aa;
    background: rgba(0, 212, 170, 0.1);
}

.chart-controls input[type="checkbox"] {
    accent-color: #00d4aa;
    cursor: pointer;
    transform: scale(1.1);
}

/* ===== LEGEND ===== */
.legend {
    background: #1a1a2e;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #333;
    display: grid;
    grid-template-columns: 1fr; /* Stack on mobile */
    gap: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #ccc;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 4px 6px;
    border-radius: 4px;
}

.legend-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.legend-color {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.legend-item:hover .legend-color {
    transform: scale(1.1);
}

/* ===== TRADE SETUP CARD ENHANCED ===== */
.trade-setup-card {
    background: linear-gradient(135deg, #2a2a3e, #1a1a2e);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid #444;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.trade-setup-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}

.trade-setup-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #00d4aa, #007a6b);
    transition: height 0.3s ease;
}

.trade-setup-card:hover::before {
    height: 6px;
}

.trade-setup-card.bullish {
    border-left: 4px solid #00ff88;
    background: linear-gradient(135deg, #1a3d2e, #2a2a3e);
}

.trade-setup-card.bearish {
    border-left: 4px solid #ff6b6b;
    background: linear-gradient(135deg, #3d1a1a, #2a2a3e);
}

.trade-setup-card h3 {
    margin-bottom: 20px;
    color: #00d4aa;
    font-size: 1.2rem;
}

.trade-setup-content {
    display: grid;
    gap: 15px;
}

.setup-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #333;
    transition: all 0.2s ease;
}

.setup-row:hover {
    background: rgba(0, 212, 170, 0.05);
    border-radius: 6px;
    padding: 12px 8px;
}

.setup-row:last-child {
    border-bottom: none;
}

.setup-label {
    color: #ccc;
    font-weight: 600;
    font-size: 14px;
}

.setup-value {
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.2s ease;
}

.setup-value.bullish {
    color: #00ff88;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
}

.setup-value.bearish {
    color: #ff6b6b;
    text-shadow: 0 0 8px rgba(255, 107, 107, 0.3);
}

.setup-value.neutral {
    color: #ffaa00;
}

.copy-btn {
    margin-top: 15px;
    width: 100%;
    background: linear-gradient(135deg, #007a6b, #00d4aa);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: linear-gradient(135deg, #00d4aa, #00ff88);
    transform: translateY(-1px);
}

.trade-summary {
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.trade-summary:hover {
    background: rgba(0, 212, 170, 0.15);
    border-color: rgba(0, 212, 170, 0.4);
}

.risk-reward {
    display: grid;
    grid-template-columns: 1fr; /* Stack on mobile */
    gap: 10px;
    text-align: center;
    margin-top: 10px;
}

.rr-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.rr-item:hover {
    background: rgba(0, 212, 170, 0.1);
    transform: translateY(-1px);
}

.rr-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
}

.rr-value {
    font-size: 14px;
    font-weight: bold;
    color: #fff;
}

/* ===== TRADE BIAS ENHANCED ===== */
.trade-bias {
    background: linear-gradient(135deg, #2a2a3e, #1a1a2e);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid #444;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.trade-bias:hover {
    transform: translateY(-2px);
}

.bias-strong-bullish {
    border-left: 5px solid #00ff88;
    background: linear-gradient(135deg, #003d2e, #1a1a2e);
}

.bias-strong-bullish::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, rgba(0, 255, 136, 0.2), transparent);
}

.bias-bullish {
    border-left: 5px solid #00d4aa;
    background: linear-gradient(135deg, #003328, #1a1a2e);
}

.bias-neutral {
    border-left: 5px solid #ffaa00;
    background: linear-gradient(135deg, #3d2e00, #1a1a2e);
}

.bias-bearish {
    border-left: 5px solid #ff6b6b;
    background: linear-gradient(135deg, #3d1e1e, #1a1a2e);
}

.bias-strong-bearish {
    border-left: 5px solid #ff4444;
    background: linear-gradient(135deg, #4d1e1e, #1a1a2e);
}

.bias-strong-bearish::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, rgba(255, 68, 68, 0.2), transparent);
}

.strength-bar {
    height: 8px;
    background: #333;
    border-radius: 4px;
    margin-top: 15px;
    overflow: hidden;
    position: relative;
}

.strength-fill {
    height: 100%;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 4px;
    position: relative;
}

.strength-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== INDICATORS PANEL ENHANCED ===== */
.indicators-panel {
    background: #1a1a2e;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #333;
    transition: all 0.3s ease;
}

.indicators-panel:hover {
    border-color: #444;
}

.indicators-panel h3 {
    margin-bottom: 15px;
    color: #00d4aa;
    font-size: 1.2rem;
}

.indicator-grid {
    display: grid;
    grid-template-columns: 1fr; /* Stack on mobile */
    gap: 15px;
}

/* Group indicators by category */
.indicator-card:nth-child(-n+4) { /* First 4: Momentum */
    border-left: 3px solid #00d4aa;
}
.indicator-card:nth-child(n+5):nth-child(-n+7) { /* Next 3: Trend */
    border-left: 3px solid #ffaa00;
}
.indicator-card:nth-child(n+8):nth-child(-n+10) { /* Next 3: Volatility */
    border-left: 3px solid #ff6b6b;
}
.indicator-card:nth-child(n+11) { /* Last 3: Moving Averages */
    border-left: 3px solid #9c27b0;
}

.indicator-card {
    background: #2a2a3e;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #444;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.indicator-card:hover {
    transform: translateY(-3px);
    border-color: #00d4aa;
    box-shadow: 0 8px 25px rgba(0, 212, 170, 0.1);
}

.indicator-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #00d4aa, #007a6b);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.indicator-card:hover::before {
    transform: scaleX(1);
}

.indicator-card h4 {
    margin-bottom: 10px;
    color: #ccc;
    font-size: 14px;
    font-weight: 600;
}

/* ===== SMC ANALYSIS ENHANCED ===== */
.smc-analysis {
    background: #1a1a2e;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #333;
    transition: all 0.3s ease;
}

.smc-analysis:hover {
    border-color: #444;
}

.smc-analysis h3 {
    margin-bottom: 15px;
    color: #00d4aa;
    font-size: 1.2rem;
}

.smc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 15px;
}

.smc-item {
    background: #2a2a3e;
    padding: 15px;
    border-radius: 10px;
    border: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
}

.smc-item:hover {
    background: #3a3a4e;
    transform: translateX(5px);
    border-color: #555;
}

.smc-active {
    border: 2px solid #00ff88;
    background: linear-gradient(135deg, #003d2e, #2a2a3e);
    box-shadow: 0 4px 15px rgba(0, 255, 136, 0.2);
}

.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.status-active { 
    background: #00ff88;
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
    animation: status-pulse 2s infinite;
}

.status-inactive { 
    background: #666;
    opacity: 0.6;
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
}

/* ===== KEY LEVELS ENHANCED ===== */
.key-levels {
    background: #1a1a2e;
    padding: 20px;
    border-radius: 15px;
    border: 1px solid #333;
    max-height: 350px;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.key-levels:hover {
    border-color: #444;
}

.key-levels h3 {
    margin-bottom: 15px;
    color: #00d4aa;
    font-size: 1.2rem;
}

.level-item {
    background: #2a2a3e;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    border: 1px solid #444;
    transition: all 0.3s ease;
    position: relative;
}

.level-item:hover {
    background: #3a3a4e;
    transform: translateX(8px);
    border-color: #00d4aa;
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.1);
}

.level-item:last-child {
    margin-bottom: 0;
}

.level-item span:first-child {
    color: #ccc;
    font-weight: 600;
}

.level-distance {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
    transition: color 0.3s ease;
}

.level-item:hover .level-distance {
    color: #00d4aa;
}

/* ===== ENHANCED NOTIFICATIONS ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    max-width: 350px;
    min-width: 250px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    background: linear-gradient(135deg, #00d4aa, #007a6b);
    border-left: 4px solid #00ff88;
}

.notification-error {
    background: linear-gradient(135deg, #ff6b6b, #d32f2f);
    border-left: 4px solid #ff4444;
}

.notification-warning {
    background: linear-gradient(135deg, #ffaa00, #f57c00);
    border-left: 4px solid #ffd54f;
}

.notification-info {
    background: linear-gradient(135deg, #007a6b, #004d4d);
    border-left: 4px solid #00d4aa;
}

/* ===== FOOTER ENHANCED ===== */
.last-update {
    text-align: center;
    color: #888;
    margin-top: 30px;
    padding: 15px;
    background: #1a1a2e;
    border-radius: 8px;
    border: 1px solid #333;
    font-size: 14px;
    transition: all 0.3s ease;
    position: relative;
}

.last-update:hover {
    background: #2a2a3e;
    color: #ccc;
}

/* ===== UTILITY CLASSES ===== */
.loading {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 20px;
    animation: loading-pulse 2s infinite;
}

@keyframes loading-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.status-excellent { color: #00ff88; }
.status-good { color: #00d4aa; }
.status-fair { color: #ffaa00; }
.status-poor { color: #ff6b6b; }

/* ===== SCROLLBAR STYLES ENHANCED ===== */
.key-levels::-webkit-scrollbar {
    width: 8px;
}

.key-levels::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 4px;
}

.key-levels::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #444, #555);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.key-levels::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #555, #666);
}


/* ===== MOBILE ENHANCEMENTS ===== */

/* Touch-friendly interactions */
@media (max-width: 767px) {
    /* Larger touch targets for mobile */
    .btn {
        min-height: 48px;
        padding: 14px 28px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .chart-controls label {
        padding: 12px 16px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .chart-controls input[type="checkbox"] {
        width: 20px;
        height: 20px;
        transform: scale(1.2);
    }

    /* Better spacing for mobile */
    .container {
        padding: 10px;
    }

    .main-layout {
        gap: 12px;
    }

    /* Compact chart height for mobile */
    .chart-container {
        height: 200px;
        padding: 10px 8px;
    }

    /* Mobile-optimized price display */
    .price-display {
        padding: 20px 10px;
        gap: 15px;
    }

    .price-item {
        padding: 12px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.05);
    }

    .price-value {
        font-size: 24px;
    }

    /* Mobile-friendly controls */
    .controls {
        padding: 20px 10px;
    }

    .controls-grid {
        gap: 15px;
    }

    /* Better mobile notifications */
    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        min-width: auto;
        padding: 12px 16px;
        font-size: 14px;
    }

    /* Mobile-optimized indicators */
    .indicator-card {
        padding: 20px 12px;
    }

    .indicator-card h4 {
        font-size: 14px;
        margin-bottom: 10px;
    }

    /* Touch-friendly dropdowns */
    select {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 14px;
        min-height: 48px;
    }

    /* Mobile search enhancements */
    #instrumentSearch {
        font-size: 16px !important;
        padding: 14px !important;
        min-height: 48px !important;
    }

    /* Better mobile scrolling experience */
    .key-levels {
        max-height: 250px;
    }

    /* Mobile-optimized trade setup */
    .trade-setup-card {
        padding: 25px 15px;
    }

    .setup-row {
        padding: 12px 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .setup-label {
        font-size: 14px;
    }

    .setup-value {
        font-size: 16px;
    }

    /* Mobile-friendly risk-reward display */
    .risk-reward {
        grid-template-columns: 1fr; /* Stack on mobile */
        gap: 10px;
    }

    .rr-item {
        padding: 10px 8px;
    }

    /* Better mobile legend */
    .legend {
        padding: 15px 10px;
        gap: 12px;
    }

    .legend-item {
        padding: 8px 12px;
        font-size: 13px;
    }

    /* Mobile-optimized SMC analysis */
    .smc-analysis {
        padding: 20px 10px;
    }

    .smc-item {
        padding: 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    /* Better mobile header */
    .header {
        padding: 20px 10px;
        margin-bottom: 15px;
    }

    .header h1 {
        font-size: 1.8rem;
    }

    /* Mobile API setup */
    .api-setup {
        padding: 20px 10px;
        margin-bottom: 15px;
    }

    .api-setup input {
        padding: 14px;
        font-size: 16px;
    }

    /* Mobile session info */
    .session-info {
        padding: 15px 10px;
        margin-bottom: 15px;
    }

    .session-row {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .session-details {
        font-size: 13px;
        padding-top: 8px;
    }

    /* Mobile indicators panel */
    .indicators-panel {
        padding: 20px 10px;
    }

    .indicator-grid {
        gap: 15px;
    }

    /* Mobile key levels */
    .key-levels {
        padding: 20px 10px;
        max-height: 350px;
    }

    .level-item {
        padding: 12px;
        margin-bottom: 10px;
    }

    /* Mobile trade bias */
    .trade-bias {
        padding: 25px 15px;
    }

    /* Better mobile scrolling experience */
    * {
        -webkit-overflow-scrolling: touch;
    }

    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
        width: 100%;
    }

    /* Hide less critical elements on very small screens */
    @media (max-width: 480px) {
        .header p {
            display: none;
        }

        .api-live-notice {
            font-size: 0.8rem;
            padding: 8px;
        }

        .legend {
            display: none; /* Hide legend on very small screens to save space */
        }

        .chart-container {
            height: 180px;
        }

        .indicator-grid {
            grid-template-columns: 1fr;
        }

        .price-display {
            grid-template-columns: 1fr;
        }

        .risk-reward {
            grid-template-columns: 1fr;
        }
    }
}

/* ===== RESPONSIVE DESIGN FOR LARGER SCREENS ===== */

/* Tablet and larger screens */
@media (min-width: 768px) {
    .main-layout {
        gap: 20px;
        flex-direction: row;
    }
    
    .analysis-panel {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
        gap: 20px;
    }

    .trade-setup-card {
        grid-column: 1 / -1; /* Make the trade setup card span both columns */
    }

    .key-levels {
        grid-column: 1 / -1; /* Make key levels span both columns */
    }
    
    .price-display {
        grid-template-columns: 1fr 1fr 1fr; /* Revert to a 3-column grid */
    }

    .controls-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .chart-controls {
        flex-direction: row;
        align-items: center;
        gap: 15px;
    }

    .legend {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .indicator-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }

    /* Better organization on tablet */
    .indicator-card {
        min-height: 120px;
    }
    
    .chart-container {
        height: 400px;
    }
    
    .smc-levels-overlay {
        position: absolute; /* Revert to absolute positioning */
        top: 20px;
        left: 20px;
    }
}

/* Desktop and larger screens */
@media (min-width: 1200px) {
    .main-layout {
        grid-template-columns: 2fr 1fr;
    }
    
    .analysis-panel {
        grid-template-columns: 1fr;
    }

    .trade-setup-card,
    .key-levels {
        grid-column: auto;
    }
    
    .chart-container {
        height: 500px;
    }
}