/* ============================================
   Binary Pattern Scanner - Mobile Friendly
   ============================================ */

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a1f2e;
    --bg-card-hover: #1f2937;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-blue: #3b82f6;
    --accent-yellow: #f59e0b;
    --accent-purple: #8b5cf6;
    --border-color: #2d3748;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 2px; }

/* Header */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0 12px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    height: 56px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1rem;
}

.nav-logo .logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.nav-menu {
    display: flex;
    gap: 4px;
    list-style: none;
}

.nav-menu a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.nav-menu a:hover, .nav-menu a.active {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-menu a.active {
    background: var(--accent-blue);
    color: white;
}

/* ============ HOMEPAGE ============ */
.hero {
    text-align: center;
    padding: 40px 16px;
    max-width: 700px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple), var(--accent-green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.hero p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.hero-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 22px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary { background: var(--accent-blue); color: white; }
.btn-primary:hover { background: #2563eb; transform: translateY(-1px); }
.btn-success { background: var(--accent-green); color: white; }
.btn-success:hover { background: #059669; transform: translateY(-1px); }
.btn-outline { background: transparent; border: 2px solid var(--border-color); color: var(--text-primary); }
.btn-outline:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-sm { padding: 8px 14px; font-size: 0.8rem; }
.btn-block { width: 100%; justify-content: center; }

/* Stats */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-width: 700px;
    margin: 0 auto 40px;
    flex-wrap: wrap;
}

.stat-item { text-align: center; }
.stat-number { font-size: 1.5rem; font-weight: 800; color: var(--accent-blue); }
.stat-label { font-size: 0.75rem; color: var(--text-muted); }

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 16px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.feature-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.feature-icon.blue { background: rgba(59,130,246,0.2); }
.feature-icon.green { background: rgba(16,185,129,0.2); }
.feature-icon.purple { background: rgba(139,92,246,0.2); }
.feature-icon.yellow { background: rgba(245,158,11,0.2); }

.feature-card h3 { font-size: 1rem; margin-bottom: 6px; }
.feature-card p { color: var(--text-secondary); font-size: 0.85rem; }

.footer {
    text-align: center;
    padding: 30px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ============ LIVE FEED PAGE ============ */
.live-feed-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px;
}

.live-feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.live-feed-header h1 {
    font-size: 1.4rem;
}

.live-pairs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.live-pair-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.live-pair-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}

.live-pair-card.call-signal {
    border-color: var(--accent-green);
    box-shadow: 0 0 20px rgba(16,185,129,0.15);
}

.live-pair-card.put-signal {
    border-color: var(--accent-red);
    box-shadow: 0 0 20px rgba(239,68,68,0.15);
}

.live-pair-card .pair-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.live-pair-card .pair-symbol {
    font-weight: 700;
    font-size: 1rem;
}

.live-pair-card .pair-price {
    font-weight: 700;
    font-size: 1.1rem;
}

.live-pair-card .pair-price.up { color: var(--accent-green); }
.live-pair-card .pair-price.down { color: var(--accent-red); }

.live-pair-card .pair-change {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.live-pair-card .signal-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 8px;
}

.signal-badge.call {
    background: rgba(16,185,129,0.2);
    color: var(--accent-green);
}

.signal-badge.put {
    background: rgba(239,68,68,0.2);
    color: var(--accent-red);
}

.signal-badge.neutral {
    background: rgba(245,158,11,0.2);
    color: var(--accent-yellow);
}

.live-pair-card .pair-details {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============ TRADING PAGE ============ */
.trading-container {
    display: grid;
    grid-template-columns: 260px 1fr 300px;
    height: calc(100vh - 56px);
    max-width: 100%;
}

.sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 12px;
}

.sidebar-mobile-toggle {
    display: none;
}

.section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 8px;
    font-weight: 600;
}

.pair-list-section { }

.pair-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 2px;
    font-size: 0.85rem;
}

.pair-item:hover { background: var(--bg-card-hover); }
.pair-item.active { background: var(--accent-blue); color: white; }

.pair-item .pair-symbol { font-weight: 600; }
.pair-item .pair-type {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-muted);
}

.pair-item .signal-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 4px;
}

.signal-dot.call { background: var(--accent-green); }
.signal-dot.put { background: var(--accent-red); }

.chart-area {
    position: relative;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-wrap: wrap;
    gap: 8px;
}

.chart-header h2 { font-size: 1rem; }
.chart-header .price { font-size: 1.3rem; font-weight: 700; }
.chart-header .price.up { color: var(--accent-green); }
.chart-header .price.down { color: var(--accent-red); }

.chart-container {
    flex: 1;
    position: relative;
    min-height: 300px;
}

.prediction-panel {
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    padding: 16px;
    overflow-y: auto;
}

.prediction-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    margin-bottom: 12px;
}

.prediction-card.call {
    border-color: var(--accent-green);
    box-shadow: 0 0 30px rgba(16,185,129,0.2);
    animation: pulse-green 2s infinite;
}

.prediction-card.put {
    border-color: var(--accent-red);
    box-shadow: 0 0 30px rgba(239,68,68,0.2);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 20px rgba(16,185,129,0.2); }
    50% { box-shadow: 0 0 40px rgba(16,185,129,0.4); }
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 20px rgba(239,68,68,0.2); }
    50% { box-shadow: 0 0 40px rgba(239,68,68,0.4); }
}

.prediction-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.prediction-direction {
    font-weight: 800;
    margin: 8px 0;
}

