/* =====================================================
   OMNIANCE - LUXURY TRADING PLATFORM DESIGN SYSTEM
   =====================================================
   Premium gold and black design system for a 
   sophisticated AI-powered trading platform
   ===================================================== */

/* Import Modern Professional Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

/* =====================================================
   CSS VARIABLES - LUXURY DESIGN TOKENS
   ===================================================== */
:root {
    /* Primary Color Palette - Luxury Dark Theme */
    --bg-primary: #0a0b14;
    --bg-secondary: #16161f;
    --bg-tertiary: #1a1a2e;
    --bg-card: #16161f;
    --bg-hover: #1f1f2e;
    
    /* Gold Accent Colors */
    --accent-gold: #d4af37;
    --accent-gold-bright: #ffc947;
    --accent-gold-dark: #b8941f;
    --accent-success: #10b981;
    --accent-danger: #ef4444;
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #6b7280;
    --text-dark: #0a0b14;
    
    /* Borders */
    --border-gold: #d4af37;
    --border-subtle: #2a2a3a;
    
    /* Shadows */
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.7);
    --shadow-gold: 0 0 20px rgba(212, 175, 55, 0.2);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;
}

/* =====================================================
   GLOBAL STYLES
   ===================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    letter-spacing: -0.01em;
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
}

p {
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
    line-height: 1.8;
}

a {
    color: var(--accent-gold);
    text-decoration: none;
    transition: color var(--transition-normal);
}

a:hover {
    color: var(--accent-gold-bright);
}

/* =====================================================
   LAYOUT COMPONENTS
   ===================================================== */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

.section {
    margin-bottom: var(--spacing-xl);
}

/* =====================================================
   HEADER STYLES
   ===================================================== */
header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-gold);
    padding: var(--spacing-md) var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
}

.header-left h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent-gold);
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.user-email {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* =====================================================
   BUTTON STYLES
   ===================================================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: inline-block;
    text-align: center;
    text-transform: uppercase;
}

.btn-primary {
    background: var(--accent-gold);
    color: var(--text-dark);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
    background: var(--accent-gold-bright);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-gold);
    border: 2px solid var(--accent-gold);
}

.btn-secondary:hover {
    background: var(--accent-gold);
    color: var(--text-dark);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.btn-logout {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
    padding: 8px 16px;
    font-size: 0.875rem;
}

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

/* =====================================================
   CARD STYLES
   ===================================================== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg), var(--shadow-gold);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    transition: all var(--transition-normal);
}

.stat-card:hover {
    border-color: var(--border-gold);
    box-shadow: var(--shadow-gold);
}

.stat-card h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--spacing-sm);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Poppins', sans-serif;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: var(--spacing-xs);
}

/* =====================================================
   STATUS INDICATORS
   ===================================================== */
.status-badge {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 8px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: pulse 2s ease-in-out infinite;
}

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

/* =====================================================
   GRID LAYOUTS
   ===================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

/* =====================================================
   P&L COLORS
   ===================================================== */
.pnl-positive {
    color: var(--accent-success);
}

.pnl-negative {
    color: var(--accent-danger);
}

/* =====================================================
   SEARCH DROPDOWN STYLES
   ===================================================== */
.search-wrapper {
    position: relative;
}

.search-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 9999 !important; /* Very high z-index for mobile */
    max-height: 500px;
    overflow-y: auto;
    overflow-x: hidden;
}

.search-dropdown.active {
    display: block !important;
}

/* Mobile-specific dropdown improvements */
.search-dropdown.mobile-active {
    position: fixed !important;
    top: 100px !important;
    left: 10px !important;
    right: 10px !important;
    max-height: calc(100vh - 120px) !important;
    z-index: 99999 !important;
}

