/**
 * Frontend Styles for Nuôi Lô Đề Khung Plugin
 */

/* ===== KHUNG LIST ===== */
.nuoi-lo-de-khung-list {
    margin: 20px 0;
    text-align: center;
}

.khung-list-title {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
}

.khung-items {
    display: grid;
    gap: 15px;
}

.khung-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
}

.khung-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Khung đang nuôi - nổi bật */
.khung-item.dang-nuoi {
    background: linear-gradient(135deg, #fff8e1 0%, #fff3c4 100%);
    border: 2px solid #ffc107;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
    animation: pulse-glow 2s infinite;
}

.khung-item.dang-nuoi:hover {
    box-shadow: 0 6px 16px rgba(255, 193, 7, 0.4);
    transform: translateY(-2px);
}

/* Animation cho khung đang nuôi */
@keyframes pulse-glow {
    0% {
        box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
    }
    50% {
        box-shadow: 0 4px 16px rgba(255, 193, 7, 0.5);
    }
    100% {
        box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
    }
}

/* Badge "ĐANG NUÔI" */
.khung-item.dang-nuoi::before {
    content: "ĐANG NUÔI";
    position: absolute;
    top: -12px;
    left: -8px;
    background: #ff6b35;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
}

.khung-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    text-align: center;
    flex-direction: column;
}

.khung-title {
    margin: 0;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    text-align: center;
}

.khung-category {
    background: #007cba;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: inline-block;
    margin-top: 5px;
}

/* Khung 1 ngày - chỉ hiển thị ngày */
.khung-date-single {
    font-size: 14px;
    color: #666;
    text-align: center;
    margin-bottom: 10px;
}

/* Khung nhiều ngày - hiển thị 3 cột */
.khung-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    width: 100%;
    margin-bottom: 10px;
}

/* Force 3 columns for all screen sizes - High specificity */
.nuoi-lo-de-khung-list .khung-info,
.nuoi-lo-de-category-khung .khung-info,
.nuoi-lo-de-category-khung .category-info,
.nuoi-lo-de-category-khung .category-stats,
.nuoi-lo-de-stats .stats-grid,
.nuoi-lo-de-history .khung-info,
.nuoi-lo-de-results .khung-info {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
}

@media (max-width: 768px) {
    .nuoi-lo-de-khung-list .khung-info,
    .nuoi-lo-de-category-khung .khung-info,
    .nuoi-lo-de-category-khung .category-info,
    .nuoi-lo-de-category-khung .category-stats,
    .nuoi-lo-de-stats .stats-grid,
    .nuoi-lo-de-history .khung-info,
    .nuoi-lo-de-results .khung-info {
        grid-template-columns: 1fr 1fr 1fr !important;
    }
}

@media (max-width: 480px) {
    .nuoi-lo-de-khung-list .khung-info,
    .nuoi-lo-de-category-khung .khung-info,
    .nuoi-lo-de-category-khung .category-info,
    .nuoi-lo-de-category-khung .category-stats,
    .nuoi-lo-de-stats .stats-grid,
    .nuoi-lo-de-history .khung-info,
    .nuoi-lo-de-results .khung-info {
        grid-template-columns: 1fr 1fr 1fr !important;
    }
}

/* Desktop compact layout */
@media (min-width: 481px) {
    .khung-item,
    .history-item,
    .result-item {
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .khung-header {
        margin-bottom: 12px;
    }
    
    .khung-title {
        margin-bottom: 6px;
    }
    
    .khung-category {
        padding: 3px 7px;
        margin-top: 4px;
    }
    
    .khung-date-single {
        margin-bottom: 8px;
    }
    
    .khung-info-grid {
        gap: 12px;
        margin-bottom: 8px;
    }
    
    .khung-info {
        gap: 12px;
        margin-bottom: 8px;
    }
    
    .info-item .label {
        margin-bottom: 3px;
    }
    
    .info-item .value {
    }
    
    .info-label {
        margin-bottom: 3px;
    }
    
    .info-value {
    }
}

.info-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.info-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 4px;
    font-weight: 500;
}

.info-value {
    font-size: 13px;
    color: #333;
    font-weight: 600;
}

.khung-info {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 15px;
    margin-bottom: 15px;
    text-align: center;
}

.info-item {
    display: flex;
    flex-direction: column;
    text-align: center;
    min-width: 0; /* Prevent overflow */
}

.info-item .label {
    font-size: 12px;
    color: #666;
    margin-bottom: 2px;
    text-align: center;
}

.info-item .value {
    font-weight: bold;
    color: #333;
    text-align: center;
}

.khung-numbers {
    margin-bottom: 15px;
    text-align: center;
}

.numbers-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    text-align: center;
}

