/* ==================== GENERAL STYLES ==================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1e1f2e;
    --secondary-color: #2d2e47;
    --accent-color: #00d4ff;
    --success-color: #00ff88;
    --danger-color: #ff0055;
    --warning-color: #ffaa00;
    --neutral-color: #888;
    --text-light: #f0f0f0;
    --text-dark: #1a1a1a;
    --border-color: #3a3b54;
    --background: #0f1419;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background);
    color: var(--text-light);
    line-height: 1.6;
}

.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 100%;
}

/* ==================== HEADER ==================== */

.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-bottom: 2px solid var(--accent-color);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.1);
}

.header-content h1 {
    font-size: 28px;
    margin-bottom: 5px;
    color: var(--accent-color);
}

.header-content p {
    font-size: 12px;
    color: var(--neutral-color);
}

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 212, 255, 0.1);
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid var(--accent-color);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success-color);
    animation: pulse 2s infinite;
}

.status-dot.disconnected {
    background-color: var(--danger-color);
    animation: none;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ==================== MAIN GRID LAYOUT ==================== */

.main-grid {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 20px;
    padding: 20px;
    flex: 1;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Responsive: Mobile */
@media (max-width: 1024px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
    .sidebar, .sidebar-right {
        order: 2;
    }
    .content {
        order: 1;
    }
}

/* ==================== SIDEBARS ==================== */

.sidebar, .sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar-right {
    position: sticky;
    top: 20px;
    height: fit-content;
}

/* ==================== CARDS ==================== */

.card-base {
    background: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.price-card, .signal-card, .action-card, .info-card,
.indicator-card, .sm-card, .update-log, .settings-card, .disclaimer {
    @extend .card-base;
}

/* Price Card */
.price-card h2, .signal-card h2, .action-card h2, .info-card h2 {
    font-size: 14px;
    color: var(--accent-color);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.price-display {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.price {
    font-size: 32px;
    font-weight: bold;
    color: var(--text-light);
}

.price-change {
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(0, 255, 136, 0.2);
    color: var(--success-color);
}

.price-change.negative {
    background: rgba(255, 0, 85, 0.2);
    color: var(--danger-color);
}

/* Signal Card */
.main-signal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.main-signal.buy {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.2) 0%, rgba(0, 212, 255, 0.1) 100%);
    border: 2px solid var(--success-color);
    color: var(--success-color);
}

.main-signal.sell {
    background: linear-gradient(135deg, rgba(255, 0, 85, 0.2) 0%, rgba(255, 170, 0, 0.1) 100%);
    border: 2px solid var(--danger-color);
    color: var(--danger-color);
}

.main-signal.neutral {
    background: linear-gradient(135deg, rgba(136, 136, 136, 0.1) 0%, rgba(100, 100, 120, 0.1) 100%);
    border: 2px solid var(--neutral-color);
    color: var(--neutral-color);
}

.signal-confidence {
    font-size: 12px;
    opacity: 0.8;
}

.signal-text {
    flex: 1;
}

/* Action Card */
.recommendation {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-light);
    font-style: italic;
}

/* Info Card */
.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
}

.info-row span:first-child {
    color: var(--neutral-color);
}

.info-row span:last-child {
    color: var(--accent-color);
    font-weight: bold;
}

/* ==================== MAIN CONTENT ==================== */

.content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Timeframe Selector */
.timeframe-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.tf-btn {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    background: var(--secondary-color);
    color: var(--text-light);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    font-weight: 600;
}

.tf-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.tf-btn.active {
    background: var(--accent-color);
    color: var(--text-dark);
    border-color: var(--accent-color);
}

/* Targets Section */
.targets-section h2, .indicators-section h2, .smart-money-section h2, .orderbook-section h2 {
    font-size: 16px;
    color: var(--accent-color);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.targets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.target-box {
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.target-box.stop-loss {
    border-color: var(--danger-color);
    background: rgba(255, 0, 85, 0.1);
}

.target-box.target {
    border-color: var(--success-color);
    background: rgba(0, 255, 136, 0.1);
}

.target-box.info {
    border-color: var(--accent-color);
    background: rgba(0, 212, 255, 0.1);
}

.target-box .label {
    font-size: 11px;
    color: var(--neutral-color);
    text-transform: uppercase;
    margin-bottom: 5px;
}

.target-box .value {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-light);
}

/* ==================== INDICATORS SECTION ==================== */

.indicators-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.indicator-card {
    @extend .card-base;
}

.indicator-card h3 {
    font-size: 13px;
    color: var(--accent-color);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.indicator-card canvas {
    width: 100% !important;
    height: auto !important;
    margin-bottom: 8px;
}

.indicator-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 12px;
}

.indicator-value .value {
    font-weight: bold;
    color: var(--text-light);
}

.signal-badge, .trend-badge, .volatility-badge, .bias-badge, .oi-signal-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.signal-badge.buy, .trend-badge.uptrend, .bias-badge.bullish {
    background: rgba(0, 255, 136, 0.2);
    color: var(--success-color);
}

.signal-badge.sell, .trend-badge.downtrend, .bias-badge.bearish {
    background: rgba(255, 0, 85, 0.2);
    color: var(--danger-color);
}

.signal-badge.neutral, .trend-badge.sideways {
    background: rgba(136, 136, 136, 0.2);
    color: var(--neutral-color);
}

.volatility-badge.high {
    background: rgba(255, 170, 0, 0.2);
    color: var(--warning-color);
}

.volatility-badge.low {
    background: rgba(0, 212, 255, 0.2);
    color: var(--accent-color);
}

.volatility-badge.moderate {
    background: rgba(136, 136, 136, 0.2);
    color: var(--neutral-color);
}

.bb-info, .sr-info, .trend-info, .volatility-info, .sm-status, .ob-info {
    font-size: 12px;
    line-height: 1.8;
}

.bb-info div, .sr-info div, .trend-info div, .volatility-info div,
.sm-status div, .ob-info div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.bb-position {
    color: var(--accent-color);
    font-weight: bold;
}

.bb-info span, .sr-info span, .trend-info span, .volatility-info span,
.sm-status span, .ob-info span {
    color: var(--accent-color);
    font-weight: bold;
}

/* ==================== SMART MONEY SECTION ==================== */

.sm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.sm-card {
    @extend .card-base;
}

.sm-card h3 {
    font-size: 13px;
    color: var(--accent-color);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.sm-status {
    font-size: 12px;
    line-height: 1.8;
}

/* ==================== UPDATE LOG ==================== */

.update-log {
    @extend .card-base;
}

.update-log h2 {
    font-size: 14px;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.update-items {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column-reverse;
}

.update-item {
    padding: 8px;
    border-bottom: 1px solid var(--border-color);
    font-size: 11px;
    color: var(--neutral-color);
    word-wrap: break-word;
}

.update-item:last-child {
    border-bottom: none;
}

.update-item.success {
    color: var(--success-color);
    background: rgba(0, 255, 136, 0.05);
}

.update-item.error {
    color: var(--danger-color);
    background: rgba(255, 0, 85, 0.05);
}

/* ==================== SETTINGS CARD ==================== */

.settings-card {
    @extend .card-base;
}

.settings-card h2, .disclaimer {
    font-size: 14px;
    color: var(--accent-color);
}

.setting {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
}

.setting label {
    color: var(--neutral-color);
}

.setting input[type="number"] {
    padding: 6px;
    border: 1px solid var(--border-color);
    background: var(--secondary-color);
    color: var(--text-light);
    border-radius: 4px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input {
    cursor: pointer;
}

#refresh-btn {
    padding: 8px 12px;
    background: var(--accent-color);
    color: var(--text-dark);
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#refresh-btn:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

/* ==================== DISCLAIMER ==================== */

.disclaimer {
    @extend .card-base;
    background: rgba(255, 170, 0, 0.1);
    border: 1px solid var(--warning-color);
}

.disclaimer p {
    font-size: 11px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.disclaimer p:last-child {
    margin-bottom: 0;
}

/* ==================== FOOTER ==================== */

.footer {
    background: var(--primary-color);
    border-top: 1px solid var(--border-color);
    padding: 15px;
    text-align: center;
    font-size: 11px;
    color: var(--neutral-color);
}

.footer p {
    margin-bottom: 5px;
}

/* ==================== ANIMATIONS ==================== */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.update-item {
    animation: slideIn 0.3s ease;
}

/* ==================== SCROLLBAR STYLING ==================== */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--primary-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}
