/**
 * ============================================================================
 * PREMIUM FINTECH TRADING APP - CSS REDESIGN
 * Mobile-First | Dark Premium | Modern Elegance | No Excess Gradients
 * ============================================================================
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@500;600;700;800&display=swap');

/* ============================================================================
   DESIGN TOKENS & CSS VARIABLES
   ============================================================================ */

:root {
    /* --- BRAND COLORS --- */
    --primary: #ffc107;              /* Vibrant indigo */
    --primary-hover: #f8ea81;        /* Lighter indigo */
    --primary-dark: #e5e246;         /* Darker indigo */
    --primary-500: #f1ec63;
    --primary-600: #e5e246;
    --primary-700: #d4d12a;
    
    /* --- STATUS COLORS --- */
    --success: #10B981;              /* Emerald green */
    --success-500: #10B981;
    --success-600: #059669;
    --danger: #EF4444;               /* Red */
    --danger-500: #EF4444;
    --danger-600: #DC2626;
    --warning: #F59E0B;              /* Amber */
    --info: #0EA5E9;                 /* Sky blue */
    
    /* --- NEUTRAL PALETTE (Dark-First) --- */
    --bg-primary: #0F172A;           /* Deep navy */
    --bg-secondary: #1E293B;         /* Slate dark */
    --bg-tertiary: #334155;          /* Slate medium */
    --bg-elevated: #475569;          /* Slate light */
    
    --text-primary: #F8FAFC;         /* Almost white */
    --text-secondary: #CBD5E1;       /* Light gray */
    --text-muted: #94A3B8;           /* Medium gray */
    --text-disabled: #64748B;        /* Dark gray */
    
    --border: #334155;               /* Slate for borders */
    --border-subtle: #1E293B;        /* Very subtle border */
    --border-color: #334155;         /* Alias for consistency */
    
    /* --- SPACING SCALE (4px base) --- */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    
    /* --- BORDER RADIUS --- */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    
    /* --- SHADOWS --- */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.16);
    --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.2);
    
    /* --- TYPOGRAPHY --- */
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Poppins', 'Inter', sans-serif;
    --font-mono: 'Roboto Mono', 'Courier New', monospace;
    
    --text-xs: 12px;
    --text-sm: 14px;
    --text-base: 16px;
    --text-lg: 18px;
    --text-xl: 20px;
    --text-2xl: 24px;
    --text-3xl: 30px;
    
    /* --- TRANSITIONS --- */
    --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light mode overrides */
body.light-mode {
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-tertiary: #F3F4F6;
    --bg-elevated: #FFFFFF;
    
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --text-muted: #6B7280;
    --text-disabled: #9CA3AF;
    
    --border: #E5E7EB;
    --border-subtle: #F3F4F6;
    --border-color: #E5E7EB;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.12);
}

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: background-color var(--transition-slow), color var(--transition-slow);
}

input, textarea, select, button {
    font-family: inherit;
}

button {
    cursor: pointer;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
h5 { font-size: var(--text-base); }

p { margin-bottom: var(--space-4); }

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

/* ============================================================================
   APP LAYOUT CONTAINER
   ============================================================================ */

.app-container {
    min-height: 100vh;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    padding-bottom: 80px;
}

/* ============================================================================
   STICKY TOP HEADER / APP BAR
   ============================================================================ */

.trading-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 0px 10px;
    position: sticky;
    top: 0;
    z-index: 1020;
    backdrop-filter: blur(8px);
    background: rgba(30, 41, 59, 0.95);
}

body.light-mode .trading-header {
    background: rgba(255, 255, 255, 0.95);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.header-title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 0;
}

.header-title i {
    color: var(--primary);
}

.header-subtitle {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin: 0;
}

.menu-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.menu-toggle:hover {
    background: var(--bg-elevated);
    transform: scale(1.05);
}

.menu-toggle ion-icon {
    pointer-events: none;
}

/* Theme Toggle in Profile Page */
.theme-settings .info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.theme-toggle-wrapper {
    display: flex;
    align-items: center;
}

.theme-toggle-btn {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    position: relative;
}

.theme-toggle-btn:hover {
    background: var(--bg-elevated);
    transform: scale(1.05);
    border-color: var(--primary);
}

.theme-toggle-btn ion-icon {
    position: absolute;
    transition: opacity var(--transition), transform var(--transition);
}

.theme-toggle-btn .dark-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.theme-toggle-btn .light-icon {
    opacity: 0;
    transform: rotate(180deg);
}

body.light-mode .theme-toggle-btn .dark-icon {
    opacity: 0;
    transform: rotate(-180deg);
}

body.light-mode .theme-toggle-btn .light-icon {
    opacity: 1;
    transform: rotate(0deg);
}

/* ============================================================================
   CONTENT AREA
   ============================================================================ */

.trading-content {
    flex: 1;
    padding: var(--space-4);
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    flex-direction: column;
    gap: var(--space-6);
}

.section-title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.section-title i {
    color: var(--primary);
    font-size: var(--text-xl);
}

/* ============================================================================
   BANNER SLIDER - AD CAROUSEL
   ============================================================================ */

.banner-slider {
    position: relative;
    width: 100%;
    height: 120px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow-md);
    background: var(--bg-secondary);
}

.banner-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-slide.active {
    opacity: 1;
    z-index: 1;
}

.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-lg);
    display: block;
}

.banner-indicators {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}

.banner-indicators .indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all var(--transition);
}

.banner-indicators .indicator.active {
    background: #FFFFFF;
    width: 24px;
    border-radius: 4px;
}

.banner-indicators .indicator:hover {
    background: rgba(255, 255, 255, 0.8);
}



/* ============================================================================
   BALANCE CARD - PREMIUM PROFESSIONAL STYLE
   ============================================================================ */

.balance-card {
    background: #d9d9e900 url('https://www.shutterstock.com/image-illustration/glowing-candlestick-forex-chart-on-600nw-2340526363.jpg') center/cover no-repeat;
    border-radius: var(--radius-2xl);
    padding: var(--space-6);
    color: #FFFFFF;
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-slow);
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 0;
}

.balance-card::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.balance-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 70px rgba(99, 102, 241, 0.4);
}

.balance-card > * {
    position: relative;
    z-index: 2;
}

.balance-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-5);
}

.balance-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.balance-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.balance-label {
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.75);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    margin-bottom: 2px;
}

