/* Checkin System Styles */

/* Trigger Icon */
.checkin-trigger {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9998;
    cursor: pointer;
}

.checkin-trigger-icon {
    width: 100px;
    height: 100px;
    background: url('https://nguoibanvang.vn/wp-content/uploads/2025/09/ICON-CHOI-LA-TRUNG.png') center center;
    background-size: cover;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    font-weight: bold;
    font-size: 12px;
    transition: all 0.3s ease;
    margin-bottom: 50px;
}

.checkin-trigger-icon:hover {
    transform: scale(1.1);
}

/* Overlay */
.checkin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    backdrop-filter: blur(5px);
}

/* Banner (Hình 1) */
.checkin-banner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 300px;
    height: 600px;
    background: url('https://nguoibanvang.vn/wp-content/uploads/2025/09/BANNER-CHECK-IN-1.png') center center;
    background-size: cover;
    background-repeat: no-repeat;
    border-radius: 20px;
    padding: 0;
    text-align: center;
    color: white;
    z-index: 10000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkin-banner:hover {
    transform: translate(-50%, -50%) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.checkin-banner h2 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: bold;
}

.checkin-join-btn {
    display: none;
}

.checkin-banner-content {
    text-align: center;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.checkin-banner-title-image {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

.checkin-banner-logo {
    max-width: 100%;
    height: auto;
    max-height: 100px;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.checkin-join-btn {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 20px 40px;
    border-radius: 25px;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(238, 90, 36, 0.3);
    margin: 20px 0;
}

.checkin-join-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(238, 90, 36, 0.4);
}

.checkin-join-btn:active {
    transform: translateY(0);
}

.checkin-banner-content h2 {
    display: none;
}

/* Calendar (Hình 2) */
.checkin-calendar {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 500px;
    max-height: 90vh;
    background: white;
    border-radius: 20px;
    padding: 30px;
    z-index: 10000;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.checkin-calendar-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

.checkin-calendar-title-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.checkin-header-logo {
    max-width: 100%;
    height: auto;
    max-height: 80px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.checkin-calendar-header h2 {
    color: #333;
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: bold;
}

.checkin-calendar-header p {
    color: #666;
    margin: 0;
    font-size: 14px;
}

.checkin-calendar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-bottom: 15px;
    /* padding: 20px; */
}

.checkin-day {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkin-day-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.checkin-day-number {
    font-size: 12px;
    font-weight: bold;
    color: #333;
    text-align: center;
    margin-top: 0;
}

/* Ngày đã checkin - hiển thị hình ảnh mới */
.checkin-day.checked .checkin-day-icon {
    background-image: url('https://nguoibanvang.vn/wp-content/uploads/2025/09/HOAN-THANH.png') !important;
    background-size: cover !important;
    border: 3px solid #ADD8E6 !important;
    box-shadow: 0 4px 12px rgba(255, 200, 102, 0.4);
    transform: scale(1.1);
}

/* Debug: Thêm border đỏ để dễ nhận biết ngày đã checkin */
.checkin-day.checked {
    border-radius: 10px;
    padding: 5px;
}

/* Ngày chưa checkin - hiển thị hình kim cương */
.checkin-day.unchecked .checkin-day-icon {
    background-image: url('https://nguoibanvang.vn/wp-content/uploads/2025/09/CHUA-CHECK_1.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 3px solid #ddd;
}

/* Ngày hôm nay - cũng hiển thị hình kim cương */
.checkin-day.today .checkin-day-icon {
    border: 3px solid #ff6b6b;
    background-image: url('https://nguoibanvang.vn/wp-content/uploads/2025/09/CHUA-CHECK_1.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

/* Ngày trong tương lai - cũng hiển thị hình kim cương */
.checkin-day.future .checkin-day-icon {
    background-image: url('https://nguoibanvang.vn/wp-content/uploads/2025/09/CHUA-CHECK_1.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 3px solid #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}



.checkin-day.future .checkin-day-number {
    color: #ccc;
}

/* Animation cho ngày đã checkin */
@keyframes checkinPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.checkin-day.checked .checkin-day-icon {
    animation: checkinPulse 2s ease-in-out infinite;
}

.checkin-calendar-footer {
    text-align: center;
}

.checkin-perform-btn {
    background: #ADD8E6;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 40px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.checkin-perform-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
}

.checkin-back-btn {
    background: #ADD8E6;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkin-back-btn:hover {
    background: #e6b85c;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 200, 102, 0.4);
}

/* History Section (Hình 4) */
.checkin-history-section {
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.checkin-history-section h3 {
    color: #333;
    margin: 0 0 15px 0;
    font-size: 18px;
    text-align: center;
}

.checkin-history-table {
    max-height: 200px;
    overflow-y: auto;
}

.checkin-history-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.checkin-history-table th {
    background: #f8f9fa;
    color: #333;
    font-weight: bold;
    padding: 10px;
    text-align: left;
    border-bottom: 2px solid #dee2e6;
}

.checkin-history-table td {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.checkin-history-date {
    color: #666;
    font-weight: bold;
    min-width: 80px;
}

.checkin-history-gift {
    color: #333;
    flex: 1;
}

.checkin-history-code {
    color: #ff6b6b;
    font-weight: bold;
    font-size: 12px;
}

/* Success Popup (Hình 3) */
.checkin-success-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 350px;
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    z-index: 10001;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.checkin-success-icon {
    margin-bottom: 20px;
}

.checkin-success-gifts {
    position: relative;
    display: inline-block;
}

.checkin-success-gifts .gift {
    width: 60px;
    height: 60px;
    position: relative;
    display: inline-block;
    animation: giftBounce 0.6s ease-in-out;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 10px;
    margin: 0 5px;
}

.checkin-success-gifts .gift:nth-child(2) {
    animation-delay: 0.1s;
    margin-left: -10px;
}

/* Đảm bảo ảnh hiển thị */
.checkin-success-gifts .gift:not(:empty) {
    min-width: 60px;
    min-height: 60px;
}


/* Hình ảnh cho từng loại quà */
.checkin-success-gifts .gift.voucher-200k {
    background-image: url('https://cashion.vn/wp-content/uploads/2025/08/Voucher-Cashion-giam-them-200.000-VND.png');
    background-color: #f0f0f0;
}

.checkin-success-gifts .gift.tui-dung-tui {
    background-image: url('https://cashion.vn/wp-content/uploads/2025/08/Tui-dung-tui-hieu.png');
    background-color: #f0f0f0;
}

.checkin-success-gifts .gift.lac-tay-1 {
    background-image: url('https://cashion.vn/wp-content/uploads/2025/08/Lac-tay-hong-duyen-1.png');
    background-color: #f0f0f0;
}

.checkin-success-gifts .gift.lac-tay-2 {
    background-image: url('https://cashion.vn/wp-content/uploads/2025/08/Lac-tay-hong-duyen-2.png');
    background-color: #f0f0f0;
}

.checkin-success-gifts .gift.voucher-10 {
    background-image: url('https://cashion.vn/wp-content/uploads/2025/08/Voucher-CASHION-giam-den-10.png');
    background-color: #f0f0f0;
}

/* Quà mới - ECODE 3 TẦNG 10% */
.checkin-success-gifts .gift.ecode-3-tang-10 {
    background-image: url('https://nguoibanvang.vn/wp-content/uploads/2025/09/ECODE-3-TANG_1.png');
    background-color: #f0f0f0;
}

/* Quà mới - BÔNG TAI 10K */
.checkin-success-gifts .gift.bong-tai-10k {
    background-image: url('https://nguoibanvang.vn/wp-content/uploads/2025/09/BONG-TAI-10K.png');
    background-color: #f0f0f0;
}

/* Quà mới - PNJ 1 TRIỆU */
.checkin-success-gifts .gift.pnj-1-trieu {
    background-image: url('https://nguoibanvang.vn/wp-content/uploads/2025/09/PNJ-1-TRIEU.png');
    background-color: #f0f0f0;
}

/* Quà mới - ECODE 99K */
.checkin-success-gifts .gift.ecode-99k {
    background-image: url('https://nguoibanvang.vn/wp-content/uploads/2025/09/ECODE-99K_1.png');
    background-color: #f0f0f0;
}

@keyframes giftBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.checkin-success-text h3 {
    color: #333;
    margin: 0 0 5px 0;
    font-size: 20px;
    font-weight: bold;
}

.checkin-success-text p {
    color: #666;
    margin: 0 0 15px 0;
    font-size: 14px;
}

.checkin-success-message {
    font-size: 25px !important;
    color: #000 !important;
}

.checkin-success-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkin-success-ok {
    background: #ADD8E6;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 0px;
}

.checkin-success-guide {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 25px;
    padding: 12px 30px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkin-success-ok:hover,
.checkin-success-guide:hover {
    transform: translateY(-2px);
}

/* Close Button */
.checkin-close-btn {
    position: absolute;
    top: -10px;
    right: -25px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.checkin-close-btn:hover {
    background: #f0f0f0;
    color: #333;
}

/* Loading Animation */
.checkin-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #ff6b6b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive cho mobile */
@media (max-width: 768px) {
    .checkin-banner {
        width: 100%;
        max-width: 300px;
        height: 600px;
    }
    
    .checkin-success-gifts .gift {
        width: 50px;
        height: 50px;
    }
    
    .checkin-calendar {
        width: 95%;
        max-width: 400px;
        padding: 20px;
    }
    
    .checkin-calendar-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 12px;
        /* padding: 15px; */
    }
    
    .checkin-day-icon {
        width: 50px;
        height: 50px;
    }
    
    .checkin-day-number {
        font-size: 11px;
    }
    
    .checkin-trigger-icon {
        width: 80px;
        height: 80px;
        font-size: 10px;
    }
}
.checkin-history-table th{
    text-transform: none;
}
@media (max-width: 480px) {
    .checkin-banner {
        width: 100%;
        max-width: 300px;
        height: 600px;
    }
    
    .checkin-success-gifts .gift {
        width: 45px;
        height: 45px;
    }
    
    .checkin-calendar-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 10px;
    }
    
    .checkin-day-icon {
        width: 45px;
        height: 45px;
    }
    
    .checkin-day-number {
        font-size: 10px;
    }
    
    .checkin-header-logo {
        max-height: 60px;
    }
    
    .checkin-banner-logo {
        max-height: 80px;
    }
    
    .checkin-calendar-header {
        padding: 15px 0;
        margin-bottom: 20px;
    }
}

