/* =========================================
   Main Lottery Check Form Styles
   ========================================= */

/* Main Container */
.tl-container-full {
    width: 100%;
    margin: 0 auto;
    font-family: 'Sarabun', 'Prompt', sans-serif;
}

/* Top Section Layout */
.tl-top-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
}

.tl-main-card {
    flex: 2;
    min-width: 300px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.tl-sidebar-search {
    flex: 1;
    min-width: 250px;
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    height: fit-content;
}

/* Main Card Styles */
.tl-card-header {
    background: linear-gradient(135deg, #F6A52E 0%, #d97706 100%);
    padding: 20px;
    text-align: center;
    color: #fff;
}

.tl-card-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #fff;
    line-height: 1.4;
}

.tl-card-header span {
    display: block;
    font-size: 1.1rem;
    margin-top: 5px;
    opacity: 0.9;
}

.tl-prize-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 25px;
}

.tl-prize-box {
    text-align: center;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.tl-prize-1 {
    grid-column: span 2;
    background: #fff7ed;
    border-color: #ffedd5;
}

.tl-prize-box h6 {
    margin: 0 0 10px;
    color: #6b7280;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tl-number-box {
    font-size: 2.5rem;
    font-weight: 700;
    color: #d97706;
    letter-spacing: 2px;
}

.tl-multi-numbers {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.tl-multi-numbers span {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1f2937;
}

.tl-single-number {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
}

.tl-prize-box p {
    margin: 10px 0 0;
    font-size: 0.8rem;
    color: #9ca3af;
}

/* Sidebar Search Styles */
.tl-sidebar-search h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.25rem;
    color: #1f2937;
    border-bottom: 2px solid #F6A52E;
    padding-bottom: 10px;
    display: inline-block;
}

.tl-sidebar-search label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.tl-select-full,
.tl-input-full {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 1rem;
    box-sizing: border-box;
}

.tl-button-full {
    width: 100%;
    background-color: #F6A52E;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tl-button-full:hover {
    background-color: #d97706;
}

.tl-more-btn {
    display: block;
    text-align: center;
    padding: 15px;
    background: #f3f4f6;
    color: #4b5563;
    text-decoration: none;
    font-weight: 600;
    border-top: 1px solid #e5e7eb;
    transition: background 0.2s;
}

.tl-more-btn:hover {
    background: #e5e7eb;
    color: #1f2937;
}

/* Full Result Table Styles */
.lottery-result {
    margin-top: 30px;
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.lottery-result h3 {
    font-size: 1.1rem;
    color: #1f2937;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    border-left: 4px solid #F6A52E;
    padding-left: 12px;
}

.lottery-result h3 span {
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: normal;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
}

.flex-result {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.lotto__number {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: 600;
    color: #374151;
    min-width: 60px;
    text-align: center;
}

hr {
    border: 0;
    border-top: 1px solid #e5e7eb;
    margin: 20px 0;
}

/* Responsive Adjustments for Main Form */
@media (max-width: 768px) {
    .tl-top-wrapper {
        flex-direction: column;
    }
    .tl-prize-grid {
        grid-template-columns: 1fr;
    }
    .tl-prize-1 {
        grid-column: span 1;
    }
    .tl-main-card, .tl-sidebar-search {
        width: 100%;
    }
    .tl-multi-numbers span {
        font-size: 1.5rem;
    }
}

/* =========================================
   History List Styles
   ========================================= */
.tl-history-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 20px;
}

.tl-history-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    background-color: transparent;
}

/* Date Badge */
.tl-history-date {
    background-color: #e5e7eb;
    border-radius: 8px;
    width: 80px;
    height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    color: #374151;
}

.tl-history-day {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
    color: #d97706;
}

.tl-history-month {
    font-size: 0.85rem;
    font-weight: normal;
    margin-top: 2px;
}

/* History Content */
.tl-history-content {
    flex-grow: 1;
    width: 100%;
}

.tl-history-title {
    font-size: 1rem;
    color: #d97706; /* Orange-ish text for title */
    font-weight: 700;
    margin-bottom: 10px;
    display: block;
    text-decoration: none;
}
.tl-history-title:hover {
    text-decoration: underline;
}

/* Mini Table for History */
.tl-history-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.tl-history-table th {
    background-color: #f3f4f6;
    color: #6b7280;
    font-weight: normal;
    font-size: 0.85rem;
    padding: 8px;
    text-align: center;
    border-right: 1px solid #e5e7eb;
}
.tl-history-table th:last-child {
    border-right: none;
}

.tl-history-table td {
    padding: 10px 5px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: #1f2937;
    border-right: 1px solid #e5e7eb;
    border-top: 1px solid #e5e7eb;
}
.tl-history-table td:last-child {
    border-right: none;
}

@media (max-width: 768px) {
    .tl-history-item {
        flex-direction: column;
        gap: 10px;
    }
    .tl-history-date {
        flex-direction: row;
        width: 100%;
        height: auto;
        padding: 5px 15px;
        justify-content: flex-start;
        gap: 10px;
        background: transparent;
    }
    .tl-history-day {
        font-size: 1.5rem;
    }
    .tl-history-month {
        font-size: 1.2rem;
        margin-top: 0;
    }
    .tl-history-table th {
        font-size: 0.75rem;
    }
    .tl-history-table td {
        font-size: 0.95rem;
    }
}
/* =========================================
   Layout 2 Styles (Thaiger Style)
   ========================================= */
.tl-layout2 {
    max-width: 1200px;
    margin: 0 auto;
    font-family: 'Sarabun', 'Prompt', sans-serif;
}

.tl-l2-row {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.tl-l2-left {
    flex: 2;
    min-width: 300px;
}

.tl-l2-right {
    flex: 1;
    min-width: 300px;
}

/* Card Styles */
.tl-l2-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    overflow: hidden;
    border: 1px solid #eee;
}

.tl-l2-card-header {
    background: #F6A52E;
    color: #fff;
    padding: 20px 30px;
    position: relative;
}

.tl-l2-card-header h3 {
    margin: 0;
    font-size: 1.4rem;
    color: #fff;
    font-weight: 700;
}

.tl-l2-card-header p {
    margin: 5px 0 0;
    opacity: 0.9;
    font-size: 0.95rem;
    font-weight: 400;
}

.tl-l2-card-body {
    padding: 30px;
}

/* Flex Layout for Result Body */
.tl-l2-result-flex {
    display: flex;
    align-items: center; /* Center vertically */
    gap: 20px;
    flex-wrap: wrap;
}

/* Col 1: First Prize */
.tl-l2-col-first {
    flex: 1.5;
    min-width: 200px;
    text-align: left;
    padding-right: 20px;
    border-right: 1px solid #eee;
}

.tl-l2-big-num {
    font-size: 4.5rem; /* Huge number */
    font-weight: 700;
    color: #F6A52E;
    line-height: 1;
    letter-spacing: 1px;
}

.tl-l2-prize-label {
    font-size: 1.1rem;
    color: #1f2937;
    font-weight: 600;
    margin-bottom: 5px;
    text-align: right; /* Align label to right of number or top right */
    position: absolute;
    top: 25px;
    right: 30px;
    display: none; /* Hide for now as per design tweak or move it */
}

/* Adjust label inside col-first */
.tl-l2-col-first .tl-l2-prize-label {
    position: static;
    display: block;
    text-align: right;
    font-size: 1rem;
    color: #374151;
    margin-bottom: -10px; /* Pull closer to number */
    margin-right: 10px;
}

/* Col 2: Middle (Front/Rear 3) */
.tl-l2-col-middle {
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-right: 1px solid #eee; /* Add divider */
    padding-right: 20px;
}

.tl-l2-box-small {
    background: transparent; /* Remove gray box */
    border-radius: 0;
    padding: 5px 0;
    text-align: center;
    border: none;
}

.tl-l2-nums-row-small {
    font-size: 1.4rem;
    font-weight: 700;
    color: #374151;
    display: flex;
    justify-content: center;
    gap: 10px;
    line-height: 1.2;
}
.tl-l2-nums-row-small span {
    display: block;
}
.tl-l2-nums-row-small .tl-sep {
    color: #d1d5db;
    font-weight: 300;
}

.tl-l2-small-label {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 4px;
}

/* Col 3: Last (Rear 2) */
.tl-l2-col-last {
    flex: 0.8;
    min-width: 100px;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tl-l2-box-tall {
    background: transparent; /* Remove gray box */
    border-radius: 0;
    padding: 10px;
    text-align: center;
    border: none;
    height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

.tl-l2-num-huge {
    font-size: 3rem;
    font-weight: 700;
    color: #d97706;
    line-height: 1;
}

/* Col 4: Button */
.tl-l2-col-btn {
    flex: 0.5;
    min-width: 100px;
    text-align: right;
}

.tl-l2-btn-gray {
    background: #f3f4f6;
    color: #4b5563;
    padding: 8px 15px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.2s;
    display: inline-block;
}
.tl-l2-btn-gray:hover {
    background: #e5e7eb;
    color: #1f2937;
}

/* Sidebar Styles */
.tl-l2-check-box {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    margin-bottom: 30px;
}

.tl-l2-check-header label {
    display: block;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.tl-l2-select, .tl-l2-check-input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 15px;
    box-sizing: border-box;
    font-size: 0.95rem;
    color: #374151;
    background: #fff;
}

.tl-l2-check-input-group button {
    width: 100%;
    padding: 12px;
    background: #F6A52E;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.tl-l2-check-input-group button:hover {
    background: #d97706;
}

/* Past Results List */
.tl-l2-past-section h3 {
    font-size: 1.1rem;
    color: #1f2937;
    margin-bottom: 20px;
    padding-left: 10px;
    border-left: 4px solid #F6A52E;
    font-weight: 700;
}

.tl-l2-past-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tl-l2-past-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #f3f4f6;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    transition: transform 0.2s;
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.tl-l2-past-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.tl-l2-past-header {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
}

.tl-l2-past-day {
    background: #F6A52E;
    color: #fff;
    width: 45px;
    height: 45px;
    border-radius: 8px; /* Square with rounded corners */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.tl-l2-past-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    line-height: 1.4;
}

.tl-l2-past-body {
    background: transparent; /* Clean look */
    padding: 0;
    border-radius: 0;
    margin-bottom: 0;
}

.tl-l2-past-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #9ca3af;
    margin-bottom: 2px;
}

.tl-l2-past-nums {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    color: #1f2937;
    font-size: 1.1rem;
    margin-bottom: 15px;
}
.tl-l2-past-nums:last-child {
    margin-bottom: 0;
}

/* Pagination Buttons */
.tl-l2-page-btn {
    border: 1px solid #ddd;
    background: #fff;
    color: #374151;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    min-width: 35px;
}
.tl-l2-page-btn:hover {
    background: #f3f4f6;
}
/* Active state handled inline in PHP but good to have class */
.tl-l2-page-btn.active {
    background: #F6A52E;
    color: #fff;
    border-color: #F6A52E;
}

/* Responsive */
@media (max-width: 992px) {
    .tl-l2-col-first {
        flex: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;
        padding-bottom: 20px;
        margin-bottom: 20px;
        text-align: center;
        padding-right: 0;
    }
    .tl-l2-col-first .tl-l2-prize-label {
        text-align: center;
    }
    .tl-l2-col-middle, .tl-l2-col-last, .tl-l2-col-btn {
        flex: 1;
    }
}

@media (max-width: 768px) {
    .tl-l2-row {
        flex-direction: column;
    }
    .tl-l2-result-flex {
        flex-direction: column;
        align-items: stretch;
    }
    .tl-l2-col-first, .tl-l2-col-middle, .tl-l2-col-last, .tl-l2-col-btn {
        width: 100%;
        border: none;
        padding: 0;
        margin-bottom: 15px;
    }
    .tl-l2-col-btn {
        text-align: center;
    }
    .tl-l2-big-num {
        font-size: 3.5rem;
    }
}

/* History Grid & Pagination */
.tl-history-grid-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.tl-history-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.tl-history-item-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.tl-history-item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.tl-hist-badge {
    background: #F6A52E;
    color: #fff;
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tl-hist-day {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.tl-hist-content {
    padding: 20px;
}

.tl-hist-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 15px;
    text-align: center;
}

.tl-hist-table-mini {
    background: #f9fafb;
    border-radius: 8px;
    padding: 10px;
}

.tl-hist-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 5px;
}

.tl-hist-nums {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 10px;
}
.tl-hist-nums:last-child {
    margin-bottom: 0;
}

.tl-accent {
    color: #d97706;
}

/* Pagination */
.tl-pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.tl-page-btn {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.tl-page-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.tl-page-btn.active {
    background: #F6A52E;
    color: #fff;
    border-color: #F6A52E;
}

.tl-page-dots {
    padding: 8px 5px;
    color: #9ca3af;
}

/* Sidebar Results (Layout 2) */
.tl-l2-sidebar-results {
    margin-top: 30px;
}

.tl-l2-sidebar-link {
    text-decoration: none;
    color: inherit;
    display: block;
    margin-bottom: 10px;
}

.tl-l2-sidebar-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tl-l2-sidebar-card:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-color: #F6A52E;
}

.tl-l2-sidebar-date {
    background: #f3f4f6;
    border-radius: 6px;
    padding: 5px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
    flex-shrink: 0;
}

.tl-sd-day {
    font-size: 1.2rem;
    font-weight: 700;
    color: #F6A52E;
    line-height: 1;
}

.tl-sd-month {
    font-size: 0.75rem;
    color: #6b7280;
}

.tl-sd-year {
    font-size: 0.75rem;
    color: #9ca3af;
}

.tl-l2-sidebar-info {
    flex: 1;
}

.tl-l2-sidebar-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 2px;
    line-height: 1.3;
}

.tl-l2-sidebar-click {
    font-size: 0.75rem;
    color: #F6A52E;
    font-weight: 500;
}