.balance-user {
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.balance-type {
    margin-top: 4px;
}

.badge.badge-demo {
    background: rgba(239, 68, 68, 0.9);
    color: #FFFFFF;
    font-size: 10px;
    padding: 4px 10px;
    border-radius: var(--radius-md);
    font-weight: 700;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.badge.badge-real {
    background: rgba(16, 185, 129, 0.9);
    color: #FFFFFF;
    font-size: 10px;
    padding: 4px 10px;
    border-radius: var(--radius-md);
    font-weight: 700;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.balance-main {
    margin-bottom: var(--space-5);
}

.balance-amount {
    font-size: 36px;
    font-weight: 800;
    font-family: 'Poppins', sans-serif;
    letter-spacing: -0.5px;
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    color: #FFFFFF;
}

.balance-stats {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    padding: var(--space-3) var(--space-4);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.balance-stat-item {
    flex: 1;
    text-align: center;
}

.stat-value {
    font-size: var(--text-lg);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 2px;
}

.stat-value ion-icon {
    font-size: 24px;
}

.stat-value.stat-deposit {
    color: #10B981;
}

.stat-value.stat-withdraw {
    color: #EF4444;
}

.stat-value.stat-trade {
    color: #3B82F6;
}

.stat-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.65);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.balance-stat-divider {
    width: 1px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
}

.badge {
    display: inline-block;
    font-size: var(--text-xs);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    font-weight: 600;
    text-transform: uppercase;
}

/* ============================================================================
   MINI CARDS (PROFIT & WITHDRAW)
   ============================================================================ */

.mini-card {
    border-radius: var(--radius-xl);
    padding: var(--space-4);
    color: #FFFFFF;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-slow);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    min-height: 120px;
}

.mini-card-profit {
    background: url('https://t4.ftcdn.net/jpg/04/20/27/57/360_F_420275708_icD9JvtkAZVCyxKhOpYyzPirDeq8afR8.jpg') center/cover no-repeat;
}

.mini-card-withdraw {
    background: url('https://t4.ftcdn.net/jpg/04/20/27/57/360_F_420275708_icD9JvtkAZVCyxKhOpYyzPirDeq8afR8.jpg') center/cover no-repeat;
}

.mini-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.5) 100%);
    pointer-events: none;
    z-index: 1;
}

.mini-card::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
}

.mini-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.mini-card > * {
    position: relative;
    z-index: 2;
}

.mini-card-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.mini-card-content {
    flex: 1;
}

.mini-card-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: var(--space-1);
}

.mini-card-value {
    font-size: 18px;
    font-weight: 800;
    font-family: 'Poppins', sans-serif;
    letter-spacing: -0.5px;
    color: #FFFFFF;
    line-height: 1.2;
}

@media (max-width: 390px) {
    .mini-card-value {
        font-size: 16px;
    }
    
    .mini-card-label {
        font-size: 10px;
    }
}

/* ============================================================================
   PAIR CARDS / ASSET LIST
   ============================================================================ */

.pair-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: var(--space-3);
}

.pair-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.pair-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    opacity: 0;
    transition: opacity var(--transition);
}

.pair-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.pair-card:hover::before {
    opacity: 0.05;
}

.pair-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: rgba(99, 102, 241, 0.05);
}

.pair-card * {
    position: relative;
    z-index: 2;
}

.pair-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.pair-symbol {
    font-weight: 700;
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.pair-change {
    font-size: var(--text-xs);
    font-weight: 600;
    padding: 2px var(--space-2);
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.pair-change.positive {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.pair-change.negative {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.pair-name {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.pair-price {
    font-weight: 700;
    font-size: var(--text-lg);
    color: var(--text-primary);
}

/* ============================================================================
   CHART CONTAINER
   ============================================================================ */

.chart-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    box-shadow: var(--shadow-md);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.chart-pair-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.chart-symbol {
    font-weight: 700;
    font-size: var(--text-xl);
    color: var(--text-primary);
}

.chart-price {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.current-price {
    font-weight: 600;
    font-size: var(--text-lg);
    color: var(--text-primary);
}

.price-change {
    font-size: var(--text-sm);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.price-change.positive {
    color: var(--success);
}

.price-change.negative {
    color: var(--danger);
}

.timeframe-selector {
    display: flex;
    gap: var(--space-2);
    background: var(--bg-tertiary);
    padding: var(--space-1);
    border-radius: var(--radius-md);
}

.timeframe-btn {
    padding: var(--space-2) var(--space-3);
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.timeframe-btn:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.timeframe-btn.active {
    background: var(--primary);
    color: #FFFFFF;
}

.chart-canvas {
    width: 100%;
    height: 280px;
    margin-bottom: var(--space-3);
}

.chart-time {
    text-align: center;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* ============================================================================
   TRADING PANEL / TICKET
   ============================================================================ */

.trading-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-md);
}

/* Trade amount group */
.trade-amount-group {
    margin-bottom: var(--space-5);

.quick-amount-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.quick-amount-btn {
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.quick-amount-btn:hover {
    border-color: var(--primary);
    background: var(--bg-elevated);
    transform: translateY(-2px);
}

.quick-amount-btn:active {
    transform: translateY(0);
}

.quick-amount-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #FFFFFF;
    box-shadow: var(--glow-primary);
}
}

.trade-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.input-group {
    display: flex;
}

.input-group-text {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-right: none;
    padding: 0 var(--space-4);
    color: var(--text-muted);
    font-weight: 600;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.trade-input {
    flex: 1;
    height: 48px;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--text-primary);
    font-size: var(--text-base);
    font-weight: 600;
    transition: all var(--transition);
}

.trade-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: var(--bg-primary);
}

.trade-input::placeholder {
    color: var(--text-muted);
}

small.text-muted {
    display: block;
    color: var(--text-muted);
    font-size: var(--text-xs);
    margin-top: var(--space-2);
}

/* Duration group */
.duration-group {
    margin-bottom: var(--space-5);
}

.duration-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
}

.duration-btn {
    padding: var(--space-3);
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.duration-btn:hover {
    border-color: var(--primary);
    background: var(--bg-elevated);
}

.duration-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #FFFFFF;
}

/* Payout info */
.payout-info {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-5);
}

.payout-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) 0;
    font-size: var(--text-sm);
}

.payout-row:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.payout-row span {
    color: var(--text-muted);
}

.payout-row strong {
    color: var(--text-primary);
    font-weight: 700;
}

.payout-row.highlight strong {
    color: var(--primary);
}

/* ============================================================================
   ACTION BUTTONS (CALL / PUT)

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 200%;
    height: 200%;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}

.btn-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-5) var(--space-4);
    border: none;
    border-radius: var(--radius-lg);
    font-family: var(--font-heading);
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    gap: var(--space-2);
    min-height: 80px;
    position: relative;
    overflow: hidden;
}

.btn-action i {
    font-size: 28px;
}

.btn-action span {
    font-size: var(--text-base);
    display: block;
}

.btn-action small {
    font-size: var(--text-xs);
    opacity: 0.8;
    font-weight: 500;
}

/* CALL button - Green (UP) */
.btn-call {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3), var(--glow-success);
}

.btn-call:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5), 0 0 25px rgba(16, 185, 129, 0.6);
}