/* Dropdown toggle button - Mobile optimized */
.dropdown-toggle-btn {
    min-width: 44px !important;
    min-height: 44px !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.dropdown-header-section {
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    padding: var(--spacing-sm);
    z-index: 10;
}

.asset-list-header {
    color: var(--accent-gold);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.asset-count {
    color: var(--text-secondary);
    font-size: 0.75rem;
    margin-top: 2px;
}

.dropdown-content {
    padding: var(--spacing-xs) 0;
}

.asset-category {
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: var(--spacing-xs);
    margin-bottom: var(--spacing-xs);
}

.asset-category:last-child {
    border-bottom: none;
}

.category-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(212, 175, 55, 0.05);
    color: var(--accent-gold);
    font-weight: 600;
    font-size: 0.85rem;
    border-left: 3px solid var(--accent-gold);
}

.category-name {
    flex: 1;
}

.category-count {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.8rem;
}

.asset-list {
    display: flex;
    flex-direction: column;
}

.asset-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm) var(--spacing-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.asset-item:hover {
    background: rgba(212, 175, 55, 0.1);
    border-left-color: var(--accent-gold);
}

.asset-item:active {
    background: rgba(212, 175, 55, 0.2);
}

.asset-symbol {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.asset-quote {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.no-results {
    padding: var(--spacing-lg);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.search-clear-btn {
    transition: all var(--transition-fast);
}

.search-clear-btn:hover {
    color: var(--accent-gold) !important;
    transform: scale(1.1);
}

/* Scrollbar styling for dropdown */
.search-dropdown::-webkit-scrollbar {
    width: 8px;
}

.search-dropdown::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.search-dropdown::-webkit-scrollbar-thumb {
    background: var(--border-gold);
    border-radius: 4px;
}

.search-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold-bright);
}

/* =====================================================
   AUTH PAGES
   ===================================================== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-tertiary) 100%);
}

.auth-container, .landing-container {
    width: 100%;
    max-width: 480px;
    padding: var(--spacing-lg);
}

.auth-card, .landing-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg), var(--shadow-gold);
}

.auth-header, .landing-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.auth-header h1, .landing-header h1 {
    color: var(--accent-gold);
    font-size: 2rem;
    margin-bottom: var(--spacing-xs);
}

.auth-header h2 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 400;
    margin-bottom: 0;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
    margin-top: var(--spacing-xs);
}

/* =====================================================
   FORM STYLES
   ===================================================== */
.auth-form {
    margin-bottom: var(--spacing-lg);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-normal);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--border-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-gold);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
}

/* =====================================================
   FEATURE CARDS
   ===================================================== */
.features {
    display: grid;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.feature {
    padding: var(--spacing-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    transition: all var(--transition-normal);
}

.feature:hover {
    border-color: var(--border-gold);
    transform: translateX(4px);
}

.feature-icon {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
    color: var(--accent-gold);
}

.feature h3 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.feature p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* =====================================================
   LANDING PAGE
   ===================================================== */
.landing-container {
    max-width: 800px;
}

.landing-card {
    padding: var(--spacing-xl) var(--spacing-lg);
}

.landing-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
}

.landing-actions .btn {
    flex: 1;
    max-width: 200px;
}

/* =====================================================
   POSITION & TRADE CARDS
   ===================================================== */
.position-card,
.trade-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    transition: all var(--transition-normal);
}

.position-card:hover,
.trade-card:hover {
    border-color: var(--border-gold);
}

.position-header,
.trade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.type-badge {
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.type-badge.buy,
.type-badge.long {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
    border: 1px solid var(--accent-success);
}

.type-badge.sell,
.type-badge.short {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-danger);
    border: 1px solid var(--accent-danger);
}

.position-details,
.trade-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--spacing-sm);
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* =====================================================
   MARKET INFO
   ===================================================== */
.market-info {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row span {
    color: var(--text-muted);
}

.info-row strong {
    color: var(--text-primary);
}

/* =====================================================
   ALERTS & MESSAGES
   ===================================================== */
.alert {
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-md);
    font-size: 0.95rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--accent-danger);
    color: var(--accent-danger);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--accent-success);
    color: var(--accent-success);
}

/* =====================================================
   EMPTY STATES
   ===================================================== */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* =====================================================
   AUTH FOOTER
   ===================================================== */
.auth-footer {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-subtle);
}

.auth-footer p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0;
}

/* =====================================================
   LOGO STYLES
   ===================================================== */
.logo-img {
    height: 40px;
    width: auto;
    vertical-align: middle;
}

.hero-logo img {
    filter: drop-shadow(0 4px 6px rgba(212, 175, 55, 0.1));
}

