/* Loại bỏ padding của container chính trên trang bảng giá để tối ưu diện tích */
.page-modern-board .container.layout-fluid {
    padding: 5px !important;
}


.modern-board-wrap {
    width: 100%;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    height: calc(100vh - 55px);
}

/* Tablet (có mobile ticker nhưng không có bottom nav) */
@media (min-width: 769px) and (max-width: 1024px) {
    .modern-board-wrap {
        height: calc(100vh - 55px - 35px);
    }
}

@media (max-width: 768px) {
    .modern-board-wrap {
        /* Mobile thêm bottom nav (65px) và mobile ticker (35px) */
        height: calc(100vh - 55px - 35px - 65px - env(safe-area-inset-bottom));
    }
}

/* Board Layout */
.board-scroll-wrapper {
    overflow-x: auto;
    padding: 10px 10px 4px 10px;
    /* Giảm padding để tối ưu không gian hiển thị */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.board-scroll-wrapper::-webkit-scrollbar {
    height: 6px;
}

.board-scroll-wrapper::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.board-grid {
    display: flex;
    gap: 20px;
    min-width: max-content;
    height: 100%;
    align-items: stretch;
}

/* Industry Columns - Optimized for compactness */
.industry-column.db-card {
    width: 225px;
    /* Thu hẹp độ rộng cột */
    padding: 0 !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    box-shadow: var(--neumorph-shadow) !important;
    border: 1px solid var(--border-color-light);
    border-radius: var(--card-radius) !important;
    /* Thêm Border Radius chuẩn */
    height: 100%;
}

html.dark-mode .industry-column.db-card {
    border: 1px solid var(--border-color-light);
}

/* Lược bỏ hiệu ứng hover transform theo yêu cầu */
.industry-column:hover {
    transform: none;
}

.industry-header {
    padding: 10px 15px;
    /* Giảm padding */
    border-bottom: 1px solid var(--border-color-divider);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-header);
}

.industry-title {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-color-dark);
}

.industry-perf {
    font-size: 0.85rem;
    font-weight: 700;
}

.stock-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    /* Dành cho Firefox: Mặc định ẩn scrollbar */
    scrollbar-width: none;
    scrollbar-color: transparent transparent;
}

/* Hiện scrollbar cho Firefox khi hover vào cột */
.industry-column:hover .stock-list,
.stock-list:hover {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

/* Custom scrollbar cho Chrome, Safari, Edge */
.stock-list::-webkit-scrollbar {
    width: 6px;
}

.stock-list::-webkit-scrollbar-track {
    background: transparent;
}

.stock-list::-webkit-scrollbar-thumb {
    background: transparent;
    /* Mặc định ẩn thanh trượt */
    border-radius: 10px;
}

/* Hiện thanh trượt khi rê chuột vào cột hoặc danh sách */
.industry-column:hover .stock-list::-webkit-scrollbar-thumb,
.stock-list:hover::-webkit-scrollbar-thumb {
    background: var(--primary-color);
}

.stock-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 4px;
    /* Giảm khoảng cách dọc */
    padding: 0 5px;
    /* Giảm padding bảng */
}

.stock-table th {
    text-align: center;
    /* Căn giữa tiêu đề */
    padding: 6px 4px;
    font-size: 10px;
    color: var(--text-color-light);
    text-transform: uppercase;
    background: var(--bg-body);
    position: sticky;
    top: 0;
    z-index: 1;
}

.stock-table td {
    padding: 6px 4px;
    font-size: 12px;
    border-bottom: none;
    color: #1a1a1a;
    text-align: center;
    /* Căn giữa dữ liệu */
}

/* Bo góc cho dòng */
.stock-row td:first-child {
    border-radius: 6px 0 0 6px;
    padding-left: 8px;
}

.stock-row td:last-child {
    border-radius: 0 6px 6px 0;
    padding-right: 8px;
}

.stock-row {
    transition: background 0.3s ease;
}

.stock-row:hover {
    filter: brightness(0.95);
}

.col-symbol {
    font-weight: 500;
    width: 45px;
    color: #000 !important;
}

.col-price {
    font-weight: 500;
    text-align: center;
    /* Đảm bảo căn giữa */
    width: 55px;
    color: #000 !important;
}

.col-change {
    text-align: center;
    /* Đảm bảo căn giữa */
    font-size: 0.8rem;
    font-weight: 500;
    width: 60px;
    color: #000 !important;
}

