/**
 * mChart - Mobile Chart Styles
 * Minimal, touch-friendly design for mobile devices
 */

/* CSS Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    touch-action: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #0a0e27;
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
    user-select: none;
    -webkit-user-select: none;
}

/* Safe Area Support (notch) */
@supports (padding: env(safe-area-inset-top)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 8px 12px;
    background: #131722;
    border-bottom: 1px solid #2a2e39;
    flex-shrink: 0;
    min-height: 52px;
    gap: 8px;
}

/* Symbol Dropdown (Custom) */
.symbol-dropdown {
    position: relative;
    flex-shrink: 0;
}

.symbol-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #1e222d;
    border: 1px solid #363a45;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 10px 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
    height: 38px;
}

.symbol-dropdown-btn:hover {
    border-color: #00d4aa;
    background: #262b36;
}

.symbol-dropdown-btn:active {
    transform: scale(0.97);
}

.symbol-dropdown.open .symbol-dropdown-btn {
    border-color: #00d4aa;
    background: #262b36;
}

.symbol-current {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.symbol-arrow {
    width: 12px;
    height: 12px;
    color: #787b86;
    transition: transform 0.2s ease;
}

.symbol-dropdown.open .symbol-arrow {
    transform: rotate(180deg);
    color: #00d4aa;
}

/* Symbol Dropdown Menu */
.symbol-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: rgba(19, 23, 34, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 4px;
    min-width: 160px;
    max-height: 320px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-4px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.symbol-dropdown.open .symbol-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.symbol-dropdown-menu::-webkit-scrollbar {
    width: 4px;
}

.symbol-dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.symbol-dropdown-menu::-webkit-scrollbar-thumb {
    background: #363a45;
    border-radius: 2px;
}

.symbol-category {
    padding: 6px 10px 4px;
    font-size: 10px;
    font-weight: 700;
    color: #787b86;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.symbol-option {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.symbol-option:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.symbol-option:active {
    transform: scale(0.97);
}

.symbol-option.active {
    background: rgba(0, 212, 170, 0.15);
    color: #00d4aa;
}

.symbol-loading {
    padding: 16px;
    text-align: center;
    color: #787b86;
    font-size: 12px;
}

/* Timeframe Dropdown */
.timeframe-dropdown {
    position: relative;
    flex-shrink: 0;
}

.tf-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #1e222d;
    border: 1px solid #363a45;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 10px 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 62px;
    justify-content: center;
    height: 38px;
}

.tf-dropdown-btn:hover {
    border-color: #00d4aa;
    background: #262b36;
}

.tf-dropdown-btn:active {
    transform: scale(0.97);
}

.timeframe-dropdown.open .tf-dropdown-btn {
    border-color: #00d4aa;
    background: #262b36;
}

.tf-current {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.tf-arrow {
    width: 12px;
    height: 12px;
    color: #787b86;
    transition: transform 0.2s ease;
}

.timeframe-dropdown.open .tf-arrow {
    transform: rotate(180deg);
    color: #00d4aa;
}

/* Dropdown Menu */
.tf-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: rgba(19, 23, 34, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 4px;
    min-width: 70px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-4px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.timeframe-dropdown.open .tf-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* Option Items */
.tf-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.tf-option:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.tf-option:active {
    transform: scale(0.97);
}

.tf-option.active {
    background: rgba(0, 212, 170, 0.15);
    color: #00d4aa;
}

/* Live Button */
.live-btn {
    background: transparent;
    border: 1px solid #363a45;
    color: #787b86;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.live-btn.active {
    background: rgba(0, 212, 170, 0.15);
    border-color: #00d4aa;
    color: #00d4aa;
}

.live-btn .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.live-btn.active .dot {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Chart Container */
.chart-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #0a0e27;
}

#chart {
    width: 100%;
    height: 100%;
    display: block;
}

#chart svg {
    display: block;
}

/* Candle Colors */
.candle.bullish .body {
    fill: #26a69a;
    stroke: #26a69a;
}

.candle.bearish .body {
    fill: #ef5350;
    stroke: #ef5350;
}

.candle .wick {
    stroke-width: 1;
}

.candle.bullish .wick {
    stroke: #26a69a;
}

.candle.bearish .wick {
    stroke: #ef5350;
}

/* Live Candle */
.candle.live .body {
    stroke-width: 2;
}

.candle.live.bullish .body {
    stroke: #4caf50;
}

.candle.live.bearish .body {
    stroke: #f44336;
}

/* Axes */
.x-axis, .y-axis {
    font-size: 10px;
    fill: #787b86;
}

.x-axis path,
.x-axis line,
.y-axis path,
.y-axis line {
    stroke: #2a2e39;
}

.x-axis text,
.y-axis text {
    fill: #787b86;
}

/* Current Price Line */
.current-price-line {
    stroke: #2962ff;
    stroke-width: 1;
    stroke-dasharray: 4, 2;
}

.current-price-label {
    fill: #2962ff;
    font-size: 11px;
    font-weight: 600;
}

.current-price-bg {
    fill: #2962ff;
}

.current-price-text {
    fill: #fff;
    font-size: 11px;
    font-weight: 600;
}

/* Gap Shifter Line */
.gap-shifter-line {
    stroke: #2a2e39;
    stroke-width: 1;
    stroke-dasharray: 3, 3;
    pointer-events: none;
}

/* Crosshair */
.crosshair-line {
    stroke: #787b86;
    stroke-width: 1;
    stroke-dasharray: 4, 3;
    pointer-events: none;
}

.crosshair-label {
    font-size: 10px;
}

.crosshair-label-bg {
    fill: #363a45;
}

.crosshair-label-text {
    fill: #fff;
}

/* Crosshair price label (Y-axis) */
.crosshair-price-bg {
    fill: #363a45;
    pointer-events: none;
}

.crosshair-price-text {
    fill: #fff;
    font-size: 10px;
    font-weight: 500;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    pointer-events: none;
}

/* Crosshair time label (X-axis) */
.crosshair-time-bg {
    fill: #363a45;
    pointer-events: none;
}

.crosshair-time-text {
    fill: #fff;
    font-size: 10px;
    font-weight: 500;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
    pointer-events: none;
}

/* OHLC Info Bar */
.ohlc-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #131722;
    border-top: 1px solid #2a2e39;
    flex-shrink: 0;
    min-height: 48px;
    gap: 8px;
    flex-wrap: wrap;
}