/* =====================================================
   MOBILE NAVIGATION
   ===================================================== */
.mobile-nav-toggle {
    display: none;
    background: transparent;
    border: 2px solid var(--accent-gold);
    color: var(--accent-gold);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    position: relative;
    z-index: 1001;
    transition: all var(--transition-normal);
}

.mobile-nav-toggle:hover {
    background: rgba(212, 175, 55, 0.1);
}

.mobile-nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--accent-gold);
    margin: 5px auto;
    transition: all var(--transition-normal);
}

.mobile-nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 2px solid var(--accent-gold);
    z-index: 1000;
    transition: left var(--transition-normal);
    overflow-y: auto;
}

.mobile-nav.active {
    left: 0;
}

.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
}

.mobile-nav-overlay.active {
    display: block;
}

/* =====================================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ===================================================== */

/* Base styles for mobile (320px and up) */
@media screen and (max-width: 1024px) {
    /* Mobile Navigation */
    .mobile-nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-nav {
        display: block;
    }
    
    /* Hide desktop navigation on mobile */
    .nav-menu,
    .nav-links {
        display: none;
    }
}

/* Mobile-specific dropdown styles */
@media screen and (max-width: 768px) {
    .search-dropdown {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: calc(100vh - 60px);
        border-radius: 0;
        border: none;
        border-top: 2px solid var(--border-gold);
    }
    
    .search-dropdown .dropdown-header-section {
        padding: var(--spacing-md);
    }
    
    .search-dropdown .asset-item {
        min-height: 44px;
        padding: var(--spacing-md);
    }
    
    .search-dropdown .asset-symbol {
        font-size: 16px;
    }
    
    .search-dropdown .asset-quote {
        font-size: 14px;
    }
    
    .search-dropdown .category-header {
        padding: var(--spacing-md);
        font-size: 14px;
    }
    
    /* Better touch feedback */
    .search-dropdown .asset-item:active {
        background: rgba(212, 175, 55, 0.3);
        transform: scale(0.98);
    }
    
    /* Search input optimizations */
    #pair-search {
        font-size: 16px !important; /* Prevent zoom on iOS */
        min-height: 44px;
    }
    
    /* Smooth scrolling for mobile */
    .search-dropdown {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
}

