/* ========================================
   SmartVision Tech Trading Assistant - Professional Stylesheet
   ======================================== */

/* CSS Variables */
:root {
    /* Dark Theme Colors */
    --bg-primary: #0a0e27;
    --bg-secondary: #141b2d;
    --bg-card: #1e2537;
    --bg-hover: #262d40;
    
    /* Accent Colors */
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #10b981;
    --success-dark: #059669;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --warning: #f59e0b;
    --info: #06b6d4;
    
    /* Text Colors */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    /* Border Colors */
    --border-light: #2d3748;
    --border-medium: #374151;
    --border-accent: #3b82f6;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);
    
    /* Animation */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    color: var(--text-primary);
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Smooth scrolling behavior */
html {
    scroll-behavior: smooth;
}

/* Optimize scrolling performance */
body.is-scrolling * {
    pointer-events: none;
}

/* Touch device optimizations */
body.touch-device .hover-scale:hover {
    transform: none;
}

.container-fluid {
    max-width: 1920px;
    margin: 0 auto;
}

/* ========================================
   Header & Navigation
   ======================================== */
.dashboard-header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
    border-bottom: 1px solid var(--border-medium);
    padding: 1.25rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.dashboard-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary) 0%, var(--info) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.last-update {
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.refresh-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border: none;
    border-radius: 8px;
    color: white;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.refresh-btn:active {
    transform: translateY(0);
}

/* ========================================
   Cards & Containers
   ======================================== */
.price-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-hover) 100%);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.price-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--info) 100%);
}

.price-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    border-color: var(--border-accent);
}

.price-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

#currentPrice {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.price-positive {
    color: var(--success);
    animation: pulseGreen 2s infinite;
}

.price-negative {
    color: var(--danger);
    animation: pulseRed 2s infinite;
}

@keyframes pulseGreen {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes pulseRed {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Stat Cards */
.stat-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
    text-align: center;
    height: 100%;
}

.stat-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Indicator Cards */
.indicator-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border-left: 4px solid var(--primary);
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
}

.indicator-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
    border-left-color: var(--info);
}

.indicator-card h5 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.indicator-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* Signal Cards */
.signal-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border-light);
    transition: all var(--transition-base);
    margin-bottom: 1rem;
    position: relative;
}

.signal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    background: transparent;
    transition: all var(--transition-base);
    pointer-events: none;
}

.signal-buy {
    border-left: 4px solid var(--success);
}

.signal-buy:hover {
    background: rgba(16, 185, 129, 0.05);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.1);
}

.signal-sell {
    border-left: 4px solid var(--danger);
}

.signal-sell:hover {
    background: rgba(239, 68, 68, 0.05);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.1);
}

/* ========================================
   Chart Container
   ======================================== */
.chart-container {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-lg);
    margin-bottom: 1.5rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.chart-header h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

#chart {
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-secondary);
}

/* ========================================
   Timeframe Selector
   ======================================== */
.timeframe-dropdown {
    position: relative;
    width: 100%;
}

.timeframe-dropdown-btn {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timeframe-dropdown-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.timeframe-dropdown-btn i {
    transition: transform var(--transition-base);
}

.timeframe-dropdown-btn.open i {
    transform: rotate(180deg);
}

.timeframe-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    box-shadow: var(--shadow-xl);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.timeframe-dropdown-menu.show {
    display: block;
    animation: slideDown var(--transition-base);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.timeframe-section {
    padding: 0.5rem 0;
}

.timeframe-section:not(:last-child) {
    border-bottom: 1px solid var(--border-light);
}

.timeframe-section-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.5rem 1rem;
}

.timeframe-item {
    padding: 0.625rem 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
}

.timeframe-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.timeframe-item.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    font-weight: 600;
}

.timeframe-item.active::before {
    content: '✓ ';
    margin-right: 0.5rem;
}

.timeframe-selector {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.timeframe-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.timeframe-group-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.5rem;
    display: flex;
    align-items: center;
}

.timeframe-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.timeframe-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.timeframe-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
    border-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

/* ========================================
   Progress Bars
   ======================================== */
.progress {
    height: 8px;
    border-radius: 4px;
    background: var(--bg-secondary);
    overflow: hidden;
}

.progress-bar {
    transition: width var(--transition-slow);
    border-radius: 4px;
}

/* ========================================
   Loading & Animations
   ======================================== */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: var(--text-muted);
}