.ohlc-info {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.ohlc-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.ohlc-label {
    color: #787b86;
    font-weight: 500;
}

.ohlc-value {
    color: #fff;
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
}

.ohlc-value.bullish {
    color: #26a69a;
}

.ohlc-value.bearish {
    color: #ef5350;
}

/* Price Change */
.price-change {
    display: flex;
    align-items: center;
    gap: 8px;
}

.change-value {
    font-size: 13px;
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
}

.change-value.positive {
    color: #26a69a;
}

.change-value.negative {
    color: #ef5350;
}

.change-percent {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.change-percent.positive {
    background: rgba(38, 166, 154, 0.2);
    color: #26a69a;
}

.change-percent.negative {
    background: rgba(239, 83, 80, 0.2);
    color: #ef5350;
}

/* Loading State */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 39, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #2a2e39;
    border-top-color: #2962ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error State */
.error-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(239, 83, 80, 0.1);
    border: 1px solid #ef5350;
    color: #ef5350;
    padding: 16px 24px;
    border-radius: 8px;
    text-align: center;
    max-width: 80%;
}

/* Tooltip */
.chart-tooltip {
    position: absolute;
    background: #1e222d;
    border: 1px solid #363a45;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    pointer-events: none;
    z-index: 50;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 140px;
}

.tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 4px;
}

.tooltip-row:last-child {
    margin-bottom: 0;
}

.tooltip-label {
    color: #787b86;
}

.tooltip-value {
    color: #fff;
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
}

/* Landscape Optimizations */
@media (orientation: landscape) {
    .header {
        padding: 6px 12px;
        min-height: 44px;
    }

    .tf-dropdown-btn {
        padding: 8px 10px;
        font-size: 12px;
        height: 34px;
    }

    .symbol-dropdown-btn {
        padding: 8px 10px;
        font-size: 13px;
        min-width: 90px;
        height: 34px;
    }

    .ohlc-bar {
        padding: 6px 12px;
        min-height: 36px;
    }

    .ohlc-item {
        font-size: 11px;
    }
}

/* Small Screen Optimizations */
@media (max-width: 380px) {
    .header {
        padding: 6px 8px;
    }

    .symbol-dropdown-btn {
        min-width: 80px;
        font-size: 13px;
        padding: 8px 8px;
    }

    .tf-dropdown-btn {
        padding: 8px 8px;
        font-size: 12px;
        min-width: 50px;
    }

    .ohlc-info {
        gap: 8px;
    }

    .ohlc-item {
        font-size: 11px;
    }
}

/* Very Small Screens */
@media (max-width: 320px) {
    .tf-btn {
        padding: 6px 6px;
        font-size: 11px;
        min-width: 28px;
    }

    .live-btn span {
        display: none;
    }
}

/* Status Bar (Connection Status) */
.status-bar {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: #787b86;
    background: rgba(19, 23, 34, 0.9);
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 10;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #787b86;
}

.status-dot.connected {
    background: #26a69a;
}

.status-dot.disconnected {
    background: #ef5350;
}

/* No Data Message */
.no-data {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #787b86;
    font-size: 14px;
    text-align: center;
}

/* Prevent text selection during pan */
.panning * {
    user-select: none !important;
    -webkit-user-select: none !important;
}

/* Hide scrollbars but allow scroll */
::-webkit-scrollbar {
    display: none;
}

/* Fullscreen Mode */
.fullscreen .header,
.fullscreen .ohlc-bar {
    display: none;
}

.fullscreen .chart-container {
    height: 100vh;
}

/* Watermark */
.watermark {
    pointer-events: none;
}

