/**
 * Tệp CSS cho phần hiển thị (Public) của plugin Pricing Tiers Countdown.
 *
 * --- PHIÊN BẢN 5.4 - HOÀN THIỆN RESPONSIVE TOÀN DIỆN ---
 *
 * @package     Pricing_Tiers_Countdown
 * @subpackage  Pricing_Tiers_Countdown/public/assets/css
 * @author      VŨ TRUNG KIÊN
 * @version     5.4
 */

/* ==========================================================================
   1. Container chính
   ========================================================================== */
.tkvdc-container {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px 30px;
    text-align: center;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* ==========================================================================
   2. Trạng thái tải (Placeholder)
   ========================================================================== */
.tkvdc-loading-placeholder .tkvdc-timer-placeholder {
    height: 90px;
    width: 350px;
    background-color: #f0f0f0;
    border-radius: 6px;
    margin: 20px auto 25px;
}
.tkvdc-loading-placeholder .tkvdc-tiers-placeholder {
    display: flex;
    justify-content: center;
    gap: 15px;
}
.tkvdc-loading-placeholder .tkvdc-tier-placeholder {
    height: 280px;
    width: 200px;
    background-color: #f0f0f0;
    border-radius: 6px;
}

/* ==========================================================================
   3. Header & Đồng hồ đếm ngược (Cấu trúc chung)
   ========================================================================== */
.tkvdc-event-date-info {
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}
.tkvdc-timer-wrapper {
    margin-bottom: 25px;
}
.tkvdc-timer-title {
    font-weight: 600;
    margin-bottom: 15px;
}
.tkvdc-timer {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 10px;
}
.tkvdc-timer-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}
.tkvdc-timer-number {
    font-size: 2.5em;
    font-weight: 700;
    line-height: 1.1;
}
.tkvdc-timer-label {
    font-size: 0.875em;
    font-weight: 500;
    text-transform: uppercase;
}
.tkvdc-timer-separator {
    font-size: 2.5em;
    font-weight: 700;
    line-height: 1.1;
    color: #cbd5e0;
    padding-top: 0;
}
.tkvdc-timer-expired {
    font-size: 1.5em;
    font-weight: 700;
    color: #e53e3e;
    padding: 20px 0;
}

/* ==========================================================================
   4. Các mốc giá
   ========================================================================== */
.tkvdc-tiers-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    border-top: 1px solid #e0e0e0;
    padding-top: 25px;
}
.tkvdc-tier {
    flex: 1;
    min-width: 220px;
    max-width: 280px;
    padding: 20px;
    border-width: 2px;
    border-style: solid;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}
.tkvdc-milestone-label {
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
}
.tkvdc-milestone-date {
    font-size: 1.1em;
    font-weight: 700;
    margin-bottom: 12px;
}
.tkvdc-original-price {
    font-size: 0.9em;
}
.tkvdc-original-price .strikethrough { text-decoration: line-through; }
.tkvdc-discount-percent {
    font-size: 0.9em;
    font-weight: 600;
    color: #48bb78;
    margin-bottom: 12px;
}
.tkvdc-discounted-price {
    font-size: 1.5em;
    font-weight: 800;
    transition: color 0.3s ease;
}

/* ==========================================================================
   5. Trạng thái của các mốc giá
   ========================================================================== */
