/* Scanner Specific Styles */
body {
    background-color: #0b0e14;
    color: #e2e8f0;
}
.scanner-container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 2vw;
    box-sizing: border-box;
}
.scanner-header {
    text-align: center;
    margin-bottom: 30px;
}
.scanner-header h1 {
    font-size: 2.2rem;
    color: #d4af37;
    margin-bottom: 10px;
}
.scanner-header h1 i {
    margin-right: 10px;
}
.scanner-header p {
    color: #94a3b8;
    font-size: 1.1rem;
}

/* Auth Overlay */
.auth-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
}
.auth-modal {
    background: #111827;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.5);
}
.auth-icon {
    font-size: 3rem;
    color: #d4af37;
    margin-bottom: 20px;
}
.auth-modal h2 {
    color: #fff;
    margin-bottom: 10px;
}
.auth-modal p {
    color: #94a3b8;
    margin-bottom: 25px;
}
.auth-modal button {
    width: 100%;
    margin-bottom: 10px;
    padding: 12px;
}
.blur-content {
    filter: blur(10px);
    pointer-events: none;
    user-select: none;
}

/* Chart */
.chart-section {
    height: 450px;
    background: #111827;
    border: 1px solid #1e293b;
    border-radius: 12px;
    margin-bottom: 25px;
    overflow: hidden;
}
#tv_chart_container {
    width: 100%;
    height: 100%;
}

/* Controls */
.controls-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #111827;
    padding: 15px 20px;
    border-radius: 12px;
    border: 1px solid #1e293b;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}
.filter-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}
.search-box {
    position: relative;
}
.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
}
.search-box input {
    background: #0f172a;
    border: 1px solid #334155;
    color: #fff;
    padding: 10px 15px 10px 35px;
    border-radius: 6px;
    outline: none;
    transition: all 0.2s;
    width: 250px;
}
.search-box input:focus {
    border-color: #d4af37;
}
.filter-select {
    background: #0f172a;
    border: 1px solid #334155;
    color: #fff;
    padding: 10px 15px;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
}
.actions-group {
    display: flex;
    align-items: center;
    gap: 20px;
}
.result-count {
    color: #94a3b8;
    font-size: 0.9rem;
}
#scanBtn {
    padding: 10px 20px;
    border-radius: 6px;
    border: none;
    background: #d4af37;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}
#scanBtn:hover {
    background: #b39129;
}
#scanBtn:disabled {
    background: #475569;
    cursor: not-allowed;
    color: #94a3b8;
}

/* Progress Bar */
.progress-wrapper {
    position: relative;
    margin-bottom: 20px;
}
.progress-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    height: 3px;
    overflow: hidden;
    position: relative;
    border: none;
    width: 100%;
}
.progress-fill {
    height: 100%;
    background: #F8B03D;
    box-shadow: 0 0 8px rgba(248, 176, 61, 0.6);
    width: 0%;
    transition: width 0.3s ease;
}
.progress-status {
    position: absolute;
    top: -22px;
    right: 0;
    font-size: 11px;
    color: #64748b;
    font-family: monospace;
}

/* Table */
.table-responsive {
    overflow-x: auto;
    background: #111827;
    border-radius: 12px;
    border: 1px solid #1e293b;
}
.scanner-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
    font-size: 0.9rem;
}
.scanner-table th {
    background: #0f172a;
    color: #94a3b8;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid #1e293b;
    white-space: nowrap;
}
.scanner-table td {
    padding: 15px;
    border-bottom: 1px solid #1e293b;
    vertical-align: middle;
}
.scanner-table tr {
    transition: background 0.2s;
    cursor: pointer;
}
.scanner-table tr:hover, .scanner-table tr.active-row {
    background: #1e293b;
}
.scanner-table tr.has-signal {
    background: rgba(212, 175, 55, 0.05);
}
.scanner-table tr.has-signal:hover, .scanner-table tr.active-row {
    background: rgba(212, 175, 55, 0.15);
}