.watermark-main,
.watermark-info {
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

/* Y-Axis Touch Zone (price column) */
.y-axis-bg {
    cursor: ns-resize;
}

/* Y-Axis Shifter Line (separator) */
.y-axis-shifter {
    stroke: #363a45;
    stroke-width: 2;
    pointer-events: none;
    transition: stroke 0.15s ease, stroke-width 0.15s ease;
}

.y-axis-shifter.hover,
.y-axis-shifter.active {
    stroke: #2962ff;
    stroke-width: 3;
}

/* Shifter hit area */
.y-axis-shifter-hit {
    cursor: ew-resize;
}

/* Shifter handle (dots) */
.y-axis-shifter-handle {
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.y-axis-shifter-handle circle {
    fill: #505050;
    transition: fill 0.15s ease;
}

.y-axis-shifter-handle.hover circle,
.y-axis-shifter-handle.active circle {
    fill: #2962ff;
}

/* Dragging state */
body.shifter-dragging,
body.shifter-dragging * {
    cursor: ew-resize !important;
}

body.shifter-dragging .y-axis-shifter {
    stroke: #2962ff;
    stroke-width: 3;
}

/* X-Axis Touch Zone (time row) */
.x-axis-bg {
    cursor: ew-resize;
}

/* Axis hover highlight on desktop */
@media (hover: hover) {
    .y-axis:hover {
        opacity: 0.8;
    }

    .x-axis:hover {
        opacity: 0.8;
    }
}

/* Scaling indicator - Y axis */
.scaling-y .y-axis text {
    fill: #2962ff !important;
}

.scaling-y .y-axis line,
.scaling-y .y-axis path {
    stroke: #2962ff !important;
}

/* Scaling indicator - X axis */
.scaling-x .x-axis text {
    fill: #2962ff !important;
}

.scaling-x .x-axis line,
.scaling-x .x-axis path {
    stroke: #2962ff !important;
}

/* Touch feedback overlay */
.touch-feedback {
    position: absolute;
    pointer-events: none;
    z-index: 99;
    background: rgba(41, 98, 255, 0.1);
    border: 1px solid rgba(41, 98, 255, 0.3);
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.touch-feedback.active {
    opacity: 1;
}

/* Scale hint text */
.scale-hint {
    position: absolute;
    font-size: 10px;
    color: #2962ff;
    background: rgba(19, 23, 34, 0.95);
    padding: 4px 8px;
    border-radius: 4px;
    pointer-events: none;
    z-index: 100;
    white-space: nowrap;
}

.scale-hint.y-hint {
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
}

.scale-hint.x-hint {
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
}

/* Gesture instructions (shown briefly on first load) */
.gesture-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(19, 23, 34, 0.95);
    border: 1px solid #363a45;
    border-radius: 8px;
    padding: 16px 24px;
    text-align: center;
    z-index: 200;
    max-width: 280px;
    animation: fadeInOut 4s ease forwards;
}

.gesture-hint h4 {
    color: #fff;
    font-size: 14px;
    margin-bottom: 12px;
}

.gesture-hint ul {
    list-style: none;
    text-align: left;
    font-size: 12px;
    color: #a0a0a0;
}

.gesture-hint li {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gesture-hint li::before {
    content: '•';
    color: #2962ff;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    10% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    80% { opacity: 1; }
    100% { opacity: 0; pointer-events: none; }
}

/* Reset feedback */
.reset-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(41, 98, 255, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    z-index: 100;
    pointer-events: none;
}

/* Active scaling state on body */
body.scaling-y,
body.scaling-y * {
    cursor: ns-resize !important;
}

body.scaling-x,
body.scaling-x * {
    cursor: ew-resize !important;
}

/* ==========================================
   Context Menu
   ========================================== */
.chart-context-menu {
    display: none;
    position: fixed;
    background: #1e222d;
    border: 1px solid #363a45;
    border-radius: 12px;
    padding: 8px;
    min-width: 180px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    animation: contextMenuIn 0.15s ease;
}

@keyframes contextMenuIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    color: #e0e0e0;
    font-size: 14px;
}

.context-menu-item:active {
    background: rgba(41, 98, 255, 0.2);
}

.context-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.context-menu-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #787b86;
}

.context-menu-divider {
    height: 1px;
    background: #363a45;
    margin: 8px 0;
}

/* ==========================================
   Settings Modal
   ========================================== */
.chart-settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.chart-settings-modal.visible {
    display: flex;
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.settings-modal-content {
    background: #131722;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.2s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #2a2e39;
}

.settings-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.settings-close-btn {
    background: none;
    border: none;
    color: #787b86;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.15s ease;
}

.settings-close-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.settings-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.settings-section {
    margin-bottom: 24px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h4 {
    margin: 0 0 16px;
    font-size: 14px;
    font-weight: 600;
    color: #787b86;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #2a2e39;
}

.settings-row:last-child {
    border-bottom: none;
}

.settings-row label:first-child {
    color: #e0e0e0;
    font-size: 14px;
}

.settings-row input[type="color"] {
    -webkit-appearance: none;
    width: 40px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: transparent;
}

.settings-row input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.settings-row input[type="color"]::-webkit-color-swatch {
    border: 2px solid #363a45;
    border-radius: 4px;
}

.settings-row select {
    background: #1e222d;
    border: 1px solid #363a45;
    border-radius: 6px;
    color: #fff;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    min-width: 100px;
}

.settings-row select:focus {
    outline: none;
    border-color: #2962ff;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #363a45;
    transition: 0.2s;
    border-radius: 28px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: 0.2s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2962ff;
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Theme Presets */
.theme-presets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.theme-preset {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: #1e222d;
    border: 1px solid #363a45;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.theme-preset:active {
    background: rgba(41, 98, 255, 0.15);
    border-color: #2962ff;
}

.theme-preset:hover {
    border-color: #505050;
}

.preset-colors {
    display: flex;
    gap: 4px;
}

.preset-colors span {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

.theme-preset span:last-child {
    font-size: 12px;
    color: #a0a0a0;
}

/* Settings Footer */
.settings-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #2a2e39;
}

.settings-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.settings-btn-reset {
    background: #1e222d;
    color: #787b86;
    border: 1px solid #363a45;
}

.settings-btn-reset:hover {
    background: #2a2e39;
    color: #fff;
}

.settings-btn-save {
    background: #2962ff;
    color: #fff;
}

.settings-btn-save:hover {
    background: #1e4fd8;
}

.settings-btn-save:active {
    transform: scale(0.98);
}

/* ==========================================
   Chart Feedback
   ========================================== */
.chart-feedback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(41, 98, 255, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    z-index: 100;
    pointer-events: none;
    animation: feedbackFade 0.8s ease forwards;
}

@keyframes feedbackFade {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    15% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    70% { opacity: 1; }
    100% { opacity: 0; }
}

/* ==========================================
   CSS Custom Properties for Theming
   ========================================== */
:root {
    --chart-bullish: #26a69a;
    --chart-bearish: #ef5350;
    --chart-bg: #0a0e27;
    --chart-grid: #2a2e39;
    --chart-text: #787b86;
    --chart-price-line: #2962ff;
}

/* Apply custom properties to candles */
.candle.bullish .body {
    fill: var(--chart-bullish);
    stroke: var(--chart-bullish);
}

.candle.bearish .body {
    fill: var(--chart-bearish);
    stroke: var(--chart-bearish);
}

.candle.bullish .wick {
    stroke: var(--chart-bullish);
}

.candle.bearish .wick {
    stroke: var(--chart-bearish);
}

.current-price-line {
    stroke: var(--chart-price-line);
}

.current-price-bg {
    fill: var(--chart-price-line);
}

/* ==========================================
   Indicator Panels
   ========================================== */
.indicator-panels {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.indicator-panel {
    display: none;
    flex-direction: column;
    height: 120px;
    min-height: 80px;
    max-height: 200px;
    background: var(--chart-bg, #0a0e27);
    border-top: 1px solid #2a2e39;
    position: relative;
    overflow: hidden;
}

.indicator-panel.visible {
    display: flex;
}

.indicator-panel.resizing {
    user-select: none;
}

/* Panel Resizer */
.panel-resizer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    cursor: ns-resize;
    touch-action: none;
    z-index: 10;
    transition: background 0.2s;
}

.panel-resizer:hover,
.panel-resizer:active {
    background: rgba(41, 98, 255, 0.5);
}

body.panel-resizing {
    cursor: ns-resize !important;
}

/* Panel Header */
.panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    font-size: 11px;
    background: rgba(19, 23, 34, 0.95);
    border-bottom: 1px solid #2a2e39;
    flex-shrink: 0;
    min-height: 28px;
}

.panel-title {
    font-weight: 600;
    color: #e0e0e0;
}

.panel-params {
    color: #787b86;
    font-size: 10px;
}

.panel-value {
    font-family: 'Courier New', monospace;
    font-size: 10px;
    margin-left: auto;
}

.panel-value.neutral {
    color: #787b86;
}

.panel-value.overbought {
    color: #ef5350;
}

.panel-value.oversold {
    color: #26a69a;
}

#rsiPanel .panel-value {
    color: #2962ff;
}

#macdPanel .macd-line {
    color: #2962ff;
}

#macdPanel .signal-line {
    color: #ff9800;
    margin-left: 8px;
}

#macdPanel .histogram {
    margin-left: 8px;
}