.btn-call:active:not(:disabled) {
    transform: translateY(0);
}

/* PUT button - Red (DOWN) */
.btn-put {
    background: linear-gradient(135deg, var(--danger) 0%, #DC2626 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3), var(--glow-danger);
}

.btn-put:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5), 0 0 25px rgba(239, 68, 68, 0.6);
}

.btn-put:active:not(:disabled) {
    transform: translateY(0);
}

.btn-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================================================
   BOTTOM NAVIGATION (STICKY)
   ============================================================================ */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0;
    height: 80px;
    z-index: 1030;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-3);
    color: var(--text-muted);
    text-decoration: none;
    font-size: var(--text-xs);
    transition: color var(--transition);
    gap: var(--space-1);
    height: 100%;
}

.nav-item:hover {
    color: var(--primary);
}

.nav-item.active {
    color: #ffc107;
}

.nav-item i {
    font-size: 24px;
}

/* Ionicons styling for bottom nav - larger size */
.bottom-nav .nav-item ion-icon {
    font-size: 28px;
    width: 28px;
    height: 28px;
}

/* Profile image in bottom nav */
.nav-profile-image {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

/* ============================================================================
   TRADE HISTORY / RECENT TRADES
   ============================================================================ */

.recent-trades {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.trade-row {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition);
}

.trade-row:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.trade-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.trade-pair {
    font-weight: 700;
    color: var(--text-primary);
    font-size: var(--text-base);
}

.trade-time {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.trade-result {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-1);
}

.trade-result.win {
    color: var(--success);
}

.trade-result.loss {
    color: var(--danger);
}

.trade-result span {
    font-weight: 700;
}

.trade-profit {
    font-size: var(--text-xs);
    font-weight: 600;
}

/* ============================================================================
   STATUS & MESSAGES
   ============================================================================ */

.status-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    text-align: center;
    box-shadow: var(--shadow-md);
}

.status-running {
    text-align: center;
    padding: var(--space-4);
}

.countdown-time {
    font-size: 56px;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--primary);
    display: block;
    margin: var(--space-4) 0;
    text-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
    animation: pulse 1s ease-in-out infinite;
}

.status-result {
    text-align: center;
    padding: var(--space-6);
}

.result-header {
    margin-bottom: var(--space-5);
}

.result-header i {
    font-size: 64px;
    display: block;
    margin-bottom: var(--space-3);
}

.status-result.win .result-header {
    color: var(--success);
}

.status-result.loss .result-header {
    color: var(--danger);
}

.status-result h3 {
    margin: var(--space-2) 0 0 0;
    font-size: var(--text-2xl);
}

/* ============================================================================
   FORM ELEMENTS & CONTROLS
   ============================================================================ */

.form-control,
.form-select {
    width: 100%;
    height: 48px;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: var(--text-base);
    transition: all var(--transition);
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: var(--bg-primary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    height: auto;
    min-height: 80px;
    resize: vertical;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.form-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-primary);
}

/* ============================================================================
   BUTTONS (PRIMARY SYSTEM)
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-success {
    background: var(--success);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: var(--danger);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.w-100 {
    width: 100%;
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
}

/* ============================================================================
   ALERTS & NOTIFICATIONS
   ============================================================================ */

.alert {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    border-left: 4px solid;
    margin-bottom: var(--space-4);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    animation: slideIn 0.3s ease-out;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-left-color: var(--success);
    color: var(--success);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: var(--danger);
    color: var(--danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: var(--warning);
    color: var(--warning);
}

.alert-info {
    background: rgba(14, 165, 233, 0.1);
    border-left-color: var(--info);
    color: var(--info);
}

/* ============================================================================
   WALLET & COMPONENTS
   ============================================================================ */

.wallet-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

.wallet-tabs {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
    background: var(--bg-tertiary);
    padding: var(--space-1);
    border-radius: var(--radius-lg);
}

/* ============================================================================
   HISTORY PAGE (scoped with .history-page)
   ============================================================================ */

.history-page .history-hero {
    background: radial-gradient(circle at 20% 20%, rgba(41,98,255,0.12), transparent 45%),
                radial-gradient(circle at 80% 0%, rgba(34,197,94,0.12), transparent 40%),
                var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    margin-bottom: var(--space-6);
    display: grid;
    gap: var(--space-4);
}

.history-page .history-hero h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-page .history-hero .meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--text-muted);
    font-size: 13px;
}

.history-page .history-hero .pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    font-weight: 600;
}

.history-page .stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-3);
}

.history-page .stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    display: flex;
    gap: var(--space-3);
    align-items: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.history-page .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 22px;
    color: #fff;
}

