/**
 * TOTRIEU Trading Technicals Styles
 */

/* Main container styles */
.totrieu-trading-table {
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

/* Table styles */
.trend_technicals,
.pivot_levels {
    width: 100%;
    border-collapse: collapse;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.4;
}

/* Header styles */
.trend_technicals thead th,
.pivot_levels thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
    border: none;
}

/* Body cell styles */
.trend_technicals tbody td,
.pivot_levels tbody td {
    padding: 10px 15px;
    border-bottom: 1px solid #e1e5e9;
    vertical-align: middle;
    transition: background-color 0.2s ease;
}

/* Row hover effect */
.trend_technicals tbody tr:hover td,
.pivot_levels tbody tr:hover td {
    background-color: #f8f9fa;
}

/* Striped rows */
.is-style-stripes .trend_technicals tbody tr:nth-child(even) td,
.is-style-stripes .pivot_levels tbody tr:nth-child(even) td {
    background-color: #f8f9fa;
}

.is-style-stripes .trend_technicals tbody tr:nth-child(even):hover td,
.is-style-stripes .pivot_levels tbody tr:nth-child(even):hover td {
    background-color: #e9ecef;
}

/* Indicator column */
.trend_technicals tbody td:first-child,
.pivot_levels tbody td:first-child {
    font-weight: 600;
    color: #495057;
    min-width: 120px;
}

/* Value column */
.trend_technicals tbody td:nth-child(2),
.pivot_levels tbody td:nth-child(2) {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    color: #2c3e50;
    font-weight: 500;
    text-align: right;
    min-width: 100px;
}

/* Action column with color coding */
.trend_technicals tbody td:nth-child(3),
.pivot_levels tbody td:nth-child(3) {
    font-weight: 500;
    min-width: 150px;
}

/* Action color coding */
.trend_technicals tbody td:nth-child(3) {
    border-left: 4px solid transparent;
}

/* Buy signals - Green */
.trend_technicals tbody tr td:nth-child(3):contains("Mua") {
    color: #28a745;
    border-left-color: #28a745;
    background: linear-gradient(90deg, transparent 0%, rgba(40, 167, 69, 0.05) 100%);
}

/* Sell signals - Red */
.trend_technicals tbody tr td:nth-child(3):contains("Bán") {
    color: #dc3545;
    border-left-color: #dc3545;
    background: linear-gradient(90deg, transparent 0%, rgba(220, 53, 69, 0.05) 100%);
}

/* Neutral signals - Blue */
.trend_technicals tbody tr td:nth-child(3):contains("Bình thường"),
.trend_technicals tbody tr td:nth-child(3):contains("Yếu") {
    color: #007bff;
    border-left-color: #007bff;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 123, 255, 0.05) 100%);
}

/* Strong signals */
.trend_technicals tbody tr td:nth-child(3):contains("mạnh") {
    font-weight: 700;
}

/* Trend strength row highlighting */
.trend_technicals tbody tr[style*="font-weight: bold"] {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.05) 100%) !important;
    border-left: 4px solid #667eea;
}

/* Accumulation zone row highlighting */
.trend_technicals tbody tr[style*="background-color: rgba(255, 193, 7"] {
    background: linear-gradient(90deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 193, 7, 0.05) 100%) !important;
    border-left: 4px solid #ffc107;
}

/* Strong trend indicators */
.trend_technicals tbody tr td:nth-child(3):contains("STRONG") {
    font-weight: 700;
    text-transform: uppercase;
}

/* Trend strength colors */
.trend_technicals tbody tr td:nth-child(2):contains("Tăng mạnh") {
    color: #28a745;
    font-weight: 700;
}

.trend_technicals tbody tr td:nth-child(2):contains("Tăng yếu") {
    color: #6c757d;
}

.trend_technicals tbody tr td:nth-child(2):contains("Tích lũy") {
    color: #ffc107;
    font-weight: 600;
}

.trend_technicals tbody tr td:nth-child(2):contains("Giảm yếu") {
    color: #6c757d;
}

.trend_technicals tbody tr td:nth-child(2):contains("Giảm mạnh") {
    color: #dc3545;
    font-weight: 700;
}

/* ADX trend strength styling */
.trend_technicals tbody tr td:nth-child(3):contains("xu hướng") {
    font-style: italic;
}

.trend_technicals tbody tr td:nth-child(3):contains("mạnh") {
    color: #28a745;
    font-weight: 600;
}

.trend_technicals tbody tr td:nth-child(3):contains("yếu") {
    color: #6c757d;
}

.trend_technicals tbody tr td:nth-child(3):contains("sideway") {
    color: #ffc107;
}