/* Small phones (320px - 480px) */
@media screen and (max-width: 480px) {
    :root {
        --spacing-xs: 0.25rem;
        --spacing-sm: 0.5rem;
        --spacing-md: 1rem;
        --spacing-lg: 1.5rem;
        --spacing-xl: 2rem;
    }
    
    html {
        font-size: 14px;
    }
    
    body {
        font-size: 16px;
        line-height: 1.5;
        /* CRITICAL FIX: Ensure scrolling works on small phones */
        height: auto !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        min-height: 100vh;
        /* Add padding bottom to account for fixed bottom menu */
        padding-bottom: 80px !important;
    }
    
    /* Ensure dashboard layout is scrollable on small screens */
    .dashboard-layout {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        overflow: visible !important;
        /* Add padding bottom for fixed bottom menu */
        padding-bottom: 80px !important;
    }
    
    /* Fix main content and chart height */
    .main-content {
        height: auto !important;
        overflow: visible !important;
    }
    
    .chart-container,
    #lightweight-chart-container,
    #tradingview-widget-container {
        height: 400px !important;
        min-height: 400px !important;
        max-height: 450px !important;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* Container adjustments */
    .container {
        padding: var(--spacing-sm);
    }
    
    /* Button improvements */
    .btn {
        min-height: 44px;
        padding: 12px 20px;
        font-size: 16px;
        width: 100%;
        margin-bottom: var(--spacing-sm);
    }
    
    /* Form inputs */
    .form-group input,
    .form-group select,
    .form-group textarea {
        min-height: 44px;
        font-size: 16px;
        padding: 12px;
    }
    
    /* Cards */
    .card,
    .stat-card {
        padding: var(--spacing-md);
    }
    
    /* Header adjustments */
    header {
        padding: var(--spacing-sm);
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .header-left h1 {
        font-size: 1.2rem;
    }
    
    .header-right {
        display: none;
    }
    
    /* Pricing cards */
    .pricing-grid {
        grid-template-columns: 1fr;
        padding: var(--spacing-md);
    }
    
    .pricing-card {
        padding: var(--spacing-md);
    }
    
    /* Dashboard specific */
    .dashboard-layout {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    .left-sidebar,
    .right-sidebar {
        position: static;
        width: 100%;
        border: none;
        border-top: 1px solid var(--border-subtle);
    }
    
    .main-content {
        order: -1;
        width: 100%;
    }
    
    /* CRITICAL MOBILE CHART FIXES */
    .chart-container {
        height: 400px !important;
        min-height: 400px !important;
        width: 100% !important;
        position: relative !important;
        overflow: hidden;
    }
    
    .tradingview-widget-container {
        height: 100% !important;
        width: 100% !important;
        position: relative !important;
    }
    
    #tradingview-widget {
        height: 100% !important;
        width: 100% !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
    }
}

/* Regular phones (480px - 768px) */
@media screen and (min-width: 481px) and (max-width: 768px) {
    html {
        font-size: 15px;
    }
    
    .container {
        padding: var(--spacing-md);
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    /* Two-column grid for some elements */
    .stats-grid,
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
    
    /* Dashboard adjustments */
    .dashboard-layout {
        display: flex;
        flex-direction: column;
        height: auto;
    }
    
    .header-bar {
        position: sticky;
        top: 0;
        z-index: 100;
    }
    
    /* Trading controls */
    .quick-trade-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .quick-buy-btn,
    .quick-sell-btn {
        min-height: 50px;
        font-size: 16px;
    }
    
    /* MOBILE CHART FIXES for regular phones */
    .chart-container {
        height: 450px !important;
        min-height: 450px !important;
        width: 100% !important;
        position: relative !important;
        overflow: hidden;
    }
    
    .tradingview-widget-container {
        height: 100% !important;
        width: 100% !important;
        position: relative !important;
    }
    
    #tradingview-widget {
        height: 100% !important;
        width: 100% !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
    }
}

/* Tablets (768px - 1024px) */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: var(--spacing-lg);
    }
    
    /* Dashboard layout for tablets */
    .dashboard-layout {
        grid-template-columns: 300px 1fr;
        grid-template-rows: 60px 1fr;
    }
    
    .right-sidebar {
        display: none;
    }
    
    /* Show right sidebar as modal on tablet */
    .right-sidebar.mobile-visible {
        display: block;
        position: fixed;
        right: 0;
        top: 60px;
        width: 320px;
        height: calc(100vh - 60px);
        z-index: 100;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
    }
    
    /* Stats in 3 columns */
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Pricing in 2 columns */
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile-specific utility classes */
@media screen and (max-width: 768px) {
    /* Touch-friendly spacing */
    .touch-target {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* CRITICAL FIX: Override body scrolling restrictions from dashboard.html */
    body {
        height: auto !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        min-height: 100vh;
        /* Add padding bottom to account for fixed bottom menu */
        padding-bottom: 80px !important;
    }
    
    /* Fix dashboard layout for mobile scrolling */
    .dashboard-layout {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        min-height: 100vh;
        grid-template-columns: none !important;
        grid-template-rows: none !important;
        overflow: visible !important;
        gap: 0 !important;
        /* Add padding bottom for fixed bottom menu */
        padding-bottom: 80px !important;
    }
    
    /* Fix main content area */
    .main-content {
        flex: none !important;
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
        display: block !important;
    }
    
    /* Ensure chart container has fixed height on mobile */
    .chart-container,
    #lightweight-chart-container,
    #tradingview-widget-container {
        height: 400px !important;
        min-height: 400px !important;
        max-height: 450px !important;
        overflow: hidden !important;
        position: relative !important;
    }
    
    /* Fix sidebars for mobile */
    .left-sidebar,
    .right-sidebar {
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
        position: relative !important;
        display: block !important;
    }
    
    /* Ensure header doesn't cause scroll issues */
    .header-bar {
        position: relative !important;
        width: 100% !important;
    }
    
    /* Ensure sections are scrollable */
    .trading-section,
    .tech-analysis-panel,
    .ai-coach-section,
    .pattern-tracking-section {
        height: auto !important;
        overflow: visible !important;
    }
    
    /* Fix sidebar scroll container */
    .sidebar-scroll-container {
        height: auto !important;
        overflow: visible !important;
        max-height: none !important;
    }
    
    /* Horizontal scrollable tables */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
    
    /* Stack form elements */
    .form-row {
        flex-direction: column;
    }
    
    .form-row .form-group {
        width: 100%;
    }
    
    /* Mobile-only visibility */
    .mobile-only {
        display: block !important;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    /* Collapsible sections */
    .collapsible-section {
        margin-bottom: var(--spacing-md);
    }
    
    .collapsible-header {
        background: var(--bg-secondary);
        padding: var(--spacing-md);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-sm);
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        min-height: 44px;
    }
    
    .collapsible-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition-normal);
    }
    
    .collapsible-content.active {
        max-height: 2000px;
    }
    
    /* Mobile modals */
    .modal-mobile {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-top: 2px solid var(--accent-gold);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        padding: var(--spacing-lg);
        transform: translateY(100%);
        transition: transform var(--transition-normal);
    }
    
    .modal-mobile.active {
        transform: translateY(0);
    }
    
    /* Swipeable tabs */
    .tab-container {
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        display: flex;
    }
    
    .tab-panel {
        flex: 0 0 100%;
        scroll-snap-align: start;
    }
    
    /* Mobile-optimized dropdown */
    .mobile-dropdown {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-top: 2px solid var(--accent-gold);
        max-height: 70vh;
        overflow-y: auto;
        z-index: 1000;
    }
    
    /* Asset search mobile */
    .search-wrapper {
        position: relative;
    }
    
    .search-input {
        font-size: 16px;
        min-height: 44px;
    }
    
    .search-dropdown {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-secondary);
        max-height: unset;
        border-radius: 0;
        z-index: 999;
    }
    
    /* Timeframe buttons mobile */
    .timeframe-selector {
        display: flex;
        overflow-x: auto;
        gap: var(--spacing-xs);
        padding: var(--spacing-sm) 0;
        -webkit-overflow-scrolling: touch;
    }
    
    .timeframe-btn {
        min-width: 60px;
        min-height: 44px;
        flex-shrink: 0;
    }
    
    /* Logo adjustments */
    .logo-img {
        height: 30px;
    }
    
    /* Landing page mobile */
    .hero-section {
        padding: 4rem 1rem;
        min-height: calc(100vh - 60px);
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .btn-hero {
        width: 100%;
    }
    
    /* Mobile Bottom Navigation Menu */
    .mobile-bottom-menu {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70px;
        background: linear-gradient(135deg, #16213e 0%, #1a1a2e 100%);
        border-top: 2px solid #d4af37;
        display: flex;
        justify-content: space-around;
        align-items: center;
        padding: 0 10px;
        z-index: 1000;
        box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.5);
    }
    
    .mobile-menu-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #999;
        transition: all 0.3s ease;
        padding: 5px;
        min-width: 0;
        gap: 3px;
        cursor: pointer;
    }
    
    .mobile-menu-item.active,
    .mobile-menu-item:hover {
        color: #d4af37;
    }
    
    .mobile-menu-icon {
        font-size: 20px;
        margin-bottom: 2px;
    }
    
    .mobile-menu-label {
        font-size: 10px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    
    /* Adjust header stats for mobile */
    .portfolio-stats {
        flex-wrap: wrap !important;
        gap: 10px !important;
        padding: 10px !important;
        justify-content: space-around !important;
    }
    
    .stat-item {
        min-width: 70px;
        flex: 0 1 auto;
    }
    
    .stat-value {
        font-size: 0.95rem !important;
    }
    
    .stat-label {
        font-size: 0.65rem !important;
    }
    
    /* Ensure proper spacing for content */
    .left-sidebar,
    .right-sidebar {
        margin-bottom: 80px !important;
    }
    
    .main-content {
        margin-bottom: 80px !important;
    }
}