.numbers-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.number-item {
    background: #f0f0f0;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: bold;
    color: #333;
    border: 1px solid #ddd;
    text-align: center;
}

.number-item.trung {
    background: #28a745;
    color: white;
    border: 1px solid #28a745;
}

/* Highlight winning numbers in result text - High specificity */
.nuoi-lo-de-khung-list .result-content .winning-number,
.nuoi-lo-de-category-khung .result-content .winning-number,
.nuoi-lo-de-history .result-content .winning-number,
.nuoi-lo-de-results .result-text .winning-number,
.khung-result .winning-number,
.history-result .winning-number,
.result-text .winning-number,
.result-content .winning-number {
    color: #28a745 !important;
    font-weight: bold !important;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    text-decoration: none !important;
    display: inline !important;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    display: inline-block;
    text-align: center;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
}

.status-badge.status-dang_nuoi {
    background: #28a745;
    color: white;
    text-transform: uppercase;
}

.status-badge.status-ket_thuc {
    background: #6c757d;
    color: white;
    text-transform: none; /* Không uppercase để hiển thị đúng văn bản */
    white-space: normal; /* Cho phép xuống dòng nếu cần */
    max-width: 100%; /* Đảm bảo không vượt quá container */
}

.status-dang-nuoi {
    background: #ffc107;
    color: #000;
}

.status-ket-thuc {
    background: #28a745;
    color: white;
}

.khung-result {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    text-align: center;
}

.result-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    text-align: center;
}

.result-content {
    font-weight: bold;
    color: #333;
    text-align: center;
}

/* ===== CATEGORY KHUNG ===== */
.nuoi-lo-de-category-khung {
    margin: 20px 0;
    text-align: center;
}

.category-header {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

.category-title {
    margin: 0 0 15px 0;
    font-size: 28px;
    color: #333;
    text-align: center;
}

.category-info {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    text-align: center;
}

.category-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #e9ecef;
    border-radius: 8px;
    text-align: center;
}

.stats-item {
    text-align: center;
    min-width: 0; /* Prevent overflow */
    padding: 8px;
}

.stats-number {
    font-size: 24px;
    font-weight: bold;
    color: #007cba;
    display: block;
    text-align: center;
}

.stats-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    text-align: center;
}

/* ===== STATS ===== */
.nuoi-lo-de-stats {
    margin: 20px 0;
    text-align: center;
}

.stats-title {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
}

.stats-period {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    text-align: center;
}

.period-label {
    font-weight: bold;
    color: #666;
    text-align: center;
}

.period-value {
    color: #333;
    margin-left: 10px;
    text-align: center;
}

.stats-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.stats-item.total .stats-number {
    color: #333;
}

.stats-item.dang-nuoi .stats-number {
    color: #ffc107;
}

.stats-item.ket-thuc .stats-number {
    color: #28a745;
}

.stats-item.trung .stats-number {
    color: #28a745;
}

.stats-item.truot .stats-number {
    color: #dc3545;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.summary-item {
    text-align: center;
}

.summary-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
    text-align: center;
}

.summary-value {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    text-align: center;
}

/* ===== HISTORY ===== */
.nuoi-lo-de-history {
    margin: 20px 0;
    text-align: center;
}

.history-title {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
}

.history-items {
    display: grid;
    gap: 15px;
}

.history-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

/* History item đang nuôi */
.history-item.dang-nuoi {
    background: linear-gradient(135deg, #fff8e1 0%, #fff3c4 100%);
    border: 2px solid #ffc107;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
    animation: pulse-glow 2s infinite;
}

.history-item.dang-nuoi:hover {
    box-shadow: 0 6px 16px rgba(255, 193, 7, 0.4);
    transform: translateY(-2px);
}

.history-item.dang-nuoi::before {
    content: "ĐANG NUÔI";
    position: absolute;
    top: -12px;
    left: -8px;
    background: #ff6b35;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
}

.history-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
    flex-direction: column;
}

.history-title {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    text-align: center;
}

.history-category {
    background: #6c757d;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: inline-block;
}

.history-date {
    color: #666;
    font-size: 12px;
    text-align: center;
}

/* ===== RESULTS ===== */
.nuoi-lo-de-results {
    margin: 20px 0;
    text-align: center;
}

.results-title {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: bold;
    text-align: center;
}

.results-date {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    text-align: center;
}

.date-label {
    font-weight: bold;
    color: #666;
    text-align: center;
}

.date-value {
    color: #333;
    margin-left: 10px;
    text-align: center;
}

.results-items {
    display: grid;
    gap: 15px;
}

.result-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