.history-page .stat-icon.primary { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.history-page .stat-icon.success { background: linear-gradient(135deg, #22c55e, #16a34a); }
.history-page .stat-icon.danger  { background: linear-gradient(135deg, #ef4444, #dc2626); }

.history-page .stat-content .stat-label {
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.history-page .stat-content .stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.history-page .performance-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.history-page .progress-track {
    width: 100%;
    height: 12px;
    background: var(--bg-tertiary);
    border-radius: 999px;
    overflow: hidden;
}

.history-page .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #16a34a);
    transition: width 0.5s ease;
}

.history-page .trade-history-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-4);
    box-shadow: 0 10px 30px rgba(0,0,0,0.14);
}

.history-page .history-table { width: 100%; border-collapse: collapse; }
.history-page .history-table thead { background: var(--bg-tertiary); }
.history-page .history-table th,
.history-page .history-table td {
    padding: 12px 10px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.history-page .history-table th {
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.history-page .history-table tbody tr:hover {
    background: rgba(59,130,246,0.08);
    cursor: pointer;
}

.history-page .trade-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
}
.history-page .trade-badge.call { background: rgba(34,197,94,0.12); color: #22c55e; }
.history-page .trade-badge.put  { background: rgba(239,68,68,0.12); color: #ef4444; }
.history-page .trade-badge.win  { background: rgba(34,197,94,0.12); color: #22c55e; }
.history-page .trade-badge.loss { background: rgba(239,68,68,0.12); color: #ef4444; }

.history-page .pl-positive { color: #22c55e; font-weight: 700; }
.history-page .pl-negative { color: #ef4444; font-weight: 700; }

@media (max-width: 900px) {
    .history-page .history-table thead { display: none; }
    .history-page .history-table tbody tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px 12px;
        padding: 12px;
        border: 1px solid var(--border);
        border-radius: 12px;
        margin-bottom: 12px;
        background: var(--bg-tertiary);
    }
    .history-page .history-table td {
        border: none;
        padding: 0;
        white-space: normal;
    }
    .history-page .history-table td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 11px;
        text-transform: uppercase;
        color: var(--text-muted);
        margin-bottom: 4px;
        letter-spacing: 0.4px;
    }
}

@media (max-width: 600px) {
    .history-page .history-hero { padding: var(--space-4); }
    .history-page .stat-card { padding: var(--space-3); }
    .history-page .stat-content .stat-value { font-size: 18px; }
}

.wallet-tab {
    flex: 1;
    padding: var(--space-3) var(--space-4);
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
}

.wallet-tab:hover {
    color: var(--text-primary);
    background: var(--bg-elevated);
}

.wallet-tab.active {
    background: var(--primary);
    color: #FFFFFF;
}

.transaction-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.transaction-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition);
}

.transaction-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.transaction-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.transaction-type {
    font-weight: 600;
    font-size: var(--text-base);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.transaction-type i {
    font-size: 20px;
}

.transaction-date {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.transaction-amount {
    text-align: right;
}

.transaction-value {
    font-weight: 700;
    font-size: var(--text-sm);
    color: var(--text-primary);
}

.transaction-value.positive {
    color: var(--success);
}

.transaction-value.negative {
    color: var(--danger);
}

.transaction-status {
    font-size: var(--text-xs);
    margin-top: var(--space-1);
}

.status-badge {
    display: inline-block;
    padding: 4px var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.pending {
    background: rgba(251, 191, 36, 0.1);
    color: #F59E0B;
}

.status-badge.approved {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.status-badge.rejected {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* Transaction List Responsive */
@media (max-width: 768px) {
    .transaction-item {
        padding: var(--space-3);
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }
    
    .transaction-info {
        width: 100%;
    }
    
    .transaction-amount {
        text-align: left;
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .transaction-type {
        font-size: 14px;
    }
    
    .transaction-type ion-icon {
        font-size: 18px;
    }
    
    .transaction-date {
        font-size: 11px;
    }
    
    .transaction-value {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .transaction-item {
        padding: 12px;
    }
    
    .transaction-type {
        font-size: 13px;
    }
    
    .transaction-type ion-icon {
        font-size: 16px;
    }
    
    .transaction-date {
        font-size: 10.5px;
        line-height: 1.4;
    }
    
    .transaction-value {
        font-size: 14px;
    }
    
    .status-badge {
        padding: 3px 8px;
        font-size: 10px;
    }
    
    .transaction-amount {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* ============================================================================
   PROFILE PAGE
   ============================================================================ */

.profile-card {
    text-align: center;
    padding: var(--space-8) var(--space-5);
}

.profile-avatar {
    font-size: 56px;
    color: var(--primary);
    margin-bottom: var(--space-4);
    display: flex;
    justify-content: center;
    align-items: center;
    width: 120px;
    height: 120px;
    margin-left: auto;
    margin-right: auto;
}

.profile-avatar ion-icon {
    font-size: 80px;
    width: 80px;
    height: 80px;
}

.profile-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.profile-username {
    font-size: var(--text-xl);
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.profile-email {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.info-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin: var(--space-4) 0;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border);
    font-size: var(--text-sm);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-muted);
    font-weight: 600;
}

.info-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ============================================================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ============================================================================ */

/* Mobile: 360px+ (default) */
@media (max-width: 390px) {
    .trading-content {
        padding: var(--space-3);
        gap: var(--space-4);
    }
    
    .pair-container {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2);
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }
    
    .btn-action {
        min-height: 70px;
    }
    
    .balance-card {
        padding: var(--space-5) var(--space-3);
        margin-bottom: var(--space-4);
    }
    
    .balance-label {
        font-size: 10px;
    }
    
    .balance-amount {
        font-size: 24px;
        word-break: break-all;
        line-height: 1.2;
    }
    
    .balance-card-header {
        margin-bottom: var(--space-4);
        flex-wrap: wrap;
        gap: var(--space-2);
    }
    
    .balance-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }
    
    .stat-card {
        padding: var(--space-4);
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .stat-value {
        font-size: var(--text-xl);
    }
    
    .alert {
        padding: var(--space-3);
        font-size: 13px;
    }
    
    .alert .btn-close {
        padding: var(--space-2);
    }
}

/* Small Mobile Adjustments */
@media (max-width: 576px) {
    .table-container {
        border-radius: var(--radius-lg);
    }
    
    .table {
        font-size: var(--text-xs);
    }
    
    .table th,
    .table td {
        padding: var(--space-2) var(--space-3);
    }
    
    .wallet-tabs {
        flex-direction: column;
        gap: var(--space-1);
    }
    
    .wallet-tab {
        width: 100%;
    }
    
    .stats-container {
        grid-template-columns: 1fr;
    }
    
    .balance-card {
        padding: var(--space-4) var(--space-3);
    }
    
    .balance-amount {
        font-size: 22px;
        word-break: break-all;
    }
    
    .balance-label {
        font-size: 9px;
    }
    
    .balance-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    
    .section-title {
        font-size: 14px;
        flex-wrap: wrap;
        gap: var(--space-2);
    }
    
    .alert {
        padding: 10px;
        font-size: 12px;
        border-radius: 8px;
    }
}

/* Tablet: 768px+ */
@media (min-width: 768px) {
    .trading-content {
        padding: var(--space-6);
        gap: var(--space-8);
    }
    
    .pair-container {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    
    .chart-container {
        padding: var(--space-6);
    }
    
    .trading-panel {
        padding: var(--space-8);
    }
    
    .action-buttons {
        grid-template-columns: 1fr 1fr;
    }
    
    .stats-container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .wallet-tabs {
        flex-direction: row;
    }
}

/* Desktop: 1024px+ */
@media (min-width: 1024px) {
    .trading-content {
        grid-template-columns: 1fr 350px;
    }
    
    .chart-canvas {
        height: 350px;
    }
    
    .stats-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }

/* ============================================================================
   GLASS MORPHISM UTILITIES
   ============================================================================ */

.glass {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border) !important;
}

.glass-card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(148, 163, 184, 0.1);
    box-shadow: var(--glass-shadow);
}

.glow-primary {
    box-shadow: var(--glow-primary);
}

.glow-success {
    box-shadow: var(--glow-success);
}

.glow-danger {
    box-shadow: var(--glow-danger);
}

/* ============================================================================
   SKELETON LOADERS
   ============================================================================ */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 25%,
        var(--bg-elevated) 50%,
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}

.skeleton-text {
    height: 14px;
    margin-bottom: var(--space-2);
    border-radius: var(--radius-sm);
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: var(--space-3);
    border-radius: var(--radius-md);
}

.skeleton-card {
    height: 120px;
    border-radius: var(--radius-xl);
}

.skeleton-circle {
    border-radius: 50%;
}

.skeleton-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ============================================================================
   COUNTUP ANIMATION & NUMBER TICKER
   ============================================================================ */

.countup {
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
}

.price-ticker {
    font-family: var(--font-mono);
    font-weight: 600;
    transition: color 0.3s ease;
}

.price-up {
    color: var(--success) !important;
    animation: priceFlash 0.5s ease;
}

.price-down {
    color: var(--danger) !important;
    animation: priceFlash 0.5s ease;
}

/* ============================================================================
   BRANDING HELPERS
   ============================================================================ */

.header-brand {
    display: flex;
    align-items: center;
    gap: var(--space-2, 8px);
}

.app-logo {
    height: 68px;
    width: auto;
    object-fit: contain;
}

@keyframes priceFlash {
    0%, 100% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(99, 102, 241, 0.2);
    }
}

/* ============================================================================
   ENHANCED ANIMATIONS
   ============================================================================ */

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-up {
    animation: slideUp 0.5s ease-out;
}

.scale-in {
    animation: scaleIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }

.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

/* ============================================================================
   STATS & HISTORY PAGE COMPONENTS
   ============================================================================ */

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    transition: all var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.stat-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stat-icon.primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-1);
    font-weight: 600;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
}

.trade-history-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

.table thead {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}

.table th {
    padding: var(--space-4);
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tbody tr {
    border-bottom: 1px solid var(--border-subtle);
    transition: all var(--transition);
    animation: slideIn 0.3s ease-out backwards;
}

.table tbody tr:nth-child(1) { animation-delay: 0ms; }
.table tbody tr:nth-child(2) { animation-delay: 50ms; }
.table tbody tr:nth-child(3) { animation-delay: 100ms; }
.table tbody tr:nth-child(4) { animation-delay: 150ms; }
.table tbody tr:nth-child(5) { animation-delay: 200ms; }

.table tbody tr:hover {
    background: var(--bg-tertiary);
}

.table tbody tr:last-child {
    border-bottom: none;
}

.table td {
    padding: var(--space-4);
    color: var(--text-primary);
}

.trade-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px var(--space-3);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
}

.trade-badge.win {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.trade-badge.loss {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.trade-badge.call {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.trade-badge.put {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* ============================================================================
   EMPTY STATES
   ============================================================================ */

.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: var(--space-4);
    opacity: 0.5;
    color: var(--text-muted);
}

.empty-state-title {
    font-size: var(--text-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.empty-state-message {
    font-size: var(--text-sm);
    color: var(--text-muted);
}

/* ============================================================================
   PROFILE PAGE COMPONENTS
   ============================================================================ */

.profile-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-8) var(--space-6);
    text-align: center;
    margin-bottom: var(--space-6);
}

.profile-avatar {
    font-size: 56px;
    color: var(--primary);
    margin-bottom: var(--space-4);
}

.profile-username {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.profile-email {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.info-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    margin-bottom: var(--space-5);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border);
    font-size: var(--text-sm);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-muted);
    font-weight: 600;
}

.info-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* ============================================================================
   FORM SECTION
   ============================================================================ */

.form-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* ============================================================================
   MODALS & OVERLAYS
   ============================================================================ */

.modal-backdrop {
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(8px);
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: var(--space-5) var(--space-6);
    background: var(--bg-tertiary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-xl);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-6);
    color: var(--text-primary);
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: var(--space-5) var(--space-6);
    background: var(--bg-tertiary);
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.btn-close {
    opacity: 0.6;
    filter: invert(1);
}

.btn-close:hover {
    opacity: 1;
}

body.light-mode .btn-close {
    filter: invert(0);
}

/* ============================================================================
   TOAST NOTIFICATIONS
   ============================================================================ */

.toast-container {
    position: fixed;
    top: 80px;
    right: var(--space-4);
    z-index: 9999;
    max-width: 400px;
    pointer-events: none;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    margin-bottom: var(--space-3);
    box-shadow: var(--shadow-xl);
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
    animation: slideInRight 0.3s ease-out;
    pointer-events: auto;
    min-width: 300px;
}

.toast.toast-success {
    border-left: 4px solid var(--success);
}

.toast.toast-error {
    border-left: 4px solid var(--danger);
}

.toast.toast-info {
    border-left: 4px solid var(--primary);
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.toast-success .toast-icon {
    color: var(--success);
}

.toast-error .toast-icon {
    color: var(--danger);
}

.toast-info .toast-icon {
    color: var(--primary);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    font-size: var(--text-base);
    margin-bottom: 4px;
    color: var(--text-primary);
}

.toast-message {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.4;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================================================
   LOADING STATES & SPINNERS
   ============================================================================ */

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 25%,
        var(--bg-elevated) 50%,
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============================================================================
   BOOTSTRAP OVERRIDES FOR CONSISTENCY
   ============================================================================ */

.alert-dismissible .btn-close {
    padding: var(--space-3);
}

.bg-success {
    background-color: var(--success) !important;
}

.bg-danger {
    background-color: var(--danger) !important;
}

.bg-warning {
    background-color: var(--warning) !important;
}

.bg-dark {
    background-color: var(--bg-tertiary) !important;
}
/* ============================================================================
   CRYPTO TICKER MARQUEE ANIMATION
   ============================================================================ */

.crypto-ticker-wrapper {
    width: 100%;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.crypto-ticker-track {
    display: flex;
    animation: marquee-scroll 40s linear infinite;
    width: max-content;
}

.crypto-ticker-content {
    display: flex;
    gap: 0;
    white-space: nowrap;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    min-width: auto;
    flex-shrink: 0;
}

.ticker-item:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: scale(1.05);
}

/* ============================================================================
   SIDE MENU
   ============================================================================ */

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
    z-index: 1030;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.side-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: 260px;
    height: 100vh;
    background: radial-gradient(circle at 10% 10%, rgba(59,130,246,0.12), transparent 35%),
                radial-gradient(circle at 80% 20%, rgba(34,197,94,0.12), transparent 35%),
                linear-gradient(135deg, rgba(18,18,30,0.96), rgba(18,24,38,0.95));
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.35);
    transition: right var(--transition-slow);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.side-menu.active {
    right: 0;
}

.side-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: transparent;
}

.side-menu-brand {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.side-menu-logo {
    width: 75%;
    height: 100%;
    object-fit: contain;
}

.close-menu-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all var(--transition);
}

.close-menu-btn:hover {
    background: var(--bg-elevated);
    transform: rotate(90deg);
}

.side-menu-user {
    padding: var(--space-6) var(--space-4);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    gap: var(--space-3);
    align-items: center;
}

.side-menu-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    color: #fff;
    overflow: hidden;
    flex-shrink: 0;
}

.side-menu-avatar ion-icon {
    font-size: 56px;
    width: 56px;
    height: 56px;
}

.side-menu-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 2px solid rgba(99, 102, 241, 0.5);
}

.side-menu-user-info {
    flex: 1;
}

.side-menu-username {
    font-weight: 700;
    font-size: var(--text-lg);
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.side-menu-balance {
    font-size: var(--text-sm);
    color: #7ee0a3;
    font-weight: 600;
}

.side-menu-nav {
    flex: 1;
    padding: var(--space-4) 0;
}

.side-menu-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 12px var(--space-4);
    color: #cfd8ea;
    text-decoration: none;
    transition: all var(--transition);
    font-weight: 500;
}

.side-menu-link:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
    transform: translateX(-4px);
}

.side-menu-link ion-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.side-menu-link.admin-link {
    color: #7aa5ff;
}

.side-menu-link.admin-link:hover {
    background: rgba(99, 102, 241, 0.15);
    color: #9bbcff;
}

.side-menu-link.logout-link {
    color: #f77b7b;
}

.side-menu-link.logout-link:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #ff9a9a;
}

.side-menu-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: var(--space-2) var(--space-4);
}

.side-menu-footer {
    padding: var(--space-4);
    border-top: 1px solid rgba(255,255,255,0.06);
    text-align: center;
    color: var(--text-muted);
}

@media (max-width: 576px) {
    .side-menu {
        width: 230px;
        right: -230px;
    }
}

.ticker-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    flex-shrink: 0;
}

.ticker-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
}

.ticker-price {
    font-weight: 700;
    font-size: 14px;
    font-family: var(--font-mono);
    line-height: 1.2;
    transition: all 0.3s ease;
}

.ticker-price.up {
    color: #10B981;
}

.ticker-price.down {
    color: #EF4444;
}

.ticker-change {
    font-weight: 600;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
    font-family: var(--font-mono);
    line-height: 1;
    transition: all 0.3s ease;
}

.ticker-change.up {
    color: #10B981;
    background: rgba(16, 185, 129, 0.1);
}

.ticker-change.down {
    color: #EF4444;
    background: rgba(239, 68, 68, 0.1);
}

@keyframes marquee-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* Pause on hover */
.crypto-ticker-wrapper:hover .crypto-ticker-track {
    animation-play-state: paused;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .crypto-ticker-track {
        animation: marquee-scroll 35s linear infinite;
    }
    
    .ticker-item {
        padding: 10px 16px;
        gap: 6px;
    }
    
    .ticker-icon {
        width: 24px;
        height: 24px;
    }
    
    .ticker-price {
        font-size: 12px;
    }
    
    .ticker-change {
        font-size: 10px;
        padding: 2px 6px;
    }
}

@media (max-width: 480px) {
    .crypto-ticker-track {
        animation: marquee-scroll 30s linear infinite;
    }
    
    .ticker-item {
        padding: 8px 12px;
        gap: 5px;
    }
    
    .ticker-icon {
        width: 20px;
        height: 20px;
    }
    
    .ticker-price {
        font-size: 11px;
    }
    
    .ticker-change {
        font-size: 9px;
        padding: 2px 4px;
    }
}

/* ============================================================================
   AUTHENTICATION PAGES (Login & Register)
   ============================================================================ */

:root {
    --auth-primary-neon: #00FF41;
    --auth-primary-glow: #00FF4140;
    --auth-bg-dark: #0a0e27;
    --auth-bg-darker: #050812;
    --auth-bg-card: #0f1629;
    --auth-bg-input: #1a1f3a;
    --auth-text-primary: #ffffff;
    --auth-text-secondary: #a0a9c9;
    --auth-border-color: #1e2749;
    --auth-border-glow: #00FF4180;
    --auth-transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

body.auth-page {
    background: linear-gradient(135deg, #0a0e27 0%, #16213e 25%, #0f1629 50%, #1a0f2e 75%, #0a0e27 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--auth-text-primary);
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background Elements */
body.auth-page::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 255, 65, 0.1) 0%, rgba(0, 255, 65, 0) 70%);
    border-radius: 50%;
    animation: authFloat 20s ease-in-out infinite;
    z-index: -1;
}

body.auth-page::after {
    content: '';
    position: fixed;
    bottom: -20%;
    left: -5%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 150, 255, 0.08) 0%, rgba(0, 150, 255, 0) 70%);
    border-radius: 50%;
    animation: authFloat 30s ease-in-out infinite reverse;
    z-index: -1;
}

@keyframes authFloat {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, 30px); }
}