.tkvdc-tier.active {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
.tkvdc-tier.past, .tkvdc-tier.future {
    opacity: 0.6;
    filter: grayscale(50%);
}
.tkvdc-tier.past .tkvdc-discounted-price,
.tkvdc-tier.past .tkvdc-original-price { text-decoration: line-through; }

/* ==========================================================================
   6. Nút CTA
   ========================================================================== */
.tkvdc-cta-wrapper {
    margin-top: auto;
    padding-top: 20px;
}
.tkvdc-tier-cta {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 5px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    border: none;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}
.tkvdc-tier-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.tkvdc-tier.past .tkvdc-tier-cta,
.tkvdc-tier.future .tkvdc-tier-cta {
    background-color: #ccc !important;
    pointer-events: none;
    cursor: not-allowed;
    color: #888 !important;
}
.tkvdc-tier-cta.loading {
    cursor: wait;
    opacity: 0.7;
}

/* ==========================================================================
   7. Hiển thị Số lượng (Scarcity)
   ========================================================================== */
.tkvdc-quantity-info {
    font-size: 0.9em;
    font-weight: 500;
    color: #4a5568;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #e2e8f0;
}
.tkvdc-quantity-sold,
.tkvdc-quantity-total {
    font-weight: 700;
    color: #e53e3e;
}
.tkvdc-quantity-total {
    color: #2d3748;
}

/* ==========================================================================
   8. Nội dung sau khi hết giờ
   ========================================================================== */
.tkvdc-expired-content {
    padding: 20px;
    text-align: center;
}

/* ==========================================================================
   9. Kiểu Timer: Flip Clock
   ========================================================================== */
.tkvdc-timer-flip {
    gap: 20px;
}
.tkvdc-timer-flip .tkvdc-timer-block {
    flex-direction: column;
}
.tkvdc-timer-flip .tkvdc-timer-unit-wrapper {
    display: flex;
    gap: 3px;
}
.tkvdc-timer-flip .tkvdc-timer-label-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 5px;
}
.flip-card {
    display: inline-flex;
    flex-direction: column;
    position: relative;
    width: 45px;
    height: 60px;
    font-size: 2.5em;
    font-weight: 700;
    line-height: 60px;
    border-radius: 6px;
    background-color: #2d3748;
    color: #f7fafc;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.flip-card-top, .flip-card-bottom,
.flip-card-back::before, .flip-card-back::after {
    position: absolute;
    left: 0;
    width: 100%;
    height: 50%;
    overflow: hidden;
    backface-visibility: hidden;
}
.flip-card-top, .flip-card-back::before {
    top: 0;
    border-radius: 6px 6px 0 0;
    line-height: 60px;
}
.flip-card-bottom, .flip-card-back::after {
    bottom: 0;
    border-radius: 0 0 6px 6px;
    line-height: 0;
}
.flip-card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.flip-card-back::before {
    content: attr(data-before);
    background-color: #374151;
    transform-origin: bottom;
    transform: rotateX(180deg);
}
.flip-card-back::after {
    content: attr(data-after);
    background-color: #2d3748;
    transform-origin: top;
}
.flip-card.flip .flip-card-back::before {
    animation: flip-top 0.3s ease-in forwards;
}
.flip-card.flip .flip-card-back::after {
    animation: flip-bottom 0.3s ease-in 0.3s forwards;
}
@keyframes flip-top {
    100% { transform: rotateX(0deg); }
}
@keyframes flip-bottom {
    100% { transform: rotateX(180deg); }
}

/* ==========================================================================
   10. Responsive (Tablet ≤768px)
   ========================================================================== */
@media (max-width: 768px) {
    .tkvdc-container {
        padding: 18px 12px;
    }
    .tkvdc-timer {
        gap: 8px;
    }
    .tkvdc-timer-block {
        min-width: 55px;
    }
    .tkvdc-timer-number {
        font-size: 2em;
    }
    .tkvdc-timer-separator {
        font-size: 2em;
    }
    .tkvdc-timer-label {
        font-size: 0.75em;
    }
}

/* ==========================================================================
   11. Responsive (Mobile ≤480px)
   ========================================================================== */
@media (max-width: 480px) {
    .tkvdc-container {
        padding: 15px 10px;
    }
    .tkvdc-timer {
        gap: 4px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .tkvdc-timer-block {
        min-width: 42px;
    }
    .tkvdc-timer-number {
        font-size: 1.5em;
    }
    .tkvdc-timer-separator {
        font-size: 1.5em;
    }
    .tkvdc-timer-label {
        font-size: 0.6em;
    }
    /* Flip Clock specific adjustments for mobile */
    .flip-card {
        width: 34px;
        height: 44px;
        font-size: 1.6em;
        line-height: 44px;
    }
    .flip-card-top, 
    .flip-card-back::before {
        line-height: 44px;
    }
    .tkvdc-timer-flip .tkvdc-timer-separator {
        font-size: 1.6em;
        padding-top: 4px;
    }
    .tkvdc-timer-flip .tkvdc-timer-label {
        font-size: 0.6em;
    }
}