/* Result item đang nuôi */
.result-item.dang-nuoi {
    background: linear-gradient(135deg, #fff8e1 0%, #fff3c4 100%);
    border: 2px solid #ffc107;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
    animation: pulse-glow 2s infinite;
}

.result-item.dang-nuoi:hover {
    box-shadow: 0 6px 16px rgba(255, 193, 7, 0.4);
    transform: translateY(-2px);
}

.result-item.dang-nuoi::before {
    content: "ĐANG NUÔI";
    position: absolute;
    top: -12px;
    left: -8px;
    background: #ff6b35;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    z-index: 10;
}

.result-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
    flex-direction: column;
}

.result-title {
    margin: 0;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    text-align: center;
}

.result-category {
    background: #dc3545;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    display: inline-block;
}

.result-date {
    color: #666;
    font-size: 12px;
    text-align: center;
}

.result-details {
    margin: 10px 0;
    text-align: center;
}

.result-text {
    font-weight: bold;
    color: #333;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    text-align: center;
}

/* ===== PAGINATION ===== */
.pagination-section {
    margin-top: 30px;
    text-align: center;
}

.pagination-info {
    margin-bottom: 15px;
    color: #666;
    font-size: 14px;
}

.pagination-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.pagination-btn {
    background: #007cba;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s ease;
    display: inline-block;
}

.pagination-btn:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

.pagination-current {
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: bold;
    color: #333;
    border: 1px solid #ddd;
}

/* ===== LOAD MORE ===== */
.load-more-section {
    text-align: center;
    margin-top: 20px;
}

.load-more-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
    text-align: center;
}

.load-more-btn:hover {
    background: #005a87;
}

/* ===== NO DATA ===== */
.no-khung,
.no-history,
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    background: #f8f9fa;
    border-radius: 8px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .khung-header,
    .history-header,
    .result-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .khung-info {
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 8px;
        text-align: center;
    }
    
    .category-info {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 8px;
        text-align: center;
    }
    
    .category-stats {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
        text-align: center;
    }
    
    .numbers-list {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 6px;
        text-align: center;
    }
    
    .category-stats {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
        text-align: center;
    }
    
    /* Mobile compact layout */
    .khung-item,
    .history-item,
    .result-item {
        padding: 8px;
        text-align: center;
        margin-bottom: 8px;
    }
    
    .khung-header {
        margin-bottom: 8px;
    }
    
    .khung-title {
        margin-bottom: 4px;
    }
    
    .khung-category {
        padding: 2px 6px;
        margin-top: 3px;
    }
    
    /* Khung 1 ngày - compact */
    .khung-date-single {
        margin-bottom: 6px;
    }
    
    /* Khung nhiều ngày - compact 3 cột */
    .khung-info-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
        margin-bottom: 6px;
    }
    
    /* Khung info - compact 3 cột */
    .khung-info {
        grid-template-columns: 1fr 1fr 1fr !important;
        gap: 6px;
        margin-bottom: 8px;
    }
    
    .info-item .label {
        margin-bottom: 2px;
    }
    
    .info-item .value {
    }
    
    .info-label {
        margin-bottom: 2px;
    }
    
    .info-value {
    }
    
    /* Numbers compact */
    .khung-numbers {
        margin-bottom: 6px;
    }
    
    .numbers-label {
        margin-bottom: 3px;
    }
    
    .numbers-list {
        gap: 3px;
        justify-content: center;
    }
    
    .number-item {
        font-weight: bold;
        padding: 6px 10px;
        min-width: 35px;
        background: #f5f5f5;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .number-item.trung {
        background: #28a745;
        color: white;
    }
    
    /* Status compact */
    .khung-status {
        margin-bottom: 4px;
    }
    
    .status-badge {
        padding: 3px 8px;
        border-radius: 12px;
        font-weight: bold;
        white-space: normal;
        word-wrap: break-word;
        line-height: 1.4;
    }
    
    .status-badge.status-dang_nuoi {
        background: #28a745;
        color: white;
        text-transform: uppercase;
    }
    
    .status-badge.status-ket_thuc {
        background: #6c757d;
        color: white;
        text-transform: none; /* Không uppercase để hiển thị đúng văn bản */
        white-space: normal; /* Cho phép xuống dòng nếu cần */
        max-width: 100%; /* Đảm bảo không vượt quá container */
    }
    
    /* Result compact */
    .khung-result {
        margin-bottom: 4px;
    }
    
    .result-label {
    }
    
    .result-content {
    }
    
    .stats-item {
        padding: 4px;
    }
    
    .stats-number {
    }
    
    .stats-label {
    }
    
    /* Badge responsive */
    .khung-item.dang-nuoi::before,
    .history-item.dang-nuoi::before,
    .result-item.dang-nuoi::before {
        padding: 2px 4px;
        top: -8px;
        left: -4px;
    }
}
