/**
 * donhang-proxy.css — Style riêng cho trang đơn hàng proxy IPv4 Vietnam
 * Thư mục: mua/css/donhang-proxy.css
 *
 * Gồm:
 *   - Proxy Clear Table (.proxy-clear-table)
 *   - #proxyTable column widths
 *   - Compact .table spacing
 *   - .table-responsive
 *   - .form-check-input sizing
 *   - Responsive media queries (mobile / tablet / desktop)
 *
 * Cách dùng:
 *   <link rel="stylesheet" href="./mua/css/donhang-proxy.css?v=ASSET_VERSION">
 *   (Cần load sau common.css)
 */

/* ════════════════════════════════════════════════
   1. Proxy Clear Table
════════════════════════════════════════════════ */
.proxy-clear-table {
    background: #ffffff;
    border: 1px solid #cfd6e0 !important;
}
.proxy-clear-table thead th {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
    color: #ffffff !important;
    border-color: #1f2d3d !important;
    padding: 12px 10px !important;
    text-align: left;
    vertical-align: middle;
    letter-spacing: 0.2px;
}
.proxy-clear-table tbody td {
    border-color: #dfe4ec !important;
    color: #1f2937;
    padding: 10px !important;
    vertical-align: middle;
    background-color: #ffffff;
}
.proxy-clear-table tbody tr:nth-child(even) td {
    background-color: #f4f7fb;
}
.proxy-clear-table tbody tr:hover td {
    background-color: #f1f5fb !important;
}
.proxy-clear-table .proxy-clickable {
    font-weight: 500 !important;
}

/* ════════════════════════════════════════════════
   2. #proxyTable — khóa cứng độ rộng cột
════════════════════════════════════════════════ */

/* Cột Type (6) — 80px cố định */
#proxyTable th:nth-child(6),
#proxyTable td:nth-child(6) {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Proxy gốc (4) và Proxy trung gian (5) — rộng bằng nhau */
#proxyTable th:nth-child(4),
#proxyTable td:nth-child(4),
#proxyTable th:nth-child(5),
#proxyTable td:nth-child(5) {
    width: 340px !important;
    min-width: 340px !important;
}

/* ════════════════════════════════════════════════
   3. Compact .table spacing
════════════════════════════════════════════════ */
.table th,
.table td {
    padding: 6px 8px !important;
    vertical-align: middle;
    border-bottom: 1px solid #e9ecef;
    font-size: 12px;
}

.table-responsive .table {
    margin-bottom: 0;
}

.table thead th {
    padding: 8px 8px !important;
    font-weight: 600;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-size: 12px;
}

.table tbody tr {
    border-bottom: 1px solid #f1f3f4;
}
.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* ════════════════════════════════════════════════
   4. .table-responsive
════════════════════════════════════════════════ */
.table-responsive {
    box-sizing: border-box;
    clear: both;
    color: rgb(98, 98, 98);
    direction: ltr;
    display: block;
    font-family: Helvetica, Arial, serif;
    font-size: 15.4px;
    font-weight: 400;
    letter-spacing: 0.14px;
    line-height: 22.33px;
    overflow-wrap: break-word;
    text-align: left;
    text-size-adjust: 100%;
    unicode-bidi: isolate;
    width: 100%;
    -webkit-tap-highlight-color: rgba(34, 41, 47, 0);
}

/* ════════════════════════════════════════════════
   5. Checkbox
════════════════════════════════════════════════ */
.form-check-input {
    width: 18px !important;
    height: 18px !important;
    margin: 0 auto;
    display: block;
    cursor: pointer;
}

/* ════════════════════════════════════════════════
   6. Desktop column widths
════════════════════════════════════════════════ */
.table th:nth-child(1), .table td:nth-child(1) { /* Checkbox */
    width: 50px;
    min-width: 50px;
    text-align: center;
    vertical-align: middle;
}
.table td:nth-child(1) {
    padding: 12px 8px !important;
}

.table th:nth-child(2), .table td:nth-child(2) { /* STT / User ID */
    width: 50px;
    min-width: 50px;
}
.table th:nth-child(3), .table td:nth-child(3) { /* Loại Proxy */
    width: 75px;
    min-width: 75px;
}
.table th:nth-child(4), .table td:nth-child(4) { /* ID */
    width: 60px;
    min-width: 60px;
}
.table th:nth-child(6), .table td:nth-child(6) { /* Proxy Trung Gian */
    width: 180px;
    min-width: 160px;
}
.table th:nth-child(7), .table td:nth-child(7) { /* Type */
    width: 70px;
    min-width: 70px;
}