.loading-spinner i {
    font-size: 3rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.fade-in {
    animation: fadeIn var(--transition-slow);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Utility Classes
   ======================================== */
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-primary { color: var(--primary) !important; }
.text-muted { color: var(--text-muted) !important; }

.bg-success { background-color: var(--success) !important; }
.bg-danger { background-color: var(--danger) !important; }
.bg-warning { background-color: var(--warning) !important; }

/* ========================================
   Responsive Design
   ======================================== */

/* ========================================
   Responsive Enhancements
   ======================================== */

/* Tablet */
@media (max-width: 992px) {
    .dashboard-header h1 {
        font-size: 1.5rem;
    }
    
    .last-update {
        font-size: 0.75rem;
    }
    
    .refresh-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    #currentPrice {
        font-size: 2.5rem;
    }
    
    .price-card {
        padding: 1.5rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .indicator-card {
        padding: 1rem;
    }
    
    #chart {
        height: 500px !important;
    }
    
    /* Make indicators column full width on tablet */
    #indicatorsColumn {
        order: 2;
    }
}

/* Mobile */
@media (max-width: 768px) {
    body {
        font-size: 13px;
    }
    
    .dashboard-header {
        padding: 1rem 0;
    }
    
    .dashboard-header h1 {
        font-size: 1.25rem;
    }
    
    .dashboard-header .gap-2 {
        gap: 0.5rem !important;
    }
    
    .refresh-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.75rem;
    }
    
    .price-card {
        padding: 1.25rem;
    }
    
    #currentPrice {
        font-size: 2rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    .indicator-card {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    
    .indicator-value {
        font-size: 1.5rem;
    }
    
    .timeframe-selector {
        gap: 0.5rem;
    }
    
    .timeframe-group-label {
        font-size: 0.7rem;
        padding: 0.25rem;
    }
    
    .timeframe-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .chart-container {
        padding: 0.5rem;
        overflow: visible;
    }
    
    .chart-header h4 {
        font-size: 1rem;
    }
    
    #chart {
        height: 500px !important;
    }
    
    .signal-card {
        padding: 1rem;
        margin-bottom: 0.75rem;
    }
    
    /* Better stacking on mobile */
    .d-flex.flex-wrap {
        flex-wrap: wrap !important;
    }
    
    /* Modal improvements */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-content {
        border-radius: 8px;
    }
    
    /* Chart controls wrapping */
    .timeframe-dropdown {
        width: 100% !important;
        max-width: 200px;
    }
}

/* Small Mobile */
@media (max-width: 576px) {
    .dashboard-header h1 {
        font-size: 1.1rem;
    }
    
    .dashboard-header .gap-3 {
        gap: 0.75rem !important;
    }
    
    .refresh-btn {
        padding: 0.4rem 0.75rem;
    }
    
    .refresh-btn i {
        margin-right: 0;
    }
    
    #currentPrice {
        font-size: 1.75rem;
    }
    
    .price-card {
        padding: 1rem;
    }
    
    .stat-card {
        padding: 0.875rem;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    .timeframe-btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.7rem;
    }
    
    #chart {
        height: 450px !important;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.75rem;
    }
    
    .chart-header .d-flex {
        width: 100%;
        justify-content: space-between;
    }
    
    /* Button text hiding on small screens */
    .btn-sm {
        font-size: 0.75rem;
        padding: 0.375rem 0.625rem;
    }
    
    /* Badge sizing */
    .badge {
        font-size: 0.7rem !important;
    }
    
    /* Alert text sizing */
    .alert {
        font-size: 0.875rem;
        padding: 0.75rem;
    }
    
    /* Timeframe dropdown mobile optimization */
    .timeframe-dropdown-menu {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        top: auto !important;
        border-radius: 16px 16px 0 0 !important;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    /* Footer adjustments */
    footer {
        padding: 1.5rem 0;
        margin-top: 2rem;
    }
    
    footer small {
        font-size: 0.75rem;
    }
}

/* Extra small screens (iPhone SE, small Android phones) */
@media (max-width: 375px) {
    .dashboard-header h1 {
        font-size: 1rem;
    }
    
    #currentPrice {
        font-size: 1.5rem;
    }
    
    .fs-4 {
        font-size: 1rem !important;
    }
    
    .price-card {
        padding: 0.75rem;
    }
    
    #chart {
        height: 420px !important;
    }
    
    .stat-label {
        font-size: 0.65rem;
    }
    
    .stat-value {
        font-size: 1rem;
    }
    
    .indicator-card {
        padding: 0.75rem;
    }
    
    .chart-container {
        padding: 0.5rem;
    }
}