/* Panel Buttons */
.panel-settings,
.panel-close {
    background: transparent;
    border: none;
    color: #787b86;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.panel-settings:hover,
.panel-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0;
}

.panel-close {
    font-size: 18px;
    font-weight: 300;
    line-height: 1;
}

/* Panel Chart Area */
.panel-chart {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.panel-chart svg {
    display: block;
}

/* RSI Y-axis */
.rsi-y-axis path.domain {
    display: none;
}

/* MACD Y-axis */
.macd-y-axis path.domain {
    display: none;
}

/* ==========================================
   Indicator Settings Modal
   ========================================== */
.indicator-settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: flex-end;
}

.indicator-settings-modal.visible {
    display: flex;
}

.indicator-modal-content {
    width: 100%;
    max-width: 420px;
    max-height: 85vh;
    background: #131722;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.indicator-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #2a2e39;
    flex-shrink: 0;
}

.indicator-modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.indicator-modal-close {
    background: transparent;
    border: none;
    color: #787b86;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.indicator-modal-close:hover {
    color: #fff;
}

.indicator-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

/* Indicator Sections */
.indicator-section {
    background: #1e222d;
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
}

.indicator-section:last-child {
    margin-bottom: 0;
}

.indicator-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
}

.indicator-section-header h4 {
    font-size: 15px;
    font-weight: 600;
    color: #e0e0e0;
}

.indicator-params {
    padding: 0 16px 16px;
}

.param-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(42, 46, 57, 0.5);
}

.param-row:last-child {
    border-bottom: none;
}

.param-row label {
    font-size: 13px;
    color: #a0a0a0;
}

.param-row input[type="number"] {
    width: 70px;
    padding: 8px 10px;
    background: #131722;
    border: 1px solid #363a45;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    text-align: center;
}

.param-row input[type="number"]:focus {
    border-color: #2962ff;
    outline: none;
}

.param-row input[type="color"] {
    width: 40px;
    height: 32px;
    padding: 2px;
    background: #131722;
    border: 1px solid #363a45;
    border-radius: 6px;
    cursor: pointer;
}

/* Indicator Modal Footer */
.indicator-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #2a2e39;
}

.indicator-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.indicator-btn-reset {
    background: #1e222d;
    color: #787b86;
    border: 1px solid #363a45;
}

.indicator-btn-reset:hover {
    background: #2a2e39;
    color: #fff;
}

.indicator-btn-save {
    background: #2962ff;
    color: #fff;
}

.indicator-btn-save:hover {
    background: #1e4fd8;
}

/* ==========================================
   Context Menu Checkable Items
   ========================================== */
.context-menu-checkable {
    padding-left: 32px !important;
    position: relative;
}

.context-menu-checkable .menu-check {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border: 2px solid #505050;
    border-radius: 3px;
    transition: all 0.15s ease;
}

.context-menu-checkable.checked .menu-check {
    background: #2962ff;
    border-color: #2962ff;
}

.context-menu-checkable.checked .menu-check::after {
    content: '';
    position: absolute;
    left: 3px;
    top: 0;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ==========================================
   Bollinger Bands Styles
   ========================================== */
.bb-fill {
    pointer-events: none;
}

.bb-upper,
.bb-middle,
.bb-lower {
    pointer-events: none;
}

/* ==========================================
   Access Required Modal
   ========================================== */
.access-required-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.access-modal-content {
    background: #131722;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    max-width: 320px;
    width: 90%;
    animation: scaleIn 0.25s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.access-modal-icon {
    margin-bottom: 20px;
    color: #2962ff;
}

.access-modal-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 12px;
}

.access-modal-content p {
    font-size: 14px;
    color: #787b86;
    margin-bottom: 24px;
    line-height: 1.5;
}

.access-modal-buttons {
    display: flex;
    gap: 12px;
}

.access-btn-secondary,
.access-btn-primary {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.access-btn-secondary {
    background: #1e222d;
    color: #787b86;
    border: 1px solid #363a45;
}

.access-btn-secondary:hover {
    background: #2a2e39;
    color: #fff;
}

.access-btn-primary {
    background: #2962ff;
    color: #fff;
}

.access-btn-primary:hover {
    background: #1e4fd8;
}

/* ==========================================
   SIGNAL STRIP - Real-time Indicator Signals
   ========================================== */

.signal-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    background: #0d1117;
    border-top: 1px solid #2a2e39;
    flex-shrink: 0;
    min-height: 44px;
    gap: 8px;
}

/* Signal Pills Container - horizontally scrollable */
.signal-pills {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    flex: 1;
    padding: 2px 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.signal-pills::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

/* Individual Signal Pill */
.signal-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.signal-pill:active {
    transform: scale(0.95);
}

/* Signal Pill Variants */
.signal-pill.oversold {
    background: rgba(38, 166, 154, 0.2);
    color: #26a69a;
    border: 1px solid rgba(38, 166, 154, 0.4);
}

.signal-pill.overbought {
    background: rgba(239, 83, 80, 0.2);
    color: #ef5350;
    border: 1px solid rgba(239, 83, 80, 0.4);
}

.signal-pill.bullish {
    background: rgba(38, 166, 154, 0.15);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.signal-pill.bearish {
    background: rgba(239, 83, 80, 0.15);
    color: #ff5252;
    border: 1px solid rgba(255, 82, 82, 0.3);
}

.signal-pill.divergence {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.4);
}

.signal-pill.neutral {
    background: rgba(120, 123, 134, 0.15);
    color: #787b86;
    border: 1px solid rgba(120, 123, 134, 0.3);
}

/* Signal pill icon */
.signal-pill .pill-icon {
    font-size: 10px;
}

/* Signal Actions */
.signal-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Signal Score Button */
.signal-score-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 8px;
    border: none;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    background: #1e222d;
    color: #787b86;
}

.signal-score-btn .score-value {
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 13px;
    font-weight: 700;
}

.signal-score-btn .score-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Score Button States */
.signal-score-btn.strong-buy {
    background: linear-gradient(135deg, #26a69a 0%, #4caf50 100%);
    color: #fff;
}

.signal-score-btn.buy {
    background: rgba(38, 166, 154, 0.2);
    color: #26a69a;
    border: 1px solid rgba(38, 166, 154, 0.4);
}

.signal-score-btn.neutral {
    background: #1e222d;
    color: #787b86;
    border: 1px solid #363a45;
}

.signal-score-btn.sell {
    background: rgba(239, 83, 80, 0.2);
    color: #ef5350;
    border: 1px solid rgba(239, 83, 80, 0.4);
}

.signal-score-btn.strong-sell {
    background: linear-gradient(135deg, #ef5350 0%, #d32f2f 100%);
    color: #fff;
}

/* Compact watchlist button in signal strip */
.signal-strip .watchlist-btn {
    padding: 6px 10px;
    font-size: 11px;
}

.signal-strip .watchlist-btn svg {
    width: 14px;
    height: 14px;
}

/* No signals state */
.signal-pills-empty {
    color: #787b86;
    font-size: 11px;
    font-style: italic;
    padding: 4px 0;
}

/* ==========================================
   WATCHLIST FEATURE STYLES
   ========================================== */

/* Watchlist Button in Footer */
.watchlist-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #1e222d;
    border: 1px solid #363a45;
    border-radius: 6px;
    color: #787b86;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.watchlist-btn:hover,
.watchlist-btn:active {
    background: #2a2e39;
    color: #00d4aa;
    border-color: #00d4aa;
}

.watchlist-btn svg {
    flex-shrink: 0;
}

/* Watchlist Overlay */
.watchlist-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.watchlist-overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* Watchlist Slide-Up Menu */
.watchlist-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #131722;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    z-index: 1001;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.watchlist-menu.visible {
    transform: translateY(0);
}

.watchlist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #2a2e39;
    flex-shrink: 0;
}

.watchlist-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.watchlist-close {
    background: none;
    border: none;
    color: #787b86;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.watchlist-close:hover {
    color: #fff;
}

.watchlist-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    min-height: 100px;
}

