/* ===========================================================
   Pattern Scanner Card Styling - Professional Layout
=========================================================== */

/* Card Container */
.signal-card {
    background: linear-gradient(145deg, #1a1a1a, #0e0e0e);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.signal-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.8);
}

/* Bullish/Bearish Border */
.bullish-card {
    border: 2px solid #00ff6a;
}
.bearish-card {
    border: 2px solid #ff3b3b;
}

/* Header: Logo + Name + Timeframe */
.signal-header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.signal-header img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
}
.coin-meta {
    display: flex;
    flex-direction: column;
}
.coin-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}
.timeframe-badge {
    background: #f49d25;
    color: #000;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 6px;
    margin-top: 3px;
    width: fit-content;
}

/* Pattern Name */
.pattern-name {
    font-size: 18px;
    font-weight: bold;
    color: #f49d25;
    margin-top: 4px;
    line-height: 1.3;
}
.pattern-name small {
    display: block;
    font-size: 12px;
    color: #bbb;
    margin-top: 3px;
    font-style: italic;
}

/* Confidence Badge */
.confidence-badge {
    background: #222;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    padding: 6px 10px;
    border-radius: 8px;
    display: inline-block;
}

/* Stats Section */
.signal-stats {
    display: flex;
    justify-content: space-between;
    background: #111;
    padding: 8px;
    border-radius: 8px;
    font-size: 13px;
    color: #ccc;
    gap: 6px;
    flex-wrap: wrap;
}
.signal-stats span {
    background: #181818;
    padding: 4px 8px;
    border-radius: 6px;
}

/* Chart Container */
.signal-chart {
    background: #121212;
    border-radius: 10px;
    padding: 8px;
}
.chart-notation {
    font-size: 11px;
    color: #aaa;
    margin-bottom: 6px;
    text-align: center;
}
.chart-container {
    width: 100%;
    height: 220px;
}

/* Loader (unchanged) */
.loader-container {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    color: #fff;
}
.loader {
    border: 6px solid #333;
    border-top: 6px solid #f49d25;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}
@keyframes spin {
    100% { transform: rotate(360deg); }
}

/* Confidence Pulse Animations (unchanged) */
.pulse-strong-green {
    animation: pulseGreen 1.5s infinite;
}
.pulse-strong-red {
    animation: pulseRed 1.5s infinite;
}
@keyframes pulseGreen {
    0%,100% { box-shadow: 0 0 10px rgba(0, 255, 106, 0.7); }
    50% { box-shadow: 0 0 25px rgba(0, 255, 106, 1); }
}
@keyframes pulseRed {
    0%,100% { box-shadow: 0 0 10px rgba(255, 59, 59, 0.7); }
    50% { box-shadow: 0 0 25px rgba(255, 59, 59, 1); }
}

/* Responsive */
@media screen and (max-width: 768px) {
    #patternGrid {
        grid-template-columns: 1fr;
    }
    .signal-card {
        margin: 0 auto;
        max-width: 95%;
    }
}
/* ===========================================================
   Filter Bar Styling (Tabs, Dropdowns, Button)
=========================================================== */
.scanner-filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 12px 20px;
    background: #111;
    border-bottom: 2px solid #222;
    border-radius: 8px;
    margin-bottom: 16px;
}

/* Tabs */
.timeframe-tabs {
    display: flex;
    gap: 6px;
}
.tab-btn {
    background: #222;
    color: #fff;
    border: 1px solid #333;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
}
.tab-btn:hover {
    background: #333;
}
.tab-btn.active {
    background: #f49d25;
    color: #000;
}

/* Dropdowns */
.filter-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}
.filter-controls select {
    background: #111;
    color: #fff;
    border: 1px solid #333;
    padding: 6px 10px;
    font-size: 14px;
    border-radius: 6px;
}

/* Refresh Button */
.refresh-btn {
    background: #f49d25;
    color: #000;
    font-weight: bold;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}