/* Landscape mode adjustments */
@media screen and (max-width: 768px) and (orientation: landscape) {
    /* CRITICAL FIX: Enable scrolling in landscape mode */
    body {
        height: auto !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }
    
    .dashboard-layout {
        grid-template-rows: none !important;
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    /* Maintain chart height in landscape */
    .chart-container,
    #lightweight-chart-container,
    #tradingview-widget-container {
        height: 350px !important;
        min-height: 350px !important;
        max-height: 400px !important;
    }
    
    .header-bar {
        padding: var(--spacing-xs) var(--spacing-md);
    }
    
    .chart-container {
        height: 300px;
    }
}

/* High DPI screens */
@media screen and (-webkit-min-device-pixel-ratio: 2),
       screen and (min-resolution: 192dpi) {
    /* Ensure crisp borders and text */
    * {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    /* Thinner borders for retina */
    .card,
    .stat-card,
    .pricing-card {
        border-width: 0.5px;
    }
}

/* Hover states only for non-touch devices */
@media (hover: hover) and (pointer: fine) {
    .btn:hover,
    .card:hover,
    .pricing-card:hover {
        transform: translateY(-2px);
    }
}

/* Remove hover effects on touch devices */
@media (hover: none) and (pointer: coarse) {
    .btn:hover,
    .card:hover,
    .pricing-card:hover {
        transform: none;
    }
    
    /* Add active states for touch feedback */
    .btn:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
}

/* =====================================================
   PRICING PAGE STYLES
   ===================================================== */
.nav-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-gold);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
}