.auth-wrapper {
    width: 100%;
    max-width: 900px;
    animation: authSlideUp 0.8s ease-out;
    z-index: 1;
}

@keyframes authSlideUp {
    from {
        opacity: 0;
        transform: translateY(60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: var(--auth-bg-card);
    border: 1px solid var(--auth-border-color);
    border-radius: 24px;
    overflow: hidden;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    min-height: 580px;
}

/* Left Panel - Illustration */
.auth-illustration {
    background: linear-gradient(135deg, #0f1629 0%, #1a0f2e 100%);
    padding: 48px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-right: 1px solid var(--auth-border-color);
    position: relative;
    overflow: hidden;
}

.auth-illustration::before {
    content: '';
    position: absolute;
    top: 0;
    right: -30%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--auth-primary-glow) 0%, transparent 70%);
    border-radius: 50%;
    animation: authPulse 4s ease-in-out infinite;
}

@keyframes authPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.chart-illustration {
    width: 320px;
    height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    position: relative;
    z-index: 1;
}

.chart-illustration img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 30px var(--auth-primary-glow));
}

.illustration-text {
    text-align: center;
    position: relative;
    z-index: 1;
}

.illustration-title {
    font-family: 'Poppins', sans-serif;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--auth-primary-neon) 0%, #00CC33 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.illustration-desc {
    color: var(--auth-text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

/* Right Panel - Forms */
.auth-forms {
    padding: 48px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tab-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--auth-border-color);
    padding-bottom: 0;
}