.refresh-btn:hover {
    background: #ffae42;
}
/* ===========================================================
   1. Grid Layout for 4 Cards Per Row
=========================================================== */
#patternGrid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* ✅ 4 cards per row */
    gap: 20px;
    padding: 20px;
}
@media screen and (max-width: 1024px) {
    #patternGrid {
        grid-template-columns: repeat(2, 1fr); /* ✅ 2 per row on tablets */
    }
}
@media screen and (max-width: 600px) {
    #patternGrid {
        grid-template-columns: 1fr; /* ✅ 1 per row on mobile */
    }
}

/* ===========================================================
   2. Pulsating Glow Animations for Confidence ≥ 75%
=========================================================== */
.pulse-strong-green {
    animation: pulseGreen 1.5s infinite;
}
.pulse-strong-red {
    animation: pulseRed 1.5s infinite;
}
@keyframes pulseGreen {
    0% { box-shadow: 0 0 10px rgba(0, 255, 106, 0.6); }
    50% { box-shadow: 0 0 25px rgba(0, 255, 106, 1); }
    100% { box-shadow: 0 0 10px rgba(0, 255, 106, 0.6); }
}
@keyframes pulseRed {
    0% { box-shadow: 0 0 10px rgba(255, 59, 59, 0.6); }
    50% { box-shadow: 0 0 25px rgba(255, 59, 59, 1); }
    100% { box-shadow: 0 0 10px rgba(255, 59, 59, 0.6); }
}

/* ===========================================================
   3. Filter Bar Styling (Professional Look)
=========================================================== */
.scanner-filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 14px 20px;
    background: #111;
    border-bottom: 2px solid #222;
    border-radius: 8px;
    margin-bottom: 18px;
}

/* Tabs */
.timeframe-tabs {
    display: flex;
    gap: 8px;
}
.tab-btn {
    background: #222;
    color: #fff;
    border: 1px solid #333;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.3s;
}
.tab-btn:hover {
    background: #333;
}
.tab-btn.active {
    background: #f49d25;
    color: #000;
}

/* Dropdowns */
.filter-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}
.filter-controls select {
    background: #111;
    color: #fff;
    border: 1px solid #333;
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 6px;
}

/* Refresh Button */
.refresh-btn {
    background: #f49d25;
    color: #000;
    font-weight: bold;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.3s ease;
}
.refresh-btn:hover {
    background: #ffae42;
}
/* ===========================================================
   4. Compact Chart & Stats Layout for Cleaner Cards
=========================================================== */

/* Reduce chart height for better balance */
.chart-container {
    width: 100%;
    height: 180px; /* ✅ Down from 220px for a tighter layout */
}

/* Chart wrapper padding */
.signal-chart {
    background: #121212;
    border-radius: 8px;
    padding: 6px;
    margin-top: 6px;
}

/* Improve stats alignment */
.signal-stats {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    background: #111;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #ccc;
    margin-top: 8px;
}
.signal-stats span {
    flex: 1;
    text-align: center;
    background: #181818;
    padding: 4px 6px;
    border-radius: 4px;
}

/* Pattern name styling tweak for better hierarchy */
.pattern-name {
    font-size: 18px;
    font-weight: bold;
    color: #f49d25;
    margin-top: 8px;
    line-height: 1.3;
}

/* Confidence badge emphasis */
.confidence-badge {
    display: inline-block;
    margin-top: 4px;
    background: #222;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    color: #fff;
}
.no-pattern {
    grid-column: 1 / -1; /* ✅ Spans full width of the grid */
    text-align: center;
    font-size: 18px;
    font-weight: 500;
    color: #ccc;
    margin-top: 40px;
    display: block;
}