.nav-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent-gold);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color var(--transition-normal);
}

.nav-link:hover {
    color: var(--accent-gold);
}

.pricing-container {
    background: var(--bg-primary);
    min-height: 100vh;
}

.pricing-header {
    text-align: center;
    padding: 4rem 2rem 2rem;
    background: var(--bg-primary);
}

.pricing-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.pricing-header p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 2rem;
}

.pricing-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2rem;
    position: relative;
    transition: all var(--transition-normal);
}

.pricing-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-gold);
    box-shadow: var(--shadow-lg), var(--shadow-gold);
}

.pricing-card.featured {
    border-color: var(--border-gold);
    box-shadow: var(--shadow-gold);
}

.gold-badge {
    position: absolute;
    top: -12px;
    right: 24px;
    background: var(--accent-gold);
    color: var(--text-dark);
    padding: 4px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.plan-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.plan-price {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
}

.plan-price span {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.plan-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin-bottom: 2rem;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    color: var(--text-secondary);
}

.feature-list li::before {
    content: "✓";
    color: var(--accent-gold);
    font-weight: 700;
    font-size: 1.2rem;
}

.btn-plan {
    width: 100%;
    padding: 1rem;
    background: var(--accent-gold);
    color: var(--text-dark);
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-plan:hover {
    background: var(--accent-gold-bright);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

/* =====================================================
   CONTACT SALES PAGE
   ===================================================== */
.contact-container {
    background: var(--bg-primary);
    min-height: 100vh;
}

.contact-card {
    max-width: 800px;
    margin: 4rem auto;
    background: var(--bg-secondary);
    border: 2px solid var(--border-gold);
    border-radius: var(--radius-lg);
    padding: 3rem;
    box-shadow: var(--shadow-lg), var(--shadow-gold);
}

.contact-card h1 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.contact-card p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.plan-details {
    margin-bottom: 3rem;
}

.plan-details h3 {
    color: var(--accent-gold);
    margin-bottom: 1rem;
}

.contact-info {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
}

.contact-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.contact-method strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.contact-method a {
    color: var(--accent-gold);
    font-size: 1.1rem;
}

/* =====================================================
   STRATEGY BUILDER
   ===================================================== */
.strategy-container {
    max-width: 1200px;
    margin: 0 auto;
}

.form-section {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.form-section h3 {
    color: var(--accent-gold);
    margin-bottom: var(--spacing-md);
    font-size: 1.25rem;
}

.symbol-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--spacing-sm);
}

.symbol-checkbox {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.btn-new-strategy {
    background: var(--accent-gold);
    color: var(--text-dark);
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 24px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition-normal);
    margin-bottom: var(--spacing-lg);
}

.btn-new-strategy:hover {
    background: var(--accent-gold-bright);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.strategy-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    transition: all var(--transition-normal);
}

.strategy-card:hover {
    border-color: var(--border-gold);
}

.strategy-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
}

.strategy-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.strategy-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: var(--spacing-xs);
}

