/* ================================================================
   Binance Trading Scanner - Custom Stylesheet
   Modern Dark Theme with Glassmorphism
   ================================================================ */

:root {
    /* Primary Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;

    /* Accent Colors */
    --success: #10b981;
    --success-light: #34d399;
    --warning: #f59e0b;
    --warning-light: #fbbf24;
    --danger: #ef4444;
    --danger-light: #f87171;
    --info: #06b6d4;
    --info-light: #22d3ee;

    /* Background Colors */
    --bg-dark: #0f0f23;
    --bg-card: rgba(30, 30, 60, 0.7);
    --bg-card-hover: rgba(40, 40, 80, 0.8);
    --bg-gradient: linear-gradient(135deg, #1a1a3e 0%, #0f0f23 100%);

    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #a1a1aa;

    /* Border & Shadow */
    --border-color: rgba(99, 102, 241, 0.2);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --blur: blur(10px);
}

/* ================================================================
   Base Styles
   ================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Override Bootstrap text-muted */
.text-muted {
    color: var(--text-muted) !important;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ================================================================
   Navbar
   ================================================================ */

.navbar {
    background: var(--glass-bg);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--text-primary) !important;
}

.navbar-brand i {
    color: var(--primary-light);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.brand-text {
    background: linear-gradient(135deg, var(--primary-light), var(--success-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
    }

    50% {
        opacity: 0.8;
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
}

.status-text {
    color: var(--success);
    font-weight: 600;
    font-size: 0.85rem;
}

.current-time {
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

/* ================================================================
   Main Content
   ================================================================ */

.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 150px);
}

.dashboard-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.last-update-info {
    background: var(--glass-bg);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    min-width: 180px;
}

.update-time {
    font-weight: 600;
    color: var(--primary-light);
    font-size: 0.95rem;
}

/* ================================================================
   Timeframe Selector
   ================================================================ */

.timeframe-selector {
    background: var(--glass-bg);
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--blur);
}

.btn-timeframe {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-timeframe:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-timeframe.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.5);
}

/* ================================================================
   Recommendation Card
   ================================================================ */

.recommendation-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(16, 185, 129, 0.1));
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    overflow: hidden;
    backdrop-filter: var(--blur);
    box-shadow: var(--shadow-card);
}

.card-header-custom {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--glass-border);
}

.trophy-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(251, 191, 36, 0.5);
    }

    50% {
        box-shadow: 0 0 25px rgba(251, 191, 36, 0.8);
    }
}

.card-header-custom h3 {
    margin: 0;
    font-weight: 700;
    flex-grow: 1;
}

.card-body-custom {
    padding: 1.25rem;
}

.top-signal {
    display: block;
    width: 100%;
}

@media (max-width: 768px) {
    .top-signal {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

.signal-symbol {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-light);
}

.signal-score {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.score-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--warning-light);
}

.signal-explanation {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--success);
}

.signal-explanation p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.signal-explanation .reasons {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.reason-tag {
    background: var(--glass-bg);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

.signal-levels {
    display: grid;
    gap: 0.75rem;
}

.level-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
}

.level-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.level-value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.level-value.entry {
    color: var(--primary-light);
}

.level-value.sl {
    color: var(--danger-light);
}

.level-value.tp {
    color: var(--success-light);
}

/* ================================================================
   Stats Cards
   ================================================================ */

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
    backdrop-filter: var(--blur);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: white;
}

.stat-icon.bg-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.stat-icon.bg-success {
    background: linear-gradient(135deg, var(--success), #059669);
}

.stat-icon.bg-warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
}

.stat-icon.bg-info {
    background: linear-gradient(135deg, var(--info), #0891b2);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ================================================================
   Section Header
   ================================================================ */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h4 {
    margin: 0;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

/* ================================================================
   Signal Cards
   ================================================================ */

.signal-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    height: 100%;
    backdrop-filter: var(--blur);
}

.signal-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-5px);
    box-shadow: var(--shadow-glow);
    border-color: var(--primary);
}