.signal-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.signal-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.8);
}
.confidence-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}
.pattern-date {
    font-size: 12px;
    color: #999;
}
.signal-chart {
    background: #121212;
    border-radius: 8px;
    padding: 6px;
    margin-top: 6px;
    overflow: hidden; /* ✅ Prevents chart labels from spilling out */
    position: relative;
}
.chart-container {
    width: 100%;
    height: 180px;
    overflow: hidden; /* ✅ Ensures nothing leaks outside */
}
.chart-notation {
    font-size: 12px;
    color: #4da6ff; /* ✅ Blue for better contrast */
    font-weight: 600;
    text-align: center;
    margin-bottom: 6px;
}
/* ====== Dropdown Styling for Filters ====== */
#patternFilter, #confidenceLevel {
    background: #111;
    color: #fff;
    border: 1px solid #333;
    padding: 6px 12px;
    font-size: 14px;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
}

/* On hover and focus */
#patternFilter:focus, #confidenceLevel:focus {
    border-color: #f49d25;
    box-shadow: 0 0 6px rgba(244, 157, 37, 0.6);
}

/* Style options inside dropdown */
#patternFilter option:hover,
#confidenceLevel option:hover {
    background-color: #f49d25 !important;
    color: #000 !important;
}

/* Custom Scrollbar for Dropdown */
select::-webkit-scrollbar {
    width: 8px;
}
select::-webkit-scrollbar-track {
    background: #111;
}
select::-webkit-scrollbar-thumb {
    background: #f49d25;
    border-radius: 6px;
}
.timeframe-badge {
    font-size: 12px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 6px;
    color: #000;
}
.badge-1h { background: #3aa8ff; }
.badge-4h { background: #a56eff; }
.badge-1d { background: #00ff6a; }
.badge-1w { background: #f49d25; }

.trend-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: bold;
}

.trend-label {
    font-size: 14px;
}

.pattern-date {
    font-size: 12px;
    color: #bbb;
}
/* ───────────── Info Icon + Tooltip ───────────── */
.info-icon {
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto; /* pushes to far right */
}

.info-tooltip {
    position: absolute;
    background: #111;
    color: #fff;
    border: 1px solid #f49d25;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    max-width: 220px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
    display: none;
}

.affiliate-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 20px; /* spacing from filters */
    flex-wrap: nowrap;
}

.affiliate-text {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    margin-right: 6px;
}

.affiliate-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
    background: #111;
    border-radius: 6px;
    padding: 4px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.affiliate-icon:hover {
    transform: scale(1.15);
    box-shadow: 0 0 8px rgba(255, 165, 0, 0.6);
}

/* Mobile: Stack icons below filters */
@media (max-width: 992px) {
    .affiliate-bar {
        margin-left: 0;
        margin-top: 10px;
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
    }
}

/* Default icon size (desktop) */
.affiliate-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 4px;
    transition: transform 0.2s ease;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .affiliate-bar {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .affiliate-text {
        width: 100%;
        text-align: center;
        margin-bottom: 6px;
    }

    .affiliate-icon {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .affiliate-icon {
        width: 18px;
        height: 18px;
    }
}
/* ───────────── Affiliate Banner ───────────── */
.affiliate-banner {
    background: #1a1a1a;
    color: #f49d25; /* Orange text */
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    padding: 15px 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    border-bottom: 2px solid #f49d25;
    letter-spacing: 0.5px;
    transition: box-shadow 0.3s ease;
}

/* Hover effect on entire banner */
.affiliate-banner:hover {
    box-shadow: 0 0 20px rgba(244, 157, 37, 0.6);
}

/* Banner button styling */
.banner-btn {
    display: inline-block;
    background: #f49d25 !important; /* Orange background */
    color: #111 !important; /* Dark text */
    text-decoration: none !important; /* Remove underline */
    padding: 10px 20px;
    font-weight: bold;
    border-radius: 6px;
    font-size: 16px;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.banner-btn:hover {
    background: #ffae40 !important;
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(255, 174, 64, 0.8);
}

/* Responsive adjustments for mobile */
@media (max-width: 600px) {
    .affiliate-banner {
        flex-direction: column; /* Stack text and button vertically */
        gap: 10px;
        text-align: center;
    }

    .banner-btn {
        width: auto;
        font-size: 14px;
        padding: 8px 14px;
    }
}
