/**
 * Public Styles for Ticket Pricing Timeline
 * 
 * @package Ticket_Pricing_Timeline
 */

/* ==========================================================================
   Base Styles
   ========================================================================== */

.tpt-timeline-container * {
    box-sizing: border-box;
}

.tpt-timeline-container {
    position: relative;
    clear: both;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */

.tpt-timeline-container ul,
.tpt-timeline-container li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tpt-timeline-container h1,
.tpt-timeline-container h2,
.tpt-timeline-container h3,
.tpt-timeline-container h4,
.tpt-timeline-container h5,
.tpt-timeline-container h6 {
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.tpt-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.tpt-clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.tpt-loading {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.tpt-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: tpt-spin 1s linear infinite;
    z-index: 1000;
}

@keyframes tpt-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Error States
   ========================================================================== */

.tpt-error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 4px;
    padding: 12px 16px;
    color: #742a2a;
    font-size: 14px;
}

.tpt-error p {
    margin: 0;
}

/* ==========================================================================
   No Content States
   ========================================================================== */

.tpt-no-phases {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .tpt-timeline-container *,
    .tpt-timeline-container *::before,
    .tpt-timeline-container *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   Focus States
   ========================================================================== */

.tpt-timeline-item:focus {
    outline: 2px solid #005fcc;
    outline-offset: 2px;
}

.tpt-countdown-item:focus {
    outline: 2px solid #005fcc;
    outline-offset: 2px;
}

/* ==========================================================================
   Timeline Progress Bar Styles
   ========================================================================== */

.tpt-timeline-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.tpt-event-title h3 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
}

.tpt-event-description {
    text-align: center;
    margin-bottom: 40px;
    color: #666;
    font-size: 16px;
}

/* Progress Container */
.tpt-progress-container {
    margin: 40px 0;
    position: relative;
}

.tpt-progress-bar {
    width: 100%;
    height: 12px;
    background: linear-gradient(to right, 
        #ff6b35 0%, 
        #f7931e 20%, 
        #ffd700 40%, 
        #32cd32 60%, 
        #228b22 75%, 
        #ffa500 85%, 
        #ff6b35 100%);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tpt-progress-fill {
    height: 100%;
    background: rgba(255,255,255,0.3);
    border-radius: 20px;
    transition: width 0.8s ease-in-out;
    position: relative;
    overflow: hidden;
}

.tpt-progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(255,255,255,0.2) 25%, 
        transparent 25%, 
        transparent 50%, 
        rgba(255,255,255,0.2) 50%, 
        rgba(255,255,255,0.2) 75%, 
        transparent 75%);
    background-size: 20px 20px;
    animation: tpt-progress-stripes 1s linear infinite;
}