/* Watchlist Items */
.watchlist-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.watchlist-item:hover,
.watchlist-item:active {
    background: rgba(41, 98, 255, 0.1);
}

.watchlist-item.active {
    background: rgba(0, 212, 170, 0.1);
    border-left: 3px solid #00d4aa;
}

.watchlist-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.watchlist-item-symbol {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.watchlist-item-name {
    font-size: 11px;
    color: #787b86;
}

.watchlist-item-price {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.watchlist-item-current {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.watchlist-item-change {
    font-size: 11px;
    font-weight: 500;
}

.watchlist-item-change.positive {
    color: #26a69a;
}

.watchlist-item-change.negative {
    color: #ef5350;
}

.watchlist-item-remove {
    margin-left: 12px;
    padding: 6px;
    background: none;
    border: none;
    color: #787b86;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.watchlist-item-remove:hover {
    background: rgba(239, 83, 80, 0.2);
    color: #ef5350;
}

/* Empty Watchlist State */
.watchlist-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.watchlist-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.watchlist-empty-text {
    color: #787b86;
    font-size: 14px;
    margin-bottom: 20px;
}

/* Watchlist Add Section */
.watchlist-add-section {
    padding: 12px 20px;
    border-top: 1px solid #2a2e39;
    flex-shrink: 0;
}

.watchlist-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 16px;
    background: #2962ff;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.watchlist-add-btn:hover {
    background: #1e4fd8;
}

.watchlist-add-btn:disabled {
    background: #363a45;
    color: #787b86;
    cursor: not-allowed;
}

.watchlist-limit-text {
    text-align: center;
    color: #787b86;
    font-size: 11px;
    margin-top: 8px;
}

/* Symbol Selection Modal */
.symbol-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1002;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.symbol-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.symbol-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #131722;
    border-radius: 12px;
    z-index: 1003;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.symbol-modal.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.symbol-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #2a2e39;
    flex-shrink: 0;
}

.symbol-modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.symbol-modal-close {
    background: none;
    border: none;
    color: #787b86;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.symbol-modal-close:hover {
    color: #fff;
}

.symbol-modal-search {
    padding: 12px 20px;
    flex-shrink: 0;
}

.symbol-modal-search input {
    width: 100%;
    padding: 12px 16px;
    background: #1e222d;
    border: 1px solid #363a45;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    outline: none;
}

.symbol-modal-search input:focus {
    border-color: #2962ff;
}

.symbol-modal-search input::placeholder {
    color: #787b86;
}

.symbol-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

/* Symbol List Item */
.symbol-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.symbol-list-item:hover {
    background: rgba(41, 98, 255, 0.1);
}

.symbol-list-item.in-watchlist {
    background: rgba(0, 212, 170, 0.05);
}

.symbol-list-info {
    flex: 1;
}

.symbol-list-symbol {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.symbol-list-name {
    font-size: 11px;
    color: #787b86;
    margin-top: 2px;
}

/* Switch Toggle */
.symbol-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.symbol-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.symbol-switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #363a45;
    border-radius: 24px;
    transition: all 0.3s ease;
}

.symbol-switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.symbol-switch input:checked + .symbol-switch-slider {
    background: #00d4aa;
}

.symbol-switch input:checked + .symbol-switch-slider:before {
    transform: translateX(20px);
}

/* Chart Loading Overlay */
.chart-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 39, 0.9);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.chart-loading-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.loading-symbol {
    font-size: 24px;
    font-weight: 700;
    color: #00d4aa;
}