.strategy-status {
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-enabled {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
    border: 1px solid var(--accent-success);
}

.status-disabled {
    background: rgba(156, 163, 175, 0.2);
    color: var(--text-secondary);
    border: 1px solid var(--text-secondary);
}
/* ===== AI COACH CONFIGURATION STYLES ===== */
.ai-coach-widget {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05), rgba(212, 175, 55, 0.02));
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.ai-coach-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.ai-coach-title {
    color: #d4af37;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-active {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-limited {
    background: rgba(251, 146, 60, 0.2);
    color: #fb923c;
    border: 1px solid rgba(251, 146, 60, 0.3);
}

.ai-coach-config {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.config-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.api-key-input {
    flex: 1;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 6px;
    color: #fff;
    font-family: monospace;
}

.api-key-input:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.5);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.config-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #d4af37, #b8941f);
    color: #000;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.config-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.3);
}

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

.ai-coach-usage-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
}

.usage-stat {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.usage-stat span:first-child {
    color: #999;
    font-size: 0.85rem;
}

.usage-stat span:last-child {
    color: #d4af37;
    font-weight: 600;
}

/* ===== RISK/REWARD RATIO STYLES ===== */
.rr-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.rr-excellent {
    background: rgba(34, 197, 94, 0.1);
}

.rr-moderate {
    background: rgba(251, 191, 36, 0.1);
}

.rr-unfavorable {
    background: rgba(239, 68, 68, 0.1);
}

#rr-ratio {
    font-weight: 600;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

#rr-status {
    font-size: 0.85rem;
    padding: 2px 8px;
    border-radius: 12px;
}

.rr-info-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    background: rgba(212, 175, 55, 0.2);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 50%;
    color: #d4af37;
    font-size: 0.75rem;
    text-align: center;
    line-height: 16px;
    cursor: help;
    position: relative;
}

.rr-info-icon:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    white-space: nowrap;
    max-width: 250px;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

/* ===== MOBILE SEARCH AUTOCOMPLETE STYLES ===== */
#search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(13, 13, 13, 0.98);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.search-result-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.search-result-item:hover {
    background: rgba(212, 175, 55, 0.1);
}

.search-result-item:active {
    background: rgba(212, 175, 55, 0.2);
}

.search-result-item .symbol {
    color: #fff;
    font-weight: 600;
}

.search-result-item .type {
    color: #999;
    font-size: 0.85rem;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    #search-dropdown {
        max-height: 250px;
    }
    
    .search-result-item {
        padding: 14px 16px;
    }
    
    .ai-coach-widget {
        padding: 15px;
    }
    
    .config-input-group {
        flex-direction: column;
    }
    
    .api-key-input {
        width: 100%;
    }
    
    .ai-coach-usage-stats {
        grid-template-columns: 1fr;
    }
}

/* ===== AI COACH SETTINGS PAGE STYLES ===== */
.settings-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.settings-header {
    text-align: center;
    margin-bottom: 40px;
}

.settings-header h1 {
    color: #d4af37;
    font-size: 2rem;
    margin-bottom: 10px;
}

.current-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 8px;
    margin-top: 20px;
}

.setup-wizard {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.wizard-step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(212, 175, 55, 0.05);
    border-radius: 8px;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #d4af37;
    color: #000;
    border-radius: 50%;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content h3 {
    color: #d4af37;
    margin-bottom: 10px;
}

.step-content p {
    color: #ccc;
    line-height: 1.5;
}

.pricing-info {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.05));
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.pricing-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.pricing-item .value {
    color: #d4af37;
    font-size: 1.5rem;
    font-weight: bold;
    margin-top: 10px;
}

.troubleshooting {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
}

.troubleshooting h2 {
    color: #ef4444;
    margin-bottom: 20px;
}

.troubleshooting-item {
    margin-bottom: 15px;
    padding-left: 25px;
    position: relative;
}

.troubleshooting-item::before {
    content: "•";
    color: #ef4444;
    position: absolute;
    left: 10px;
}

/* =====================================================
   NEW STYLES FOR UI/UX IMPROVEMENTS
   ===================================================== */