.tab-button {
    flex: 1;
    padding: 16px 20px;
    background: none;
    border: none;
    color: var(--auth-text-secondary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--auth-transition);
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tab-button.active {
    color: var(--auth-primary-neon);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--auth-primary-neon), transparent);
    box-shadow: 0 0 20px var(--auth-primary-glow);
}

.tab-button:hover:not(.active) {
    color: var(--auth-text-primary);
}

.tab-content {
    display: none;
    animation: authFadeIn 0.5s ease-out;
}

.tab-content.active {
    display: block;
}

@keyframes authFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-text-secondary);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-label ion-icon {
    font-size: 16px;
    color: var(--auth-primary-neon);
}

.input-group-wrapper {
    position: relative;
}

.auth-form-control {
    background: var(--auth-bg-input);
    border: 1px solid var(--auth-border-color);
    border-radius: 10px;
    padding: 14px 16px;
    color: var(--auth-text-primary);
    font-size: 14px;
    width: 100%;
    transition: all var(--auth-transition);
    font-family: 'Inter', sans-serif;
}

.auth-form-control::placeholder {
    color: rgba(160, 169, 201, 0.5);
}

.auth-form-control:focus {
    outline: none;
    border-color: var(--auth-primary-neon);
    background: var(--auth-bg-input);
    box-shadow: 0 0 20px var(--auth-primary-glow), inset 0 0 0 1px var(--auth-border-glow);
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--auth-text-secondary);
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    transition: all var(--auth-transition);
}