.loading-text {
    font-size: 14px;
    color: #787b86;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #2a2e39;
    border-top-color: #00d4aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Safe Area Support for Watchlist Menu */
@supports (padding: env(safe-area-inset-bottom)) {
    .watchlist-menu {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ========================================
   Signal Detail Modal
   ======================================== */
.signal-modal-overlay,
.score-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.signal-modal-overlay.visible,
.score-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.signal-modal,
.score-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #131722;
    border-radius: 14px;
    z-index: 1101;
    width: 85%;
    max-width: 340px;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid #2a2e39;
    overflow: hidden;
}

.signal-modal.visible,
.score-modal.visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.signal-modal-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid #2a2e39;
    background: rgba(30, 34, 45, 0.6);
}

.signal-modal-icon {
    font-size: 24px;
    line-height: 1;
}

.signal-modal-header h3 {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.signal-modal-close,
.score-modal-close {
    background: none;
    border: none;
    color: #787b86;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.signal-modal-close:active,
.score-modal-close:active {
    color: #fff;
}

.signal-modal-content,
.score-modal-content {
    padding: 16px;
    overflow-y: auto;
}

/* Signal Info Rows */
.signal-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(42, 46, 57, 0.5);
}

.signal-info-row:last-child {
    border-bottom: none;
}

.signal-info-label {
    font-size: 12px;
    color: #787b86;
}

.signal-info-value {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.signal-info-value.bullish {
    color: #26a69a;
}

.signal-info-value.bearish {
    color: #ef5350;
}

.signal-info-value.neutral {
    color: #787b86;
}

/* Signal Description */
.signal-description {
    background: rgba(30, 34, 45, 0.8);
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
}

.signal-description-title {
    font-size: 11px;
    color: #787b86;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.signal-description-text {
    font-size: 13px;
    color: #b2b5be;
    line-height: 1.5;
}

/* Score Modal Header */
.score-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #2a2e39;
    background: rgba(30, 34, 45, 0.6);
}

.score-modal-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

/* Score Summary */
.score-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(30, 34, 45, 0.8) 0%, rgba(19, 23, 34, 0.9) 100%);
    border-radius: 12px;
    margin-bottom: 16px;
}

.score-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #1e222d;
    border: 3px solid currentColor;
}

.score-circle.strong-buy {
    color: #26a69a;
    border-color: #26a69a;
}

.score-circle.buy {
    color: #4caf50;
    border-color: #4caf50;
}

.score-circle.neutral {
    color: #787b86;
    border-color: #787b86;
}

.score-circle.sell {
    color: #ff9800;
    border-color: #ff9800;
}

.score-circle.strong-sell {
    color: #ef5350;
    border-color: #ef5350;
}

.score-number {
    font-size: 22px;
    font-weight: 700;
}

.score-summary-label {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.score-summary-sublabel {
    font-size: 11px;
    color: #787b86;
    margin-top: 2px;
}

/* Score Breakdown */
.score-breakdown {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.score-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(30, 34, 45, 0.5);
    border-radius: 8px;
}

.score-item-icon {
    font-size: 18px;
    width: 28px;
    text-align: center;
}

.score-item-info {
    flex: 1;
    min-width: 0;
}

.score-item-name {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
}

.score-item-value {
    font-size: 11px;
    color: #787b86;
}

.score-item-signal {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.score-item-signal.bullish {
    background: rgba(38, 166, 154, 0.2);
    color: #26a69a;
}

.score-item-signal.bearish {
    background: rgba(239, 83, 80, 0.2);
    color: #ef5350;
}

.score-item-signal.neutral {
    background: rgba(120, 123, 134, 0.2);
    color: #787b86;
}

/* Score Explanation */
.score-explanation {
    margin-top: 16px;
    padding: 12px;
    background: rgba(41, 98, 255, 0.1);
    border-radius: 8px;
    border-left: 3px solid #2962ff;
}

.score-explanation-text {
    font-size: 12px;
    color: #b2b5be;
    line-height: 1.5;
}

/* ==========================================
   Market Closed Badge
   ========================================== */
.market-closed-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 152, 0, 0.15);
    border: 1px solid rgba(255, 152, 0, 0.4);
    color: #ff9800;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    z-index: 15;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: marketClosedPulse 2s ease-in-out infinite;
}

@keyframes marketClosedPulse {
    0%, 100% { opacity: 0.9; }
    50% { opacity: 1; }
}

.market-closed-badge .badge-icon {
    font-size: 12px;
}

.market-closed-badge .badge-text {
    font-weight: 600;
    white-space: nowrap;
}

.market-closed-badge .badge-time {
    color: #ffb74d;
    font-size: 10px;
    white-space: nowrap;
}

/* Landscape adjustments */
@media (orientation: landscape) {
    .market-closed-badge {
        bottom: 8px;
        right: 8px;
        padding: 4px 8px;
        font-size: 10px;
    }
}

/* ========================================
   Alerts Bell Button
   ======================================== */
.alerts-bell-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 15;
    background: rgba(19, 23, 34, 0.9);
    border: 1px solid #363a45;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.alerts-bell-btn:hover,
.alerts-bell-btn:active {
    background: rgba(38, 166, 154, 0.2);
    border-color: #26a69a;
}

.alerts-bell-btn .bell-icon {
    color: #e0e0e0;
    transition: transform 0.3s ease;
}

.alerts-bell-btn:hover .bell-icon {
    color: #26a69a;
}

/* Bell animation when there are active alerts */
.alerts-bell-btn.has-alerts .bell-icon {
    color: #ffb74d;
    animation: bellRing 2s ease-in-out infinite;
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0); }
    5% { transform: rotate(15deg); }
    10% { transform: rotate(-15deg); }
    15% { transform: rotate(10deg); }
    20% { transform: rotate(-10deg); }
    25% { transform: rotate(5deg); }
    30% { transform: rotate(0); }
}

/* Alert badge */
.alerts-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #ef5350 0%, #e53935 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* ========================================
   Alerts Modal
   ======================================== */
.alerts-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.alerts-modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.alerts-modal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 80vh;
    background: #1e222d;
    border-radius: 16px 16px 0 0;
    z-index: 1001;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: none;
    flex-direction: column;
    visibility: hidden;
}

.alerts-modal.visible {
    display: flex;
    visibility: visible;
    transform: translateY(0);
}

.alerts-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #363a45;
    flex-shrink: 0;
}

.alerts-modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.alerts-modal-close {
    background: none;
    border: none;
    color: #787b86;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.alerts-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

/* Alerts Tabs */
.alerts-tabs {
    display: flex;
    gap: 0;
    padding: 0 16px;
    border-bottom: 1px solid #363a45;
    flex-shrink: 0;
}

.alerts-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #787b86;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.alerts-tab:hover {
    color: #e0e0e0;
}

.alerts-tab.active {
    color: #26a69a;
    border-bottom-color: #26a69a;
}

.alerts-tab svg {
    flex-shrink: 0;
}

.alerts-tab-count {
    background: rgba(38, 166, 154, 0.2);
    color: #26a69a;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

.alerts-tab.active .alerts-tab-count {
    background: #26a69a;
    color: #fff;
}

/* Alerts List Scrollable */
.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    overflow-y: auto;
    max-height: calc(80vh - 160px);
}