/* Landscape orientation optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    #chart {
        height: 450px !important;
    }
    
    .price-card {
        padding: 1rem;
    }
    
    .modal-dialog {
        max-width: 90vw !important;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch target sizes */
    .btn, .timeframe-btn, .refresh-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .accordion-button {
        padding: 1rem;
    }
    
    .timeframe-item {
        padding: 1rem;
        font-size: 1rem;
    }
    
    /* Prevent double-tap zoom */
    * {
        touch-action: manipulation;
    }
}

/* Print styles */
@media print {
    .dashboard-header,
    .refresh-btn,
    .btn,
    footer,
    #aiAnalysisBtn,
    .accordion-button {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .price-card,
    .indicator-card,
    .chart-container {
        background: white;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --border-light: #ffffff;
        --border-medium: #ffffff;
        --text-muted: #ffffff;
    }
    
    .price-card,
    .indicator-card,
    .chart-container {
        border: 2px solid white;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark mode support (system preference) */
@media (prefers-color-scheme: dark) {
    /* Already in dark mode by default */
}

/* Container query support for future-proofing */
@supports (container-type: inline-size) {
    .chart-container {
        container-type: inline-size;
    }
}

/* Landscape orientation optimizations */
@media (max-width: 768px) and (orientation: landscape) {
    #chart {
        height: 400px !important;
    }
    
    .price-card {
        padding: 1rem;
    }
    
    .modal-dialog {
        max-width: 90vw !important;
    }
}
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .chart-header .d-flex {
        width: 100%;
        justify-content: space-between;
    }
}

/* ========================================
   Scrollbar Styling
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ========================================
   Notifications & Alerts
   ======================================== */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-xl);
    z-index: 2000;
    animation: slideIn var(--transition-base);
    max-width: 400px;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.error {
    border-left: 4px solid var(--danger);
}

.notification.success {
    border-left: 4px solid var(--success);
}

.notification.info {
    border-left: 4px solid var(--info);
}

/* ========================================
   Footer
   ======================================== */
footer {
    margin-top: 4rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.connection-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    animation: pulse 2s infinite;
}

.status-indicator.connected {
    background: var(--success);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ========================================
   RTL (Arabic) Support
   ======================================== */
body.rtl {
    direction: rtl;
    text-align: right;
}

/* Margin/Padding swaps for RTL */
body.rtl .ms-2 {
    margin-right: 0.5rem !important;
    margin-left: 0 !important;
}

body.rtl .ms-3 {
    margin-right: 1rem !important;
    margin-left: 0 !important;
}

body.rtl .me-2 {
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
}

body.rtl .me-3 {
    margin-left: 1rem !important;
    margin-right: 0 !important;
}

body.rtl .ps-2 {
    padding-right: 0.5rem !important;
    padding-left: 0 !important;
}

body.rtl .pe-2 {
    padding-left: 0.5rem !important;
    padding-right: 0 !important;
}

/* Text alignment */
body.rtl .text-start {
    text-align: right !important;
}

body.rtl .text-end {
    text-align: left !important;
}

/* Dropdowns */
body.rtl .dropdown-menu {
    left: auto;
    right: 0;
}

body.rtl .modal-header .btn-close {
    margin-right: auto;
    margin-left: 0;
}

/* Badge spacing */
body.rtl .badge.ms-3 {
    margin-right: 1rem !important;
    margin-left: 0 !important;
}

/* Icon spacing */
body.rtl .fas.me-2,
body.rtl .far.me-2 {
    margin-left: 0.5rem !important;
    margin-right: 0 !important;
}

/* Language Switcher Styles */
.language-switcher {
    position: relative;
}

.language-switcher select {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 0.5rem 2rem 0.5rem 1rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-base);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

body.rtl .language-switcher select {
    padding: 0.5rem 1rem 0.5rem 2rem;
    background-position: left 0.75rem center;
}

.language-switcher select:hover {
    border-color: var(--primary);
    background-color: var(--bg-hover);
}

.language-switcher select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.language-switcher option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}
/* ========================================
   Market Closed Modal Styles
   ======================================== */

#marketClosedModal .modal-content {
    border-radius: 1rem;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#marketClosedModal .fa-moon {
    animation: moonPulse 2s ease-in-out infinite;
}

@keyframes moonPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

#marketClosedModal .card {
    border-radius: 0.75rem;
    transition: all var(--transition-base);
}

#marketClosedModal .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(243, 156, 18, 0.2);
}

#marketClosedModal .btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    border-radius: 0.75rem;
    transition: all var(--transition-base);
    font-weight: 600;
}