.col-volume {
    text-align: center;
    /* Đảm bảo căn giữa */
    color: rgba(0, 0, 0, 0.6);
    font-size: 0.7rem;
    font-weight: 400;
    width: 50px;
}

/* Status Bar - Bottom Slim version */
.board-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    /* Thu nhỏ padding */
    border-top: 1px solid var(--border-color-divider);
    margin-top: 0px;
    /* Xóa margin top dư thừa */
    background: transparent;
}

.status-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.market-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-color-light);
}

.status-dot {
    width: 7px;
    height: 7px;
    background: #64748b;
    border-radius: 50%;
}

.status-dot.active {
    background: var(--color-success);
    box-shadow: 0 0 8px rgba(var(--primary-rgb), 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.6;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.update-time {
    font-size: 12px;
    color: var(--text-color-light);
}

.btn-refresh-mini {
    background: transparent;
    border: none;
    color: var(--text-color-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-refresh-mini:hover {
    color: var(--primary-color);
}

/* Color classes */
.up {
    color: var(--color-success) !important;
}

.down {
    color: var(--color-danger) !important;
}

.ref {
    color: var(--color-warning) !important;
}

.ceil {
    color: #d946ef !important;
}

.floor {
    color: #06b6d4 !important;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .board-status-bar {
        flex-direction: row;
        justify-content: space-between;
    }

    .status-left {
        gap: 10px;
    }

    .industry-column.db-card {
        width: 210px;
    }
}

/* Mở rộng Status Bar */
.board-status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-top: 1px solid var(--border-color-divider);
    background: var(--bg-card);
}

.status-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.search-box-mini {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box-mini .search-icon {
    position: absolute;
    left: 10px;
    font-size: 16px;
    color: var(--text-color-light);
}

.search-box-mini input {
    background: var(--bg-body);
    border: 1px solid var(--border-color-divider);
    color: var(--text-color);
    padding: 6px 15px 6px 32px;
    border-radius: 15px;
    font-size: 12px;
    width: 250px;
    outline: none;
    transition: all 0.2s;
}

.search-box-mini input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.1);
}

.status-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.view-toggles-mini {
    display: flex;
    gap: 4px;
    background: var(--bg-body);
    padding: 3px;
    border-radius: 6px;
    border: 1px solid var(--border-color-divider);
}

.view-toggles-mini .btn-toggle {
    background: transparent;
    border: none;
    color: var(--text-color-light);
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.view-toggles-mini .btn-toggle:hover {
    color: var(--text-color);
    background: rgba(128, 128, 128, 0.1);
}

.view-toggles-mini .btn-toggle.active {
    background: var(--primary-color);
    color: #fff;
}

.view-toggles-mini .btn-toggle .material-symbols-outlined {
    font-size: 16px;
}

@media (max-width: 768px) {
    .board-status-bar {
        flex-wrap: nowrap;
        gap: 5px;
        padding: 8px 5px;
    }
    
    .status-left {
        gap: 5px;
    }
    
    .status-center {
        flex: 1; /* Cho phép ô tìm kiếm co giãn */
        margin: 0 5px;
    }
    
    .search-box-mini input {
        width: 100%;
        padding: 6px 10px 6px 28px;
        font-size: 11px;
    }
    
    .search-box-mini .search-icon {
        left: 8px;
        font-size: 14px;
    }
    
    .status-right {
        gap: 5px;
    }
    
    .view-toggles-mini .btn-toggle {
        padding: 4px;
    }
    
    .view-toggles-mini .btn-toggle .material-symbols-outlined {
        font-size: 14px;
    }
    
    .btn-refresh-mini .material-symbols-outlined {
        font-size: 16px;
    }
}

/* Tối ưu chữ trạng thái trên Mobile */
@media (max-width: 768px) {
    .status-text {
        display: none; /* Ẩn chữ "Đang kết nối..." */
    }
    #updateTime {
        font-size: 11px; /* Thu nhỏ thời gian */
    }
    .market-status {
        gap: 0; /* Xóa khoảng trống giữa chấm xanh và chữ (đã ẩn) */
    }
}

/* Fix màu chữ cho chế độ Clean (Tối giản) trong Dark Mode */
.modern-board-wrap.clean-mode .col-symbol {
    color: var(--text-color) !important;
}

.modern-board-wrap.clean-mode .col-volume {
    color: var(--text-color-light) !important;
}