/* Ngày hết hạn — không xuống dòng */
.table th:nth-child(8), .table td:nth-child(8) {
    white-space: nowrap !important;
    min-width: 120px;
}

/* Note — không xuống dòng */
.table th:nth-child(9), .table td:nth-child(9) {
    white-space: nowrap !important;
    min-width: 90px;
}

/* ════════════════════════════════════════════════
   7. Tablet (769px – 1024px)
════════════════════════════════════════════════ */
@media (min-width: 769px) and (max-width: 1024px) {
    .table th,
    .table td {
        font-size: 12px;
        padding: 0.4rem 0.3rem;
    }
}

/* ════════════════════════════════════════════════
   8. Large screen (≥ 1200px)
════════════════════════════════════════════════ */
@media (min-width: 1200px) {
    .table th,
    .table td {
        padding: 0.5rem 0.4rem;
    }
}

/* ════════════════════════════════════════════════
   9. Mobile (≤ 768px)
════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Thu gọn search box */
    .proxy-search-wrap .search-label {
        display: none !important;
    }
    .proxy-search-wrap .proxy-search-input {
        width: 130px !important;
        font-size: 12px;
    }

    /* Ẩn logo icon */
    .logo-icon img[src*="logo-icon.png"],
    img[src*="logo-icon.png"] {
        display: none !important;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table th,
    .table td {
        padding: 3px 5px !important;
        font-size: 9px;
        white-space: nowrap;
        vertical-align: middle;
        min-width: 60px;
    }

    /* Columns on mobile */
    .table th:nth-child(1), .table td:nth-child(1) { width: 25px;  min-width: 25px; }
    .table th:nth-child(2), .table td:nth-child(2) { width: 40px;  min-width: 40px; }
    .table th:nth-child(3), .table td:nth-child(3) { width: 60px;  min-width: 60px; }
    .table th:nth-child(4), .table td:nth-child(4) { width: 45px;  min-width: 45px; }
    .table th:nth-child(5), .table td:nth-child(5) { width: 160px; min-width: 140px; }
    .table th:nth-child(6), .table td:nth-child(6) { width: 140px; min-width: 120px; }
    .table th:nth-child(7), .table td:nth-child(7) { width: 50px;  min-width: 50px; }
    .table th:nth-child(8), .table td:nth-child(8) { width: 120px; min-width: 110px; white-space: nowrap !important; }
    .table th:nth-child(9), .table td:nth-child(9) { width: 90px;  min-width: 80px;  white-space: nowrap !important; }

    /* Buttons */
    .btn-toolbar .btn {
        font-size: 11px;
        padding: 0.25rem 0.5rem;
    }
    .btn-toolbar .btn-group {
        margin-bottom: 0.5rem;
    }
}

/* ════════════════════════════════════════════════
   10. Extra small (≤ 576px)
════════════════════════════════════════════════ */
@media (max-width: 576px) {
    .table th,
    .table td {
        padding: 4px 3px !important;
        font-size: 9px;
    }

    .table th:nth-child(1), .table td:nth-child(1) { width: 20px;  min-width: 20px; }
    .table th:nth-child(2), .table td:nth-child(2) { width: 35px;  min-width: 35px; }
    .table th:nth-child(3), .table td:nth-child(3) { width: 50px;  min-width: 50px; }
    .table th:nth-child(4), .table td:nth-child(4) { width: 40px;  min-width: 40px; }
    .table th:nth-child(5), .table td:nth-child(5) { width: 140px; min-width: 120px; }
    .table th:nth-child(6), .table td:nth-child(6) { width: 120px; min-width: 100px; }
    .table th:nth-child(7), .table td:nth-child(7) { width: 45px;  min-width: 40px; }
    .table th:nth-child(8), .table td:nth-child(8) { width: 110px; min-width: 100px; white-space: nowrap !important; }
    .table th:nth-child(9), .table td:nth-child(9) { width: 80px;  min-width: 70px;  white-space: nowrap !important; }

    /* Stack action buttons vertically */
    .btn-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .btn-toolbar .btn-group {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    .btn-toolbar .btn {
        width: 100%;
        text-align: center;
    }
}