#marketClosedModal .btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

#marketClosedModal .btn-warning:active {
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 576px) {
    #marketClosedModal .fa-moon {
        font-size: 3rem !important;
    }
    
    #marketClosedModal h4 {
        font-size: 1.25rem;
    }
    
    #marketClosedModal .d-flex {
        flex-direction: column !important;
        gap: 0.75rem;
    }
    
    #marketClosedModal .btn-warning {
        width: 100%;
        padding: 0.75rem !important;
    }
}

/* RTL Support for Market Closed Modal */
body.rtl #marketClosedModal .text-start {
    text-align: right !important;
}

body.rtl #marketClosedModal .fa-calendar-check,
body.rtl #marketClosedModal .fa-calendar-times {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* ========================================
   Improved Navigation & Page Transitions
   ======================================== */

/* Page Fade-in Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

body {
    animation: fadeIn 0.3s ease-out;
}

/* Navbar Improvements */
.navbar {
    transition: all var(--transition-base);
    position: relative;
    z-index: 1100;
}

.navbar .dropdown-menu {
    z-index: 1150 !important;
    position: absolute !important;
}

.navbar-brand {
    transition: transform var(--transition-fast);
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.nav-link {
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: all var(--transition-base);
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* Dropdown Menu Improvements */
.dropdown-menu {
    animation: fadeIn 0.2s ease-out;
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    z-index: 1050 !important;
}

.dropdown-item {
    transition: all var(--transition-fast);
    padding: 0.75rem 1.25rem;
}

.dropdown-item:hover {
    background: rgba(59, 130, 246, 0.1);
    transform: translateX(5px);
    padding-left: 1.5rem;
}

/* Modern Breadcrumb Styling */
.modern-breadcrumb {
    background: linear-gradient(135deg, rgba(30, 37, 55, 0.6) 0%, rgba(20, 27, 45, 0.6) 100%);
    backdrop-filter: blur(10px);
    padding: 0.875rem 1.25rem;
    border-radius: 0.75rem;
    margin-bottom: 0;
    border: 1px solid rgba(59, 130, 246, 0.1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 0 15px rgba(59, 130, 246, 0.05);
    transition: all var(--transition-base);
}

.modern-breadcrumb:hover {
    border-color: rgba(59, 130, 246, 0.2);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 0 20px rgba(59, 130, 246, 0.1);
}

.modern-breadcrumb .breadcrumb-item {
    font-size: 0.875rem;
    font-weight: 500;
}

.modern-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: "\f054";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: rgba(59, 130, 246, 0.5);
    font-size: 0.7rem;
    padding: 0 0.75rem;
}

.modern-breadcrumb .breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
}

.modern-breadcrumb .breadcrumb-item a:hover {
    color: var(--primary-hover);
    background: rgba(59, 130, 246, 0.1);
    transform: translateX(2px);
}

.modern-breadcrumb .breadcrumb-item a i {
    font-size: 0.875rem;
}

.modern-breadcrumb .breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 600;
}

/* Button Hover Effects */
.btn {
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

.btn:active {
    transform: translateY(0);
}

/* Card Hover Effects */
.price-card,
.indicator-card,
.stats-card {
    transition: all var(--transition-base);
}

.price-card:hover,
.indicator-card:hover,
.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.2);
    border-color: var(--primary);
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity var(--transition-base);
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Mobile Navigation Toggle Animation */
.navbar-toggler {
    transition: all var(--transition-fast);
}

.navbar-toggler:hover {
    transform: scale(1.1);
}

/* Admin Sidebar Link Hover Effect */
.admin-sidebar .nav-link {
    position: relative;
    overflow: hidden;
}

.admin-sidebar .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 3px;
    height: 0;
    background: var(--primary);
    transition: height var(--transition-base);
    transform: translateY(-50%);
}

.admin-sidebar .nav-link:hover::before,
.admin-sidebar .nav-link.active::before {
    height: 100%;
}

/* Status Indicator Pulse Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.status-indicator.connected {
    animation: pulse 2s infinite;
}

/* Notification Slide-in Animation */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification {
    animation: slideInRight 0.3s ease-out;
}

/* Mobile Responsive Navigation */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: rgba(30, 37, 55, 0.98);
        padding: 1rem;
        margin-top: 1rem;
        border-radius: 0.5rem;
        border: 1px solid rgba(59, 130, 246, 0.2);
        animation: slideDown 0.3s ease-out;
    }
    
    .navbar-nav {
        gap: 0.5rem !important;
    }
    
    .dropdown-menu {
        position: static !important;
        transform: none !important;
        width: 100%;
        border: none;
        background: rgba(15, 23, 42, 0.8);
        margin-top: 0.5rem;
    }
}