@keyframes tpt-progress-stripes {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

/* Current Phase Badge */
.tpt-current-phase-badge {
    position: absolute;
    top: -20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 10;
    transform: translateX(-50%);
    min-width: 32px;
    text-align: center;
    animation: tpt-badge-pulse 2s ease-in-out infinite alternate;
}

@keyframes tpt-badge-pulse {
    0% { 
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
        transform: translateX(-50%) scale(1);
    }
    100% { 
        box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
        transform: translateX(-50%) scale(1.05);
    }
}

.tpt-current-phase-badge::before {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #764ba2;
}

/* Phases Container */
.tpt-phases-container {
    margin: 20px 0;
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    max-width: 100%;
    justify-content: space-between;
}

.tpt-timeline-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 0px 20px 10px;
    border: 2px solid #e9ecef;
    text-align: left;
    position: relative;
    transition: all 0.3s ease;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tpt-timeline-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Phase Status Colors */
.tpt-phase-past {
    background: #f8f9fa;
    color: #6c757d;
    border-color: #dee2e6;
}

.tpt-phase-current {
    background: #e8f5e8;
    color: #2d5a2d;
    border: 3px solid #28a745;
    position: relative;
}

/* .tpt-phase-current::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: #28a745;
    border-radius: 50%;
} */

.tpt-phase-future {
    background: #f8f9fa;
    color: #6c757d;
    border-color: #dee2e6;
}

/* Phase Content */
.tpt-phase-content {
    text-align: left;
}

.tpt-phase-name {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.2;
    letter-spacing: 0.5px;
}

.tpt-phase-price {
    font-size: 24px;
    font-weight: 700;
    margin: 8px 0;
    line-height: 1;
    color: #2563eb;
}

.tpt-phase-current .tpt-phase-price {
    color: #2d5a2d;
}

.tpt-price-amount {
    display: inline;
}

.tpt-price-currency {
    font-size: 14px;
    margin-left: 5px;
    opacity: 0.7;
    font-weight: 400;
}

.tpt-phase-dates {
    font-size: 11px;
    opacity: 0.8;
    line-height: 1.4;
}

.tpt-date-start,
.tpt-date-end {
    margin: 0;
    font-size: 11px;
}

.tpt-date-start::before,
.tpt-date-end::before {
    content: "";
}

/* Countdown Timer */
.tpt-countdown-container {
    margin: 20px 0;
    text-align: center;
    padding: 20px;
}

.tpt-countdown-title {
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: 500;
}

.tpt-countdown {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.tpt-countdown-item {
    padding: 10px 15px;
    min-width: 70px;
}

.tpt-countdown-number {
    display: block;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.tpt-countdown-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    margin-top: 4px;
    opacity: 0.8;
}

/* Tablet responsive - giữ layout ngang */
@media (max-width: 1024px) and (min-width: 481px) {
    .tpt-timeline-container {
        padding: 15px;
    }
    
    .tpt-timeline-item {
        padding: 0px 15px 8px;
        margin: 0 3px;
    }
    
    .tpt-phase-name {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .tpt-phase-price {
        font-size: 20px;
        margin: 6px 0;
    }
    
    .tpt-price-currency {
        font-size: 12px;
    }
    
    .tpt-phase-dates {
        font-size: 10px;
    }
}

/* Mobile responsive - layout dọc chỉ trên điện thoại */
@media (max-width: 480px) {
    .tpt-timeline-container {
        padding: 15px;
    }
    
    .tpt-phases-container {
        flex-direction: column;
        gap: 12px;
        margin: 15px 0;
    }
    
    .tpt-timeline-item {
        margin: 0;
        padding: 0px 16px 10px;
        text-align: left;
    }
    
    .tpt-phase-name {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .tpt-phase-price {
        font-size: 20px;
        margin: 6px 0;
    }
    
    .tpt-price-currency {
        font-size: 12px;
    }
    
    .tpt-phase-dates {
        font-size: 10px;
    }
    
    .tpt-countdown {
        gap: 10px;
    }
    
    .tpt-countdown-item {
        padding: 10px 15px;
        min-width: 60px;
    }
    
    .tpt-countdown-number {
        font-size: 20px;
    }
    
    .tpt-current-phase-badge {
        font-size: 12px;
        padding: 6px 10px;
        top: -30px;
    }
    
    .tpt-current-phase-badge::before {
        border-width: 5px;
        bottom: -5px;
        border-top-color: #764ba2;
    }
}

/* Theme Variations */
.tpt-theme-dark {
    background: #2c3e50;
    color: white;
}

.tpt-theme-dark .tpt-timeline-item {
    background: #34495e;
    border-color: #4a5f7a;
    color: white;
}

.tpt-theme-dark .tpt-phase-future {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: #bdc3c7;
}

/* Compact Mode */
.tpt-compact .tpt-timeline-item {
    padding: 15px;
    min-width: 150px;
}

.tpt-compact .tpt-phase-name {
    font-size: 16px;
}

.tpt-compact .tpt-phase-price {
    font-size: 20px;
    margin: 10px 0;
}

/* Animation for progress fill */
.tpt-progress-fill.animated {
    animation: tpt-fill-progress 2s ease-out;
}

@keyframes tpt-fill-progress {
    0% { width: 0%; }
} 