/* Accumulation zone specific styling */
.trend_technicals tbody tr td:nth-child(2):contains("Trong vùng tích lũy") {
    background: linear-gradient(90deg, rgba(255, 193, 7, 0.1) 0%, transparent 100%);
    border-radius: 4px;
    padding: 8px 12px;
    font-weight: 500;
}

/* Enhanced pivot point highlighting */
.pivot_levels tbody tr[style*="font-weight:bold"] td {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-left: 4px solid #667eea;
    font-weight: 700 !important;
    position: relative;
}

.pivot_levels tbody tr[style*="font-weight:bold"] td:first-child::before {
    content: "📍 ";
    font-size: 14px;
}

/* Status PP coloring */
.pivot_levels tbody tr td:nth-child(3):contains("Buy") {
    color: #28a745;
    font-weight: 600;
}

.pivot_levels tbody tr td:nth-child(3):contains("Sell") {
    color: #dc3545;
    font-weight: 600;
}

.pivot_levels tbody tr td:nth-child(3):contains("Unknown") {
    color: #6c757d;
    font-style: italic;
}

/* Error and status messages */
.totrieu-trading-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 16px;
    border-radius: 6px;
    margin: 15px 0;
}

.totrieu-trading-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 12px 16px;
    border-radius: 6px;
    margin: 15px 0;
}

.totrieu-trading-info {
    background: #d1ecf1;
    border: 1px solid #b8daff;
    color: #0c5460;
    padding: 12px 16px;
    border-radius: 6px;
    margin: 15px 0;
}

.totrieu-trading-loading {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
}

.totrieu-trading-loading::before {
    content: "⏳ ";
    font-size: 18px;
}

/* Gợi ý CSS cho bảng Confluence Price */
.confluence-price-table {
    border-collapse: collapse;
    width: 100%;
    text-align: center;
}
.confluence-price-table th, .confluence-price-table td {
    padding: 12px;
    border: 1px solid #ddd;
}
.confluence-price-table thead {
    background-color: #f2f2f2;
}

/* --- Styling cho các dòng --- */

/* Dòng giá hiện tại */
.cp_row {
    background-color: #fffbe6 !important; /* Màu vàng nhạt */
    font-weight: bold;
    color: #f57f17;
}

/* Các dòng kháng cự */
.cr_row td:nth-child(2) { color: #d32f2f; font-weight: bold; } /* Màu đỏ cho giá */
.cr_low { opacity: 0.7; }
.cr_mid { opacity: 0.9; }
.cr_high { background-color: rgba(255, 205, 210, 0.7); font-size: 1.1em; } /* Nền đỏ nhạt, chữ to hơn */

/* Các dòng hỗ trợ */
.cs_row td:nth-child(2) { color: #388e3c; font-weight: bold; } /* Màu xanh cho giá */
.cs_low { opacity: 0.7; }
.cs_mid { opacity: 0.9; }
.cs_high { background-color: rgba(204, 255, 204, 0.7); font-size: 1.1em; } /* Nền xanh nhạt, chữ to hơn */

/*--------------------------------------------------------------
# Gauge Chart Styles
--------------------------------------------------------------*/
.totrieu-gauge-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    border: 1px solid #e9ecef;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: inline-block;
    vertical-align: top;
    text-align: center;
    background-color: #fff;
    margin: 10px;
}

.totrieu-gauge-container .gauge-header {
    margin-bottom: 5px;
}

.totrieu-gauge-container .gauge-header h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    color: #343a40;
}

.totrieu-gauge-container .gauge-header small {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
}

.totrieu-gauge-container .gauge-chart {
    position: relative;
}

.totrieu-gauge-container .gauge-center-text {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
    line-height: 1.2;
}

/* Responsive design */
@media (max-width: 768px) {
    .totrieu-trading-table {
        font-size: 12px;
    }
    
    .trend_technicals tbody td,
    .pivot_levels tbody td {
        padding: 8px 10px;
    }
    
    .trend_technicals thead th,
    .pivot_levels thead th {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    /* Stack columns on very small screens */
    @media (max-width: 480px) {
        .trend_technicals,
        .pivot_levels {
            font-size: 11px;
        }
        
        .trend_technicals tbody td:nth-child(2),
        .pivot_levels tbody td:nth-child(2) {
            text-align: left;
        }
    }
}

/* Print styles */
@media print {
    .totrieu-trading-table {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .trend_technicals thead th,
    .pivot_levels thead th {
        background: #000 !important;
        color: white !important;
    }
    
    .trend_technicals tbody tr:hover td,
    .pivot_levels tbody tr:hover td {
        background-color: transparent !important;
    }
}

