/* ===== VARIABLES ===== */
:root {
    --color-primary: var(--color-primary);
}

/* ===== lottery-try PLUGIN ===== */

.lottery-multi-province-container {
    max-width: 100%;
    overflow-x: hidden;
}

.troy-lottery-container {
    font-family: Arial, sans-serif;
    margin-bottom: 20px;
}

/* Button */
.lottery-button-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.lottery-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #74aa19;
    color: #fff;
    border: none;
    padding: 13px 40px;
    font-size: 15px;
    letter-spacing: 0.5px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(29, 78, 216, 0.4);
    transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
}

.lottery-button::before {
    content: '🎰';
    font-size: 18px;
}

.lottery-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(29, 78, 216, 0.4);
}

.lottery-button:disabled {
    background: linear-gradient(135deg, #93c5fd 0%, #60a5fa 100%);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* Tab panel */
.tab-panel {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0 0 12px 0;
    padding: 0;
    border-bottom: 2px solid var(--color-primary);
    gap: 2px;
}

.tab-panel li {
    flex: 1 1 auto;
}

.tab-panel li a {
    display: block;
    padding: 7px 14px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    background: #f4f4f4;
    transition: background 0.2s, color 0.2s;
    text-align: center;
    white-space: nowrap;
}

.tab-panel li a:hover,
.tab-panel li.active a {
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
}

@media (max-width: 768px) {
    .tab-panel li {
        flex: 1 1 calc(25% - 2px);
    }
    .tab-panel li a {
        padding: 6px 4px;
        font-size: 13px;
    }
}

/* Lottery table */
.lottery-table-wrapper,
.head-tail-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.lottery-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
    font-size: 14px;
}

.lottery-table th,
.lottery-table td {
    border: 1px solid #ddd;
    padding: 8px 6px;
    text-align: center;
    vertical-align: middle;
}

.lottery-table thead th {
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
}

.lottery-table tr[data-prize="eighth"] .number,
.lottery-table tr[data-prize="special"] .number {
    color: #d32f2f;
    font-size: 26px;
    font-weight: bold;
}

.lottery-table tbody tr[data-prize="seventh"] .number,
.lottery-table tbody tr[data-prize="sixth"] .number,
.lottery-table tbody tr[data-prize="fifth"] .number,
.lottery-table tbody tr[data-prize="fourth"] .number,
.lottery-table tbody tr[data-prize="third"] .number,
.lottery-table tbody tr[data-prize="second"] .number,
.lottery-table tbody tr[data-prize="first"] .number {
    font-size: 20px;
    font-weight: bold;
}

.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-top-color: #4caf50;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Display options */
.display-options {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 10px 0 12px 0;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.display-options label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    margin: 0;
    white-space: nowrap;
}

.display-options input[type="radio"] {
    margin: 0;
    cursor: pointer;
}

/* Number compare */
.number-compare {
    margin-bottom: 12px;
}

.number-grid {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.number-cell {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-weight: 700;
    font-size: 14px;
    background: #f4f4f4;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.number-cell.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

/* Head/tail table */
.head-tail-section {
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.head-tail-section > div:first-child {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 6px;
}

.head-tail-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 14px;
    white-space: nowrap;
}

.head-tail-table td { font-size: 15px; font-weight: 700; }

.head-tail-table th,
.head-tail-table td {
    border: 1px solid #ddd;
    padding: 6px 8px;
    text-align: center;
    word-break: break-word;
    overflow-wrap: break-word;
}

.head-tail-table th:first-child,
.head-tail-table td:first-child {
    width: 10%;
    min-width: 10%;
}

.head-tail-table th:last-child,
.head-tail-table td:last-child {
    width: 10%;
    min-width: 10%;
}

.head-tail-table thead th {
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
}

.head-tail-table tbody tr:nth-child(even) {
    background: #f9f9f9;
}

/* Probability */
.probability-section {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 16px;
}

.probability-section .title-bor {
    font-size: 14px;
    margin: 0 0 8px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

.list-dau-db {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ===== NAV DROPDOWN SUB-LIST (theo thứ → tỉnh) ===== */
.dropdown-has-sub {
    position: relative;
}

.dropdown-has-sub > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-sub-count {
    font-size: 11px;
    color: #999;
    margin-left: 4px;
}

.dropdown-sub-list {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    list-style: none;
    margin: 0;
    padding: 6px 0;
    min-width: 160px;
    background: #fff;
    box-shadow: 0 6px 24px rgba(0,0,0,0.18);
    border-radius: 8px;
    z-index: 1000;
}

.dropdown-has-sub:hover > .dropdown-sub-list {
    display: block;
}

.dropdown-sub-list li a {
    display: block;
    padding: 8px 14px;
    text-decoration: none;
    color: #212529;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 4px;
    margin: 1px 4px;
    transition: background 0.2s, color 0.2s;
}

.dropdown-sub-list li a:hover {
    background: var(--color-primary);
    color: #fff;
}

.head-tail-table .special-num {
    color: #dc2626;
    font-weight: 700;
}

.single-province-table th,
.single-province-table td {
    width: 25%;
}

.single-province-table td:first-child,
.single-province-table td:last-child {
    background: #f0f4f8;
    font-weight: 700;
    color: var(--color-primary);
}

.lottery-table tbody th {
    background: #fff;
    font-weight: 700;
    color: #333;
    white-space: nowrap;
}

.lottery-auto-title {
    font-size: 32px;
}

@media (max-width: 768px) {
    .lottery-auto-title {
        font-size: 1.1rem;
    }
}

.number-wrap {
    display: block;
    text-align: center;
    line-height: 1.8;
}

/* 1 tỉnh: số hiển thị inline */
.lottery-multi-table.single-province .number-wrap {
    display: inline;
}
.lottery-multi-table.single-province .number {
    display: inline;
    margin: 0 4px;
}

/* ===== Lottery Results Table - Fixed Layout ===== */

.lottery-results {
    margin-bottom: 20px;
}

.lottery-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 1px solid #e5e5e5;
}

.lottery-table thead {
    display: none;
}

.lottery-table tbody tr {
    display: table-row;
    border-bottom: 1px solid #e5e5e5;
}

.lottery-table tbody tr:last-child {
    border-bottom: none;
}

.lottery-table tbody tr:nth-child(odd) {
    background: #f0f4f8;
}

.lottery-table tbody tr:nth-child(even) {
    background: #fff;
}

.lottery-table th {
    background: #f0f4f8;
    color: #333;
    font-weight: 700;
    padding: 12px 16px;
    text-align: center;
    border: none;
    border-right: 1px solid #e5e5e5;
    width: 70px;
    min-width: 70px;
    font-size: 14px;
    letter-spacing: 0.5px;
    display: table-cell;
    vertical-align: top;
}

.lottery-table tbody tr th {
    background: #f0f4f8;
    text-align: center;
    font-weight: 700;
    padding: 12px 8px;
    vertical-align: top;
}

.lottery-table td {
    display: table-cell;
    padding: 12px 16px;
    border: none;
    vertical-align: top;
    text-align: left;
}

.lottery-table td.province-cell {
    padding: 10px;
    width: 100%;
}

.number-wrap {
    display: block;
    margin-bottom: 6px;
    line-height: 1.8;
}

.number-wrap:last-child {
    margin-bottom: 0;
}

.number {
    display: inline-block;
    padding: 2px 25px;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    color: #333;
    margin-right: 8px;
    line-height: 1.6;
}

.lottery-table tr[data-prize="first"] .number,
.lottery-table tr[data-prize="second"] .number,
.lottery-table tr[data-prize="third"] .number {
    font-size: 16px;
    font-weight: bold;
}

.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}

/* Responsive for mobile */
@media (max-width: 768px) {
    .lottery-table th {
        padding: 10px 8px;
        font-size: 13px;
        width: 50px;
        min-width: 50px;
    }

    .lottery-table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .number {
        font-size: 14px;
        padding: 2px 20px;
        margin-right: 6px;
    }

    .number-wrap {
        margin-bottom: 4px;
    }

    h1 {
        font-size: 15px;
    }
}