.text-gold { color: #d4af37; font-weight: bold; }
.text-green { color: #10b981; }
.text-red { color: #ef4444; }

/* Signal Cell */
.tf-cell {
    min-width: 110px;
}
.sig-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
}
.sig-bst { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.sig-sst { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }
.sig-bmtf { background: rgba(6, 182, 212, 0.2); color: #06b6d4; border: 1px solid rgba(6, 182, 212, 0.3); }
.sig-smtf { background: rgba(244, 63, 94, 0.2); color: #f43f5e; border: 1px solid rgba(244, 63, 94, 0.3); }

.sig-time {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 2px;
}

/* Customizing AG Grid to match Zenith theme */
.ag-theme-alpine-dark {
    --ag-background-color: #111827;
    --ag-header-background-color: #0f172a;
    --ag-odd-row-background-color: #111827;
    --ag-border-color: #1e293b;
    --ag-row-border-color: #1e293b;
    --ag-header-foreground-color: #94a3b8;
    --ag-font-family: inherit;
    --ag-font-size: 0.85rem;
    --ag-row-hover-color: #1e293b;
    --ag-selected-row-background-color: rgba(212, 175, 55, 0.2);
}
.ag-theme-alpine-dark .ag-header-cell-label {
    font-weight: 600;
}
.ag-theme-alpine-dark .ag-cell {
    display: flex;
    align-items: center;
}

/* AG Grid custom font sizing for more data density */
.ag-theme-alpine-dark {
    --ag-font-size: 13px !important;
    --ag-header-height: 40px !important;
    --ag-row-height: 38px !important;
    --ag-cell-horizontal-padding: 10px !important;
}
.ag-theme-alpine-dark .ag-header-cell-label {
    font-size: 12.5px !important;
}



/* ====== 25% DOWN-SCALE OVERRIDES ====== */
.scanner-container {
    padding: 1rem 1vw !important; /* Tràn viền tối đa */
    margin-top: 0 !important;
}
.controls-section {
    padding: 8px 12px !important;
    margin-bottom: 8px !important;
    gap: 8px !important;
}
.filter-group {
    gap: 8px !important;
}
.filter-select, .search-box input {
    padding: 4px 8px !important;
    font-size: 0.75rem !important; /* Nhỏ gọn hơn */
}
.search-box i {
    left: 8px !important;
    font-size: 0.75rem !important;
}
.search-box input {
    padding-left: 24px !important;
}
.actions-group {
    gap: 8px !important;
}
.actions-group .btn-primary {
    padding: 4px 12px !important;
    font-size: 0.75rem !important;
}
.result-count {
    font-size: 0.75rem !important;
}
h2[data-translate="list_title"] {
    font-size: 0.9rem !important;
}
.grid-toolbar {
    padding: 2px 4px !important;
}
.toolbar-btn {
    padding: 3px !important;
    font-size: 0.75rem !important;
}

/* AG Grid Ultra Compact Scale Down */
.ag-theme-alpine-dark {
    --ag-font-size: 10px !important; /* Siêu nhỏ gọn */
    --ag-header-height: 30px !important;
    --ag-row-height: 26px !important; /* Rất hẹp, để hiện nhiều dòng */
    --ag-cell-horizontal-padding: 8px !important;
    --ag-list-item-height: 20px !important;
    --ag-icon-size: 10px !important;
}
/* Giảm padding bên trong header của bảng để nó không bị ép chữ */
.ag-theme-alpine-dark .ag-header-cell {
    padding-left: 6px !important;
    padding-right: 6px !important;
}
.ag-theme-alpine-dark .ag-cell {
    padding-left: 6px !important;
    padding-right: 6px !important;
}
/* ====================================== */

/* Bulletproof font size for cells */
.ag-theme-alpine-dark .ag-cell, 
.ag-theme-alpine-dark .ag-header-cell-text,
.ag-theme-alpine-dark .ag-header-cell {
    font-size: 11px !important;
}

/* Make entire scanner page controls transparent to match tracker */
.controls-section {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.search-box input, .filter-select {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.search-box input:focus, .filter-select:focus {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(212, 175, 55, 0.5) !important;
}

/* Make ag-Grid pagination transparent */
.ag-theme-alpine-dark .ag-paging-panel {
    background-color: transparent !important;
    border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
}

/* Make inputs completely transparent */
.search-box input, .filter-select {
    background: transparent !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}
.search-box input:focus, .filter-select:focus {
    background: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(212, 175, 55, 0.5) !important;
}

/* Scale auth modal to 100% match tracker.html modal dimensions */
#authOverlay .modal-header {
    padding: 1.25rem 1.5rem !important;
}
#authOverlay .modal-header h3 {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
}
#authOverlay .modal-body {
    padding: 1.5rem !important;
}
#authOverlay .modal-footer {
    padding: 1rem 1.5rem !important;
    gap: 0.75rem !important;
}
#authOverlay .form-group label {
    font-size: 0.75rem !important;
    margin-bottom: 0.5rem !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
}
#authOverlay .form-control {
    padding: 0.6rem 0.8rem !important;
    font-size: 0.875rem !important;
    border-radius: 6px !important;
    height: auto !important;
}
#authOverlay .btn {
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
    height: auto !important;
    width: auto !important;
}