.prediction-details { margin-top: 12px; }

.prediction-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(45,55,72,0.5);
}

.prediction-detail-row .label { color: var(--text-muted); }
.prediction-detail-row .value { color: var(--text-primary); font-weight: 500; }

.confidence-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
}

.confidence-a { background: rgba(16,185,129,0.2); color: var(--accent-green); }
.confidence-b { background: rgba(245,158,11,0.2); color: var(--accent-yellow); }
.confidence-c { background: rgba(239,68,68,0.2); color: var(--accent-red); }

.countdown-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--accent-blue);
    color: var(--accent-blue);
    font-weight: 700;
    font-size: 0.85rem;
}

/* Alert */
.alert-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    max-width: 350px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    animation: slideInRight 0.4s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-popup.call { background: linear-gradient(135deg, #059669, #10b981); }
.alert-popup.put { background: linear-gradient(135deg, #dc2626, #ef4444); }

.alert-popup .alert-icon { font-size: 1.5rem; }
.alert-popup .alert-content { flex: 1; }
.alert-popup .alert-title { font-size: 0.9rem; margin-bottom: 2px; }
.alert-popup .alert-detail { font-size: 0.75rem; opacity: 0.9; }
.alert-popup .alert-close { cursor: pointer; font-size: 1.2rem; opacity: 0.7; }

@keyframes slideInRight {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Signals Page */
.signals-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 30px 16px;
}

.signals-header {
    text-align: center;
    margin-bottom: 24px;
}

.signals-header h1 { font-size: 1.5rem; margin-bottom: 6px; }
.signals-header p { color: var(--text-secondary); font-size: 0.9rem; }

.pair-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.pair-selector select {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.95rem;
    min-width: 200px;
    cursor: pointer;
}

.signal-result {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
    min-height: 200px;
}

.signal-result.call {
    border-color: var(--accent-green);
    box-shadow: 0 0 40px rgba(16,185,129,0.2);
    animation: pulse-green 2s infinite;
}

.signal-result.put {
    border-color: var(--accent-red);
    box-shadow: 0 0 40px rgba(239,68,68,0.2);
    animation: pulse-red 2s infinite;
}

.indicator-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    text-align: left;
    margin-top: 12px;
}

.indicator-item {
    padding: 6px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

.indicator-item.call { border-left: 3px solid var(--accent-green); }
.indicator-item.put { border-left: 3px solid var(--accent-red); }

.score-bar {
    height: 5px;
    border-radius: 3px;
    background: var(--border-color);
    margin-top: 4px;
    overflow: hidden;
}

.score-fill { height: 100%; border-radius: 3px; transition: width 0.5s; }
.score-fill.bullish { background: var(--accent-green); }
.score-fill.bearish { background: var(--accent-red); }

.loading {
    display: inline-block;
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    color: white;
    font-weight: 500;
    font-size: 0.85rem;
    z-index: 9999;
    animation: slideInRight 0.3s ease;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

.toast.success { background: var(--accent-green); }
.toast.error { background: var(--accent-red); }
.toast.info { background: var(--accent-blue); }

/* ============ MOBILE RESPONSIVE ============ */
@media (max-width: 1024px) {
    .trading-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        height: auto;
        min-height: 100vh;
    }
    
    .sidebar {
        display: none;
        position: fixed;
        top: 56px;
        left: 0;
        width: 280px;
        height: calc(100vh - 56px);
        z-index: 999;
        box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    }
    
    .sidebar.open { display: block; }
    
    .sidebar-mobile-toggle {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 8px 12px;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: var(--radius-sm);
        color: var(--text-primary);
        cursor: pointer;
        font-size: 0.85rem;
    }
    
    .prediction-panel {
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
    
    .chart-container {
        min-height: 350px;
    }
    
    .hero h1 { font-size: 1.5rem; }
    .live-pairs-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 8px;
    }
}

@media (max-width: 640px) {
    .nav-menu a {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    
    .nav-logo {
        font-size: 0.85rem;
    }
    
    .hero {
        padding: 30px 12px;
    }
    
    .hero h1 {
        font-size: 1.3rem;
    }
    
    .hero p {
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.8rem;
    }
    
    .btn-lg {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .live-pairs-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    
    .live-pair-card {
        padding: 10px;
    }
    
    .live-pair-card .pair-symbol {
        font-size: 0.8rem;
    }
    
    .live-pair-card .pair-price {
        font-size: 0.9rem;
    }
    
    .stats-bar {
        gap: 16px;
        padding: 16px;
    }
    
    .stat-number {
        font-size: 1.2rem;
    }
    
    .features {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .chart-header {
        padding: 8px 10px;
    }
    
    .chart-header h2 {
        font-size: 0.9rem;
    }
    
    .chart-header .price {
        font-size: 1.1rem;
    }
    
    .prediction-panel {
        padding: 10px;
    }
    
    .prediction-card {
        padding: 14px;
    }
    
    .indicator-list {
        grid-template-columns: 1fr;
    }
    
    .pair-selector select {
        width: 100%;
        min-width: auto;
    }
    
    .signal-result {
        padding: 20px;
    }
}

@media (max-width: 380px) {
    .live-pairs-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-menu a {
        padding: 5px 7px;
        font-size: 0.7rem;
    }
}

/* Utility */
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-blue { color: var(--accent-blue); }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.hidden { display: none !important; }
.flex { display: flex; }
.gap-10 { gap: 10px; }
.flex-wrap { flex-wrap: wrap; }
