/* ===== TK DDDB - Thống kê Đầu Đuôi Đặc Biệt ===== */

/* Container chính */
.pagedb-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
}

/* Form filter chọn tỉnh và ngày */
.statistics-filter {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
    position: relative;
    overflow: hidden;
}

.statistics-filter::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57);
}

/* Form horizontal layout */
.form-horizontal {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 0;
}

.form-group label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

.form-group label::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
}

/* Form controls styling */
.form-control {
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

/* Select dropdown styling */
select.form-control {
    cursor: pointer;
    background-image: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="%23667eea" d="M2 0L0 2h4zm0 5L0 3h4z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
    padding-right: 45px;
    appearance: none;
}

/* Date input styling */
input[type="date"].form-control {
    cursor: pointer;
    position: relative;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    background: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23667eea"><path d="M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z"/></svg>') no-repeat;
    background-size: 20px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Button group cho số ngày */
.button-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.button-group span {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 10px;
}

.btn-date {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    font-size: 13px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-date::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-date:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    text-decoration: none;
    color: white;
}

.btn-date:hover::before {
    left: 100%;
}

.btn-date.active {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

/* Kết quả thống kê */
.statistics-results {
    margin-top: 30px;
}

.statistics-summary {
    margin-bottom: 30px;
    background: white;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.statistics-summary h2 {
    margin: 0;
    padding: 10px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bg_red {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

/* Box loto container */
.box-loto {
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

/* Bảng thống kê */
.table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: white;
}

.table-statis {
    border-radius: 12px;
    overflow: hidden;
}

.bgF5F5F5 {
    background: #f8f9fa;
}

.table th {
    background: linear-gradient(135deg, #495057 0%, #6c757d 100%);
    color: white;
    padding: 6px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    border: none;
    position: relative;
}

.table th.thdau {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-weight: 700;
    width: 80px;
}

.table th.col-slxh {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    width: 150px;
}

.table td {
    padding: 6px;
    text-align: center;
    border: 1px solid #e9ecef;
    font-weight: 500;
    transition: all 0.3s ease;
}

.table td.bgDEDEDE {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: 700;
    border-right: 2px solid #dee2e6;
}

.table tr:nth-child(even) {
    background: #f8f9fa;
}

.table tr:hover {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Heading thống kê */
.heading-tk {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Số loto */
.lo-gan {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Responsive Design */
@media (max-width: 992px) {
    .filter-row {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .page-title {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .filter-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .btn-date {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .table th, .table td {
        font-size: 12px;
    }
    
    .lo-gan {
        padding: 6px 10px;
        font-size: 14px;
    }
    
    .heading-tk {
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    
    .page-title {
        font-size: 20px;
    }
    
    .button-group {
        align-items: stretch;
    }
    
    .button-group span {
        text-align: center;
        margin-bottom: 10px;
    }
    
    .btn-date {
        margin: 2px 0;
        text-align: center;
    }
    
    .box-loto {
        margin-bottom: 20px;
    }
    
    .table {
        font-size: 11px;
    }
    
    .lo-gan {
        padding: 4px 8px;
        font-size: 12px;
    }
}

/* Animation cho loading */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.statistics-results {
    animation: fadeIn 0.6s ease-out;
}

.box-loto {
    animation: fadeIn 0.8s ease-out;
}

/* Hover effects */
.form-control:hover {
    border-color: #667eea;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.1);
}

.btn-date:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Custom scrollbar */
.statistics-results::-webkit-scrollbar {
    width: 8px;
}

.statistics-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.statistics-results::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

.statistics-results::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Print styles */
@media print {
    .statistics-filter {
        display: none;
    }
    
    .box-loto {
        border: 1px solid #000;
    }
    
    .table th {
        background: #f0f0f0 !important;
        color: black !important;
    }
    
    .lo-gan {
        background: #f0f0f0 !important;
        color: black !important;
    }
}