.signal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.signal-pair {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.signal-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.signal-badge.score-high {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
}

.signal-badge.score-medium {
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: white;
}

.signal-badge.score-low {
    background: linear-gradient(135deg, var(--info), #0891b2);
    color: white;
}

.signal-card-body {
    display: grid;
    gap: 0.5rem;
}

.signal-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.signal-row .label {
    color: var(--text-muted);
}

.signal-row .value {
    font-weight: 500;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.signal-row .value.positive {
    color: var(--success-light);
}

.signal-row .value.negative {
    color: var(--danger-light);
}

.signal-card-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.rr-ratio {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rr-bar {
    flex-grow: 1;
    height: 6px;
    background: var(--glass-bg);
    border-radius: 3px;
    overflow: hidden;
}

.rr-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), var(--success-light));
    border-radius: 3px;
    transition: width 0.5s ease;
}

.rr-value {
    font-weight: 600;
    color: var(--success-light);
    min-width: 60px;
    text-align: right;
}

/* ================================================================
   Modal
   ================================================================ */

.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
}

.modal-header {
    border-bottom: 1px solid var(--glass-border);
    padding: 1.5rem 2rem;
}

.modal-title {
    font-weight: 700;
    color: var(--primary-light);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border-top: 1px solid var(--glass-border);
    padding: 1.5rem 2rem;
}

.btn-close {
    filter: invert(1);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 576px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

.detail-item {
    background: var(--glass-bg);
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.detail-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.detail-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ================================================================
   Empty State
   ================================================================ */

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    width: 80px;
    height: 80px;
    background: var(--glass-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: var(--text-muted);
}

.empty-state h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto 1rem;
}

.empty-state code {
    background: var(--glass-bg);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: var(--primary-light);
}

/* ================================================================
   Loading State
   ================================================================ */

.loading-state {
    text-align: center;
    padding: 3rem;
}

.loading-state p {
    margin-top: 1rem;
    color: var(--text-muted);
}

/* ================================================================
   Footer
   ================================================================ */

.footer {
    background: var(--glass-bg);
    border-top: 1px solid var(--glass-border);
    backdrop-filter: var(--blur);
}

/* ================================================================
   Scrollbar
   ================================================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* ================================================================
   Animations
   ================================================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.signal-card {
    animation: fadeIn 0.5s ease forwards;
}

.signal-card:nth-child(1) {
    animation-delay: 0.1s;
}

.signal-card:nth-child(2) {
    animation-delay: 0.2s;
}

.signal-card:nth-child(3) {
    animation-delay: 0.3s;
}

.signal-card:nth-child(4) {
    animation-delay: 0.4s;
}

.signal-card:nth-child(5) {
    animation-delay: 0.5s;
}

.signal-card:nth-child(6) {
    animation-delay: 0.6s;
}

/* ================================================================
   Responsive
   ================================================================ */

@media (max-width: 768px) {
    .page-title {
        font-size: 1.8rem;
    }

    .btn-timeframe {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .card-body-custom {
        padding: 1.5rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.4rem;
    }
}

/* ================================================================
   News Grid (Dashboard)
   ================================================================ */

.news-carousel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem;
    backdrop-filter: var(--blur);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.news-mini-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1rem;
    border-left: 3px solid var(--text-muted);
    transition: all 0.3s ease;
    cursor: pointer;
}

.news-mini-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.4);
}

.news-mini-card.bullish {
    border-left-color: var(--success);
}

.news-mini-card.bearish {
    border-left-color: var(--danger);
}

.news-mini-card.neutral {
    border-left-color: var(--info);
}

.news-mini-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
}

.news-mini-header .news-source {
    color: var(--primary-light);
    font-weight: 600;
}

.news-mini-header .news-time {
    color: var(--text-muted);
}

.news-mini-title {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-mini-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.crypto-tags-mini {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.crypto-mini-tag {
    background: var(--primary);
    color: white;
    padding: 0.15rem 0.4rem;
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 600;
}

.impact-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 0.7rem;
}

.impact-badge.high {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-light);
}

@media (max-width: 576px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
}