/* Enhanced Responsive Design */
@media (max-width: 767.98px) {
    /* Dashboard Header */
    .dashboard-header {
        padding: 1rem 0;
    }
    
    .dashboard-header h1 {
        font-size: 1.25rem !important;
    }
    
    .breadcrumb {
        font-size: 0.875rem;
    }
    
    /* Price Cards */
    .price-card {
        padding: 1rem !important;
    }
    
    .price-card .fs-1 {
        font-size: 2rem !important;
    }
    
    /* Stat Cards */
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.25rem;
    }
    
    /* Charts */
    #chart {
        height: 300px !important;
    }
    
    /* Buttons */
    .btn-sm {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
    
    /* Hide text on small screens, show icons only */
    .d-none.d-md-inline {
        display: none !important;
    }
    
    /* Timeframe buttons */
    .timeframe-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Modals */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
    }
}

@media (max-width: 575.98px) {
    /* Extra small devices */
    .container-fluid {
        padding: 0.5rem;
    }
    
    .navbar {
        padding: 0.5rem 1rem !important;
    }
    
    .price-card .fs-1 {
        font-size: 1.75rem !important;
    }
    
    /* Stack columns */
    .row > [class*='col-'] {
        margin-bottom: 1rem;
    }
    
    /* Reduce spacing */
    .mb-4 {
        margin-bottom: 1rem !important;
    }
    
    .gap-3 {
        gap: 0.75rem !important;
    }
}

/* Page Transition Effects */
.page-transition {
    animation: pageSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pageSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Content fade-in on load */
.content-section {
    animation: contentFadeIn 0.5s ease-out;
    animation-fill-mode: both;
}

.content-section:nth-child(1) { animation-delay: 0.1s; }
.content-section:nth-child(2) { animation-delay: 0.2s; }
.content-section:nth-child(3) { animation-delay: 0.3s; }
.content-section:nth-child(4) { animation-delay: 0.4s; }

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth scroll animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading skeleton animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton-loading {
    background: linear-gradient(
        90deg,
        rgba(30, 37, 55, 0.5) 0%,
        rgba(59, 130, 246, 0.2) 50%,
        rgba(30, 37, 55, 0.5) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Hover scale animation for interactive elements */
.hover-scale {
    transition: transform var(--transition-fast);
}

.hover-scale:hover {
    transform: scale(1.02);
}

/* Fade in/out for dynamic content */
.fade-enter {
    opacity: 0;
}

.fade-enter-active {
    opacity: 1;
    transition: opacity var(--transition-base);
}

.fade-exit {
    opacity: 1;
}

.fade-exit-active {
    opacity: 0;
    transition: opacity var(--transition-base);
}

/* Indicator Guide Responsive */
@media (max-width: 991.98px) {
    .indicator-card {
        padding: 1.5rem !important;
    }
    
    .indicator-card h4 {
        font-size: 1.25rem;
    }
}

@media (max-width: 767.98px) {
    .guide-navbar {
        padding: 0.75rem 1rem;
    }
    
    .indicator-card {
        padding: 1rem !important;
        margin-bottom: 1rem;
    }
    
    .indicator-card h4 {
        font-size: 1.1rem;
    }
    
    .indicator-card p {
        font-size: 0.875rem;
    }
    
    .back-btn {
        font-size: 1rem !important;
        padding: 0.75rem 2rem !important;
    }
}

/* Admin Dashboard Responsive */
@media (max-width: 767.98px) {
    .admin-sidebar {
        position: relative !important;
        width: 100% !important;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    }
    
    .admin-content {
        margin-left: 0 !important;
        padding: 1rem;
    }
    
    .stats-card {
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .data-table .table td,
    .data-table .table th {
        padding: 0.5rem;
    }
}

/* Touch-friendly targets */
@media (hover: none) and (pointer: coarse) {
    /* Increase tap target size for touch devices */
    .btn,
    .nav-link,
    .dropdown-item,
    .timeframe-btn {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Remove hover effects on touch devices */
    .card:hover,
    .btn:hover,
    .nav-link:hover {
        transform: none;
    }
}

/* Print styles */
@media print {
    .navbar,
    .breadcrumb,
    .btn,
    .admin-sidebar {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .price-card,
    .stat-card,
    .indicator-card {
        border: 1px solid #000;
        break-inside: avoid;
    }
}
}