/* Risk/Reward Ratio Tooltip */
.rr-tooltip {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 300px;
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-gold);
    border-radius: var(--radius-md);
    padding: var(--spacing-sm);
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.3s ease;
}

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

.rr-tooltip-content {
    font-size: 0.875rem;
    line-height: 1.6;
}

.rr-tooltip-content strong {
    color: var(--accent-gold);
    display: block;
    margin-bottom: 10px;
    font-size: 1rem;
}

.rr-tooltip-content p {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.rr-legend {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
}

.rr-legend div {
    padding: 4px 0;
    font-size: 0.85rem;
}

/* Risk/Reward Color Indicators */
.rr-excellent {
    color: var(--accent-success) !important;
    font-weight: 600;
}

.rr-moderate {
    color: #fbbf24 !important;
    font-weight: 600;
}

.rr-unfavorable {
    color: var(--accent-danger) !important;
    font-weight: 600;
}

/* Info Icon Styling */
.info-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    font-size: 0.75rem;
    transition: all 0.3s ease;
}

.info-icon:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--accent-gold);
    opacity: 1 !important;
}

/* Open Positions Stats Styling */
.position-stats {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Mobile Optimized Search Dropdown Items */
.search-dropdown .search-result-item {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 12px 15px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.search-dropdown .asset-item {
    min-height: 44px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

/* Mobile Touch Optimizations */
@media (max-width: 768px) {
    .rr-tooltip {
        position: fixed;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%);
        width: 90%;
        max-width: 320px;
        z-index: 9999;
    }
    
    .rr-tooltip-content {
        font-size: 0.9rem;
    }
    
    /* Add overlay when tooltip is shown on mobile */
    .rr-tooltip:before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
    
    /* Larger touch targets for mobile */
    button, .btn, select, input {
        min-height: 44px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .search-dropdown {
        max-height: 60vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .position-stats {
        font-size: 0.8rem;
    }
    
    /* Ensure Open Positions section is readable on mobile */
    .section-title {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    /* Touch feedback */
    .touch-active {
        background: rgba(212, 175, 55, 0.1) !important;
        transform: scale(0.98);
    }
}

/* Ensure dropdown items have proper hover states */
.search-result-item:hover,
.asset-item:hover {
    background: rgba(212, 175, 55, 0.15);
    cursor: pointer;
}

/* Improve scrollbar for dropdown on mobile */
.search-dropdown::-webkit-scrollbar {
    width: 8px;
}

.search-dropdown::-webkit-scrollbar-track {
    background: rgba(10, 11, 20, 0.3);
}

.search-dropdown::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.5);
    border-radius: 4px;
}

/* Close Position Button */
.close-position-btn {
    margin-top: 10px;
    padding: 10px 20px;
    background: var(--accent-danger);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all var(--transition-normal);
    width: 100%;
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.close-position-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.close-position-btn:active {
    transform: translateY(0);
    background: #b91c1c;
}

/* Additional mobile improvements */
@media (pointer: coarse) {
    /* Devices with touch screens */
    .control-input, .control-select {
        min-height: 44px;
        padding: 12px;
    }
    
    .timeframe-btn {
        min-height: 44px;
        padding: 12px 16px;
    }
    
    .close-position-btn {
        min-height: 48px;
        padding: 14px 20px;
        font-size: 1rem;
    }
}

/* Performance optimizations - Fast animations for instant feedback */
@keyframes shake-animation {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

@keyframes fast-pulse {
    0% { 
        opacity: 1; 
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.7);
    }
    50% { 
        opacity: 0.9; 
        box-shadow: 0 0 0 5px rgba(212, 175, 55, 0);
    }
    100% { 
        opacity: 1; 
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0);
    }
}

.shake-animation {
    animation: shake-animation 0.5s ease-in-out;
}

.fast-pulse {
    animation: fast-pulse 0.8s ease-in-out infinite;
}

.loading.pulse {
    animation: fast-pulse 0.6s ease-in-out infinite;
}

/* Quick trade panel executing state */
.quick-trade-panel.executing {
    transition: all 0.3s ease;
    transform: scale(1.01);
}

/* Button loading spinner */
.spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 6px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