.password-toggle:hover {
    color: var(--auth-primary-neon);
}

.select-country {
    display: flex;
    gap: 8px;
    align-items: center;
}

.country-flag {
    font-size: 24px;
    min-width: 32px;
}

.select-country select {
    flex: 1;
    background: var(--auth-bg-input);
    border: 1px solid var(--auth-border-color);
    border-radius: 10px;
    padding: 14px 16px;
    color: var(--auth-text-primary);
    font-size: 14px;
    transition: all var(--auth-transition);
    cursor: pointer;
}

.select-country select:focus {
    outline: none;
    border-color: var(--auth-primary-neon);
    box-shadow: 0 0 20px var(--auth-primary-glow), inset 0 0 0 1px var(--auth-border-glow);
}

.alert-message {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    color: #ff6b6b;
    animation: authSlideDown 0.3s ease-out;
}

.alert-message ion-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
}

.alert-success {
    background: rgba(0, 255, 65, 0.1);
    border-color: rgba(0, 255, 65, 0.3);
    color: var(--auth-primary-neon);
}

/* Enhanced Bootstrap Alert Styling for Auth Pages */
.auth-forms .alert {
    border-radius: 12px;
    border: 1px solid;
    padding: 16px 20px;
    margin-bottom: 20px;
    font-size: 14px;
    animation: authSlideDown 0.3s ease-out;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.auth-forms .alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: currentColor;
    opacity: 0.8;
}

.auth-forms .alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #FCA5A5;
}

.auth-forms .alert-danger ion-icon {
    color: #EF4444;
}

.auth-forms .alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: #6EE7B7;
}

.auth-forms .alert-success ion-icon {
    color: #10B981;
}

.auth-forms .alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: #FCD34D;
}

.auth-forms .alert-warning ion-icon {
    color: #F59E0B;
}

.auth-forms .alert-info {
    background: rgba(14, 165, 233, 0.1);
    border-color: rgba(14, 165, 233, 0.3);
    color: #7DD3FC;
}

.auth-forms .alert-info ion-icon {
    color: #0EA5E9;
}

.auth-forms .alert strong {
    display: block;
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.auth-forms .alert p {
    font-size: 13px;
    line-height: 1.5;
    opacity: 0.9;
}

.auth-forms .alert .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.5;
    transition: opacity 0.2s;
    position: absolute;
    right: 12px;
    top: 12px;
}

.auth-forms .alert .btn-close:hover {
    opacity: 1;
}

.auth-forms .alert ion-icon {
    font-size: 24px;
    flex-shrink: 0;
}

@keyframes authSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.btn-auth {
    background: linear-gradient(135deg, var(--auth-primary-neon) 0%, #00CC33 100%);
    border: none;
    border-radius: 10px;
    padding: 14px 24px;
    color: #0a0e27;
    font-weight: 700;
    font-size: 15px;
    width: 100%;
    cursor: pointer;
    transition: all var(--auth-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 0 30px var(--auth-primary-glow), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-auth:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 40px var(--auth-primary-glow), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-auth:active {
    transform: translateY(-1px);
}

.btn-auth ion-icon {
    font-size: 18px;
}

.form-footer {
    margin-top: 24px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--auth-border-color);
}

.form-footer-text {
    color: var(--auth-text-secondary);
    font-size: 13px;
}

.form-footer-link {
    color: var(--auth-primary-neon);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--auth-transition);
    cursor: pointer;
}

.form-footer-link:hover {
    text-decoration: underline;
}

/* Admin Login Link */
.admin-login-link {
    margin-top: 20px;
    text-align: center;
    padding: 16px;
    background: rgba(220, 38, 38, 0.05);
    border: 1px solid rgba(220, 38, 38, 0.15);
    border-radius: 10px;
    transition: all var(--auth-transition);
}

.admin-login-link:hover {
    background: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.3);
}

.admin-login-link a {
    color: #DC2626;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--auth-transition);
}

.admin-login-link a:hover {
    color: #B91C1C;
}

.admin-login-link ion-icon {
    font-size: 18px;
}

.forgot-password {
    text-align: right;
    margin: -8px 0 16px 0;
}

.forgot-password a {
    color: var(--auth-primary-neon);
    font-size: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all var(--auth-transition);
}

.forgot-password a:hover {
    text-decoration: underline;
}

