@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&family=JetBrains+Mono:wght@500;800&display=swap');

:root {
    --bg: #06080a;
    --glass: rgba(15, 20, 26, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent: #00d4ff;
    --accent-glow: rgba(0, 212, 255, 0.3);
    --bull: #00ffa3;
    --bear: #ff3e3e;
    --fvg-bull: rgba(0, 255, 163, 0.15);
    --fvg-bear: rgba(255, 62, 62, 0.15);
    --text-dim: #848e9c;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg);
    color: #e6e8ea;
    font-family: 'Inter', sans-serif;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Glassmorphism Utility */
.glass-panel {
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

header {
    height: 60px;
    padding: 0 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(11, 14, 18, 0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
}

.logo {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 3px;
    color: #fff;
    text-transform: uppercase;
}

.logo span {
    color: var(--accent);
}

.header-status {
    display: flex;
    align-items: center;
    gap: 25px;
}

.status-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.status-label {
    font-size: 9px;
    text-transform: uppercase;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.status-value {
    font-size: 14px;
    font-weight: 800;
    font-family: 'JetBrains Mono';
}

#live-price-big {
    color: var(--accent);
    font-size: 20px;
}

#main-wrapper {
    flex: 1;
    display: grid;
    grid-template-columns: 340px 1fr;
    overflow: hidden;
}

#sidebar {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    border-right: 1px solid var(--glass-border);
    background: rgba(11, 14, 18, 0.4);
}

.panel-title {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-dim);
    letter-spacing: 1.5px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-title i {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent);
}

#chart-container {
    position: relative;
    overflow: hidden;
}

#chart {
    width: 100%;
    height: 100%;
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stat-card {
    padding: 15px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: 0.3s;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--accent);
}

.stat-val {
    font-size: 20px;
    font-weight: 800;
    font-family: 'JetBrains Mono';
    display: block;
}

.stat-label {
    font-size: 9px;
    color: var(--text-dim);
    text-transform: uppercase;
}

#action-logs {
    height: 180px;
    overflow-y: auto;
    padding-right: 5px;
    border-radius: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.2);
}

/* Custom Scrollbar */
#action-logs::-webkit-scrollbar {
    width: 4px;
}

#action-logs::-webkit-scrollbar-track {
    background: transparent;
}

#action-logs::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.range-container {
    margin: 25px 0 15px;
    position: relative;
    padding: 25px 0 15px;
}

.range-bar-bg {
    height: 6px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 3px;
    display: flex;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.range-sl-half {
    flex: 1;
    background: linear-gradient(to right, rgba(255, 59, 87, 0.4), transparent);
}

.range-tp-half {
    flex: 1;
    background: linear-gradient(to left, rgba(0, 255, 136, 0.4), transparent);
}

.range-point {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.range-point::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    width: 2px;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-50%);
}

.point-sl {
    left: 0;
    color: var(--bear);
    border: 1px solid rgba(255, 59, 87, 0.2);
}

.point-entry {
    left: 50%;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.point-tp {
    left: 100%;
    color: var(--bull);
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.price-indicator {
    position: absolute;
    top: 22px;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 15px var(--accent), 0 0 5px #fff;
    z-index: 5;
    transition: left 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.price-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #fff;
    border-radius: 50%;
    opacity: 0.3;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.price-val {
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    white-space: nowrap;
    background: var(--accent);
    color: #000;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.log-entry {
    margin-bottom: 8px;
    line-height: 1.4;
    padding-left: 10px;
    border-left: 2px solid transparent;
}

.log-entry.new {
    color: var(--accent);
    border-left-color: var(--accent);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

#history-container {
    height: 220px;
    background: rgba(11, 14, 18, 0.9);
    border-top: 1px solid var(--glass-border);
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

th {
    text-align: left;
    padding: 15px 20px;
    color: var(--text-dim);
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.02);
}

td {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-family: 'JetBrains Mono';
}

.badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
}

.badge-win {
    background: rgba(0, 255, 163, 0.1);
    color: var(--bull);
}

.badge-loss {
    background: rgba(255, 62, 62, 0.1);
    color: var(--bear);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* Signal Watcher Panel */
.watcher-card {
    padding: 15px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.05) 0%, rgba(0, 0, 0, 0) 100%);
    border: 1px solid rgba(0, 212, 255, 0.1);
}

.progress-container {
    margin-top: 12px;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

#progress-fill {
    height: 100%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    transition: width 0.5s ease;
}

/* Master Switch Toggle - PRO Design */
.switch-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(160, 174, 192, 0.8);
    /* Muted by default */
    padding: 6px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 140px;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.switch-dot {
    width: 8px;
    height: 8px;
    background: #4a5568;
    border-radius: 50%;
    transition: all 0.4s ease;
}

.switch-btn.active {
    background: rgba(0, 255, 136, 0.15);
    border-color: rgba(0, 255, 136, 0.4);
    color: #00ff88;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.1);
}

.switch-btn.active .switch-dot {
    background: #00ff88;
    box-shadow: 0 0 12px #00ff88;
}

.switch-btn:not(.active):hover {
    background: rgba(255, 62, 62, 0.1);
    border-color: rgba(255, 62, 62, 0.3);
    color: #ff3b57;
}

.switch-btn:not(.active):hover .switch-dot {
    background: #ff3b57;
    box-shadow: 0 0 10px #ff3b57;
}

.switch-btn.loading {
    opacity: 0.4;
    cursor: wait;
    filter: grayscale(0.5);
}

/* 📱 RESPONSIVE MEDIA QUERIES */

@media (max-width: 1024px) {
    #main-wrapper {
        display: flex;
        /* Changed from grid to flex for easy ordering */
        flex-direction: column;
        height: auto;
        overflow: visible;
    }

    #chart-container {
        order: 1;
        /* Move chart to top */
        height: 500px;
        /* Fixed height for chart on mobile */
    }

    #sidebar {
        order: 2;
        /* Move sidebar below chart */
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
        height: auto;
        max-height: none;
    }

    body {
        height: auto;
        overflow-y: auto;
    }

    header {
        height: auto;
        padding: 15px;
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .header-status {
        width: 100%;
        justify-content: space-between;
        gap: 15px;
        flex-wrap: wrap;
    }

    .status-item {
        align-items: flex-start;
    }

    #chart-container {
        height: 500px;
        /* Fixed height for chart on mobile */
    }

    #history-container {
        height: auto;
        max-height: 400px;
    }
}

@media (max-width: 600px) {
    .header-status {
        grid-template-columns: 1fr 1fr;
        display: grid;
    }

    .stat-grid {
        grid-template-columns: 1fr;
    }

    .logo {
        font-size: 12px;
        letter-spacing: 2px;
    }

    #live-price-big {
        font-size: 16px;
    }

    td,
    th {
        padding: 10px;
        font-size: 10px;
    }

    /* Make table scrollable horizontally on very small screens */
    #history-container {
        overflow-x: auto;
    }

    table {
        min-width: 600px;
    }
}