.alerts-history-list {
    max-height: calc(80vh - 120px);
}

/* Empty Tab State */
.alerts-empty-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.alerts-empty-tab .alerts-empty-icon {
    width: 50px;
    height: 50px;
    margin-bottom: 12px;
    background: rgba(120, 123, 134, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alerts-empty-tab .alerts-empty-icon svg {
    width: 24px;
    height: 24px;
    color: #787b86;
}

.alerts-empty-tab .alerts-empty-text {
    font-size: 14px;
    color: #787b86;
}

/* Create Alert Wrapper */
.alerts-create-wrapper {
    padding: 16px;
    overflow-y: auto;
}

.alerts-back-btn {
    background: none;
    border: none;
    color: #787b86;
    font-size: 14px;
    padding: 0 0 16px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.alerts-back-btn:hover,
.alerts-back-btn:active {
    color: #26a69a;
}

/* Triggered Alert Item */
.alert-item-triggered {
    opacity: 0.85;
    background: rgba(38, 166, 154, 0.05);
    border-color: rgba(38, 166, 154, 0.2);
}

.alert-item-triggered-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 11px;
}

.alert-item-triggered-price {
    color: #26a69a;
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.alert-item-triggered-date {
    color: #787b86;
}

.alert-item-check {
    color: #26a69a;
    flex-shrink: 0;
}

/* Alerts Loading */
.alerts-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.loading-spinner.small {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

/* Alerts List */
.alerts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.alert-item {
    background: #131722;
    border: 1px solid #363a45;
    border-radius: 10px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.alert-item-icon.above {
    background: rgba(38, 166, 154, 0.15);
    color: #26a69a;
}

.alert-item-icon.below {
    background: rgba(239, 83, 80, 0.15);
    color: #ef5350;
}

.alert-item-info {
    flex: 1;
    min-width: 0;
}

.alert-item-symbol {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.alert-item-condition {
    font-size: 12px;
    color: #787b86;
    margin-top: 2px;
}

.alert-item-delete {
    background: none;
    border: none;
    color: #787b86;
    padding: 8px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.alert-item-delete:hover,
.alert-item-delete:active {
    background: rgba(239, 83, 80, 0.15);
    color: #ef5350;
}

/* Alerts Empty State */
.alerts-empty {
    text-align: center;
    padding: 30px 20px;
}

.alerts-empty-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    background: rgba(120, 123, 134, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alerts-empty-icon svg {
    width: 28px;
    height: 28px;
    color: #787b86;
}

.alerts-empty-title {
    font-size: 15px;
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 8px;
}

.alerts-empty-text {
    font-size: 13px;
    color: #787b86;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Create Alert Form */
.alert-create-form {
    margin-top: 16px;
}

.alert-form-group {
    margin-bottom: 16px;
}

.alert-form-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #787b86;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.alert-form-row {
    display: flex;
    gap: 12px;
}

.alert-form-row .alert-form-group {
    flex: 1;
}

.alert-form-select,
.alert-form-input {
    width: 100%;
    background: #131722;
    border: 1px solid #363a45;
    border-radius: 8px;
    padding: 12px 14px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.alert-form-select:focus,
.alert-form-input:focus {
    border-color: #26a69a;
}

.alert-form-select option {
    background: #131722;
    color: #fff;
}

/* Current Price Display */
.alert-current-price {
    background: rgba(38, 166, 154, 0.1);
    border: 1px solid rgba(38, 166, 154, 0.3);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.alert-current-price-label {
    font-size: 12px;
    color: #787b86;
}

.alert-current-price-value {
    font-size: 16px;
    font-weight: 600;
    color: #26a69a;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

/* Create Alert Button */
.alert-create-btn {
    width: 100%;
    background: linear-gradient(135deg, #26a69a 0%, #00897b 100%);
    border: none;
    border-radius: 10px;
    padding: 14px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.alert-create-btn:hover,
.alert-create-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(38, 166, 154, 0.4);
}

.alert-create-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.alert-create-btn svg {
    width: 18px;
    height: 18px;
}

/* Add Alert Button (shown when there are existing alerts) */
.alerts-add-btn {
    width: 100%;
    background: transparent;
    border: 1px dashed #363a45;
    border-radius: 10px;
    padding: 14px;
    color: #787b86;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    transition: all 0.2s;
}

.alerts-add-btn:hover,
.alerts-add-btn:active {
    border-color: #26a69a;
    color: #26a69a;
    background: rgba(38, 166, 154, 0.05);
}

.alerts-add-btn svg {
    width: 16px;
    height: 16px;
}

/* Alert Success/Error Messages */
.alert-message {
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-message.success {
    background: rgba(38, 166, 154, 0.15);
    color: #26a69a;
    border: 1px solid rgba(38, 166, 154, 0.3);
}

.alert-message.error {
    background: rgba(239, 83, 80, 0.15);
    color: #ef5350;
    border: 1px solid rgba(239, 83, 80, 0.3);
}

/* ========================================
   Price Alert Triggered Notification
   ======================================== */
.price-alert-notification {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #1e222d 0%, #131722 100%);
    border-top: 2px solid #26a69a;
    border-radius: 16px 16px 0 0;
    padding: 16px 20px;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 14px;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.price-alert-notification.visible {
    transform: translateY(0);
}

.price-alert-notification-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    animation: pulseIcon 1s ease-in-out infinite;
}

.price-alert-notification-icon.above {
    background: rgba(38, 166, 154, 0.2);
    border: 1px solid rgba(38, 166, 154, 0.4);
}

.price-alert-notification-icon.below {
    background: rgba(239, 83, 80, 0.2);
    border: 1px solid rgba(239, 83, 80, 0.4);
}

@keyframes pulseIcon {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.price-alert-notification-content {
    flex: 1;
    min-width: 0;
}

.price-alert-notification-title {
    font-size: 14px;
    font-weight: 700;
    color: #ffb74d;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-alert-notification-message {
    font-size: 14px;
    color: #e0e0e0;
    margin-bottom: 4px;
}

.price-alert-notification-message strong {
    color: #fff;
}

.price-alert-notification-price {
    font-size: 12px;
    color: #787b86;
}

.price-alert-notification-price span {
    color: #26a69a;
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.price-alert-notification-close {
    background: none;
    border: none;
    color: #787b86;
    font-size: 24px;
    padding: 8px;
    cursor: pointer;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.2s;
}

.price-alert-notification-close:hover,
.price-alert-notification-close:active {
    color: #fff;
}

/* ============================================
   INDICATOR SHELF (Auto-hide Drawer)
   Professional slide-out toolbar for indicators
   ============================================ */

.indicator-shelf {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) translateX(-100%);
    z-index: 100;
    display: flex;
    align-items: stretch;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When shelf is open */
.indicator-shelf.open {
    transform: translateY(-50%) translateX(0);
}

/* Handle - always visible on edge */
.shelf-handle {
    position: absolute;
    right: -22px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 52px;
    background: rgba(19, 23, 34, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: none;
    border-radius: 0 10px 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #787b86;
    transition: all 0.2s ease;
    box-shadow: 4px 0 16px rgba(0, 0, 0, 0.4);
}

.shelf-handle svg {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.shelf-handle:hover {
    background: rgba(38, 166, 154, 0.25);
    color: #26a69a;
    width: 26px;
}

.shelf-handle:active {
    background: rgba(38, 166, 154, 0.35);
}

/* Rotate arrow when open */
.indicator-shelf.open .shelf-handle svg {
    transform: rotate(180deg);
}

/* Pulse animation for handle when indicators are active */
.shelf-handle.has-active {
    color: #26a69a;
}

.shelf-handle.has-active::before {
    content: '';
    position: absolute;
    top: 6px;
    right: 5px;
    width: 5px;
    height: 5px;
    background: #26a69a;
    border-radius: 50%;
    animation: handlePulse 2s ease-in-out infinite;
}

@keyframes handlePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(38, 166, 154, 0.5); }
    50% { opacity: 0.7; box-shadow: 0 0 0 3px rgba(38, 166, 154, 0); }
}

/* Shelf Content */
.shelf-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 8px;
    background: rgba(19, 23, 34, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: none;
    border-radius: 0 14px 14px 0;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.5),
                inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.indicator-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    border-radius: 10px;
    color: #787b86;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.indicator-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(38, 166, 154, 0.15) 0%, rgba(38, 166, 154, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 9px;
}

.indicator-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform 0.2s, color 0.2s;
}

.indicator-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin-top: 2px;
    text-transform: uppercase;
    opacity: 0.8;
}

/* Hover State */
.indicator-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e0e0e0;
    border-color: rgba(255, 255, 255, 0.1);
}

.indicator-btn:hover svg {
    transform: scale(1.1);
}

/* Active/Pressed State */
.indicator-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.08);
}

/* Enabled State */
.indicator-btn.active {
    background: rgba(38, 166, 154, 0.15);
    color: #26a69a;
    border-color: rgba(38, 166, 154, 0.3);
}

.indicator-btn.active::before {
    opacity: 1;
}

.indicator-btn.active svg {
    color: #26a69a;
    filter: drop-shadow(0 0 4px rgba(38, 166, 154, 0.4));
}

.indicator-btn.active .indicator-label {
    color: #26a69a;
    opacity: 1;
}

/* Active Indicator Pulse Animation */
.indicator-btn.active::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    background: #26a69a;
    border-radius: 50%;
    animation: indicatorPulse 2s ease-in-out infinite;
}

@keyframes indicatorPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* Toolbar Divider */
.toolbar-divider {
    width: 28px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    margin: 4px auto;
}

/* Settings Button (no label) */
.indicator-settings-btn {
    height: 36px;
}

.indicator-settings-btn svg {
    width: 18px;
    height: 18px;
}

.indicator-settings-btn .indicator-label {
    display: none;
}

/* Loading State */
.indicator-btn.loading {
    pointer-events: none;
}

.indicator-btn.loading svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Tooltip on hover (desktop) */
@media (hover: hover) {
    .indicator-btn {
        position: relative;
    }

    .indicator-btn::after {
        content: attr(title);
        position: absolute;
        left: calc(100% + 8px);
        top: 50%;
        transform: translateY(-50%);
        padding: 6px 10px;
        background: rgba(0, 0, 0, 0.9);
        color: #fff;
        font-size: 11px;
        font-weight: 500;
        white-space: nowrap;
        border-radius: 6px;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.2s, visibility 0.2s;
        z-index: 1000;
    }

    .indicator-btn:hover::after {
        opacity: 1;
        visibility: visible;
    }

    /* Hide tooltip for active indicator (has pulse dot) */
    .indicator-btn.active::after {
        content: '';
        background: #26a69a;
        padding: 0;
        width: 6px;
        height: 6px;
        left: auto;
        right: 4px;
        top: 4px;
        transform: none;
        border-radius: 50%;
        opacity: 1;
        visibility: visible;
    }
}

/* Compact mode for small screens */
@media (max-height: 500px) {
    .shelf-content {
        padding: 6px;
        gap: 2px;
    }

    .indicator-btn {
        width: 38px;
        height: 38px;
        padding: 4px;
    }

    .indicator-btn svg {
        width: 18px;
        height: 18px;
    }

    .indicator-label {
        font-size: 8px;
    }

    .toolbar-divider {
        margin: 2px auto;
    }

    .indicator-settings-btn {
        height: 32px;
    }

    .shelf-handle {
        height: 44px;
    }
}

/* Landscape mode adjustments */
@media (orientation: landscape) and (max-height: 450px) {
    .indicator-shelf {
        top: 30%;
    }

    .shelf-content {
        padding: 4px;
    }

    .indicator-btn {
        width: 36px;
        height: 36px;
    }

    .indicator-label {
        display: none;
    }

    .shelf-handle {
        height: 40px;
        width: 18px;
    }

    .shelf-handle svg {
        width: 12px;
        height: 12px;
    }
}

/* Chart container - NO padding needed since shelf auto-hides */
.chart-container {
    position: relative;
}

#chart {
    /* No left padding - shelf slides over chart when open */
    padding-left: 0;
}

/* Embed mode - smaller shelf */
.embed-mode .shelf-content {
    padding: 4px;
}

.embed-mode .indicator-btn {
    width: 32px;
    height: 32px;
}

.embed-mode .indicator-label {
    display: none;
}

.embed-mode .shelf-handle {
    width: 18px;
    height: 40px;
}

.embed-mode .shelf-handle svg {
    width: 12px;
    height: 12px;
}