.password-strength {
    margin-top: 6px;
    height: 3px;
    background: var(--auth-border-color);
    border-radius: 2px;
    overflow: hidden;
    display: none;
}

.password-strength.show {
    display: block;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    background: #ff6b6b;
    border-radius: 2px;
    transition: all 200ms;
    box-shadow: 0 0 10px currentColor;
}

.password-strength.weak .password-strength-bar {
    width: 33%;
    background: #ff6b6b;
}

.password-strength.medium .password-strength-bar {
    width: 66%;
    background: #ffd43b;
}

.password-strength.strong .password-strength-bar {
    width: 100%;
    background: var(--auth-primary-neon);
}

/* Responsive Design */
@media (max-width: 992px) {
    .auth-container {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .auth-illustration {
        border-right: none;
        border-bottom: 1px solid var(--auth-border-color);
        padding: 40px 30px;
        min-height: 300px;
    }

    .auth-forms {
        padding: 40px 30px;
    }

    .chart-illustration {
        height: 150px;
        margin-bottom: 20px;
    }

    .illustration-title {
        font-size: 24px;
    }
}

@media (max-width: 576px) {
    body.auth-page {
        padding: 12px;
    }

    .auth-container {
        border-radius: 16px;
    }

    .auth-illustration {
        padding: 24px 16px;
    }

    .auth-forms {
        padding: 24px 16px;
    }

    .tab-button {
        padding: 12px 16px;
        font-size: 13px;
    }

    .auth-form-control {
        padding: 12px 14px;
        font-size: 14px;
    }

    .chart-illustration {
        height: 150px;
        margin-bottom: 12px;
    }

    .illustration-title {
        font-size: 20px;
    }

    .illustration-desc {
        font-size: 12px;
    }

    .btn-auth {
        padding: 12px 20px;
        font-size: 13px;
    }
}

/* Input autocomplete styling */
.auth-form-control:-webkit-autofill,
.auth-form-control:-webkit-autofill:hover,
.auth-form-control:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px var(--auth-bg-input) inset;
    -webkit-text-fill-color: var(--auth-text-primary);
}

/* International Phone Input (intl-tel-input) Custom Styling */
.iti {
    width: 100%;
    display: block;
    position: relative;
}

.iti * {
    box-sizing: border-box;
}

/* ITI Container */
.iti {
    width: 100% !important;
    display: block !important;
}

.iti__flag-container {
    padding: 0;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
}

.iti__selected-flag {
    background: transparent !important;
    border: none !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 0;
    padding: 0 10px 0 14px !important;
    height: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    position: relative;
}

.iti__selected-flag:hover,
.iti__selected-flag:focus {
    background: rgba(0, 255, 65, 0.05) !important;
}

.iti__flag {
    margin-right: 6px;
    transform: scale(1.1);
}

.iti__arrow {
    border-top-color: rgba(255, 255, 255, 0.5) !important;
    margin-left: 6px;
    border-width: 5px 4px 0 4px !important;
}

.iti__arrow--up {
    border-top-color: transparent !important;
    border-bottom-color: #00ff41 !important;
    border-width: 0 4px 5px 4px !important;
}

.iti--show-flags .iti__flag-container:hover .iti__selected-flag,
.iti--show-flags .iti__flag-container:hover .iti__arrow {
    opacity: 1;
}

.iti__selected-dial-code {
    color: #ffffff !important;
    font-weight: 500;
    margin-left: 4px;
    font-size: 14px;
}

/* Phone Input Field */
.iti input[type="tel"].auth-form-control,
.iti input[type="tel"] {
    width: 100% !important;
    padding: 12px 14px 12px 95px !important;
    border-radius: 10px !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    background: #0d1230 !important;
    color: #ffffff !important;
    font-size: 15px !important;
    transition: all 0.2s ease !important;
    height: 50px !important;
}

.iti input[type="tel"].auth-form-control:focus,
.iti input[type="tel"]:focus {
    border-color: #00ff41 !important;
    box-shadow: 0 0 0 3px rgba(0, 255, 65, 0.12) !important;
    outline: none !important;
    background: #101535 !important;
}

.iti input[type="tel"].auth-form-control::placeholder,
.iti input[type="tel"]::placeholder {
    color: rgba(255, 255, 255, 0.35) !important;
}

.iti__dropdown-content {
    border-radius: 10px !important;
    background-color: #8f8f8f !important;
    overflow: hidden !important;
}

.iti__country-list {
    background: #0a0e27 !important;
    border: 1px solid rgba(0, 255, 65, 0.2) !important;
    border-radius: 12px !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7) !important;
    margin-top: 8px;
    max-height: 280px;
    width: 100%;
    min-width: 280px;
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 9999 !important;
}

/* Search input inside dropdown */
.iti__search-input {
    background: #141832 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    padding: 12px 14px !important;
    margin: 10px !important;
    width: calc(100% - 20px) !important;
    font-size: 14px !important;
    box-sizing: border-box !important;
    display: block !important;
}

.iti__search-input:focus {
    border-color: #00ff41 !important;
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(0, 255, 65, 0.15) !important;
    background: #1a1f3d !important;
}

.iti__search-input::placeholder {
    color: rgba(255, 255, 255, 0.35) !important;
}

.iti__divider {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0;
    margin: 0;
}

/* Country items */
.iti__country {
    padding: 11px 14px !important;
    color: #e2e8f0 !important;
    transition: all 0.15s ease !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
    display: flex !important;
    align-items: center !important;
    cursor: pointer !important;
}

.iti__country:hover,
.iti__country.iti__highlight {
    background: rgba(0, 255, 65, 0.1) !important;
}

.iti__country.iti__active {
    background: rgba(0, 255, 65, 0.15) !important;
}

.iti__country-name {
    color: #ffffff !important;
    font-size: 13px !important;
    margin-left: 10px !important;
}

.iti__dial-code {
    color: #00ff41 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    margin-left: 6px !important;
}

.iti__flag-box,
.iti__flag {
    margin-right: 0 !important;
}

/* Scrollbar */
.iti__country-list::-webkit-scrollbar {
    width: 5px;
}

.iti__country-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 12px 12px 0;
}

.iti__country-list::-webkit-scrollbar-thumb {
    background: #00ff41;
    border-radius: 3px;
}

.iti__country-list::-webkit-scrollbar-thumb:hover {
    background: #00cc34;
}

/* Responsive adjustments for intl-tel-input country list */
@media (max-width: 576px) {
    .iti__country-list {
        width: calc(100vw - 60px) !important;
        min-width: 260px;
        left: 0 !important;
    }
}