/* ==========================================
   BOX OFFICE TABLE — RPN Box Office
   ========================================== */

/* ---- Date Filter ---- */
.boxoffice-date-filter {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.date-filter__quick {
    display: flex;
    gap: 6px;
}

.date-filter__btn {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.date-filter__btn:hover {
    border-color: #E23340;
    color: #E23340;
}

.date-filter__btn.active {
    background: #E23340;
    border-color: #E23340;
    color: #fff;
}

.date-filter__custom {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.date-filter__input {
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 12px;
    font-family: inherit;
    color: #333;
}

.date-filter__input:focus {
    outline: none;
    border-color: #E23340;
}

.date-filter__separator {
    color: #bbb;
    font-size: 13px;
}

.date-filter__apply {
    padding: 5px 14px;
    border-radius: 6px;
    border: none;
    background: #E23340;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.date-filter__apply:hover {
    background: #c62a38;
}

/* ---- Count-up animation helpers ---- */
[data-countup] {
    font-variant-numeric: tabular-nums;
}

/* ---- Progress Bar ---- */
.boxoffice-progress {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) 0;
}

.boxoffice-progress__bar {
    flex: 0 0 200px;
    height: 6px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.boxoffice-progress__fill {
    height: 100%;
    background: var(--gradient-cyan);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.boxoffice-progress__fill--pulse {
    width: 100%;
    animation: progress-pulse 2s ease-in-out infinite;
}

@keyframes progress-pulse {
    0%, 100% { opacity: 0.3; transform: scaleX(0.3); transform-origin: left; }
    50% { opacity: 1; transform: scaleX(1); }
}

.boxoffice-progress__text {
    font-size: var(--text-xs);
    color: var(--accent-cyan);
    animation: pulse 1.5s ease-in-out infinite;
}

/* ---- Summary ---- */
.boxoffice-summary {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) 0;
    flex-wrap: wrap;
}

.boxoffice-summary__badge {
    font-size: var(--text-xs);
    color: var(--accent-emerald);
    background: var(--accent-emerald-soft);
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.boxoffice-summary__text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.boxoffice-summary__time {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-left: auto;
}

/* ---- Total Revenue Row (BO-style) ---- */
.boxoffice-total-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-5) var(--space-6);
    background: linear-gradient(135deg, rgba(226, 51, 64, 0.06) 0%, rgba(252, 157, 166, 0.08) 100%);
    border: 1px solid rgba(226, 51, 64, 0.15);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.boxoffice-total__label {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.boxoffice-total__stats {
    display: flex;
    align-items: center;
    gap: var(--space-5);
}

.boxoffice-total__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.boxoffice-total__value {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: var(--text-2xl);
    color: var(--text-primary);
    line-height: 1.1;
}

.boxoffice-total__value--revenue {
    color: var(--brand-red);
    font-size: var(--text-3xl);
}

.boxoffice-total__unit {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.boxoffice-total__divider {
    width: 1px;
    height: 36px;
    background: var(--border-subtle);
}

/* ---- Box Office Table ---- */
.boxoffice-header-row {
    display: grid;
    grid-template-columns: 50px 1fr 90px 90px 190px;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
    position: sticky;
    top: 0;
    z-index: 5;
}

.boxoffice-col {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
}

.boxoffice-col--rank {
    justify-content: center;
}

.boxoffice-col--num,
.boxoffice-col--revenue {
    justify-content: flex-end;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

/* ---- Box Office Row ---- */
.boxoffice-row {
    display: grid;
    grid-template-columns: 50px 1fr 90px 90px 190px;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-1);
    align-items: center;
    transition: all var(--transition-fast);
}

.boxoffice-row:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-default);
    transform: translateX(2px);
}

.boxoffice-row--top {
    border-color: var(--border-default);
}

.boxoffice-row--top:nth-child(3) {
    background: linear-gradient(135deg, rgba(226, 51, 64, 0.04) 0%, var(--bg-card) 100%);
    border-color: rgba(226, 51, 64, 0.15);
}

/* ---- Rank ---- */
.boxoffice-rank {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: var(--text-lg);
    color: var(--text-tertiary);
    text-align: center;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.boxoffice-rank--1 { font-size: 1.5rem; }
.boxoffice-rank--2 { font-size: 1.4rem; }
.boxoffice-rank--3 { font-size: 1.3rem; }

/* ---- Movie Column ---- */
.boxoffice-col--movie {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
}

.boxoffice-poster {
    width: 40px;
    height: 56px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.boxoffice-poster--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    font-size: 18px;
}

.boxoffice-movie-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.boxoffice-movie-name {
    font-weight: 600;
    font-size: var(--text-sm);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Numbers ---- */
.boxoffice-num {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--text-base);
    color: var(--text-primary);
}

.boxoffice-num-label {
    font-size: 10px;
    color: var(--text-tertiary);
    font-weight: 400;
}

/* ---- Revenue ---- */
.boxoffice-revenue {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 15px;
    color: #E23340;
    white-space: nowrap;
}

/* ---- Section ---- */
.boxoffice-section {
    margin-bottom: var(--space-10);
}

.boxoffice-section .section-header {
    margin-bottom: var(--space-3);
}

.boxoffice-note {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    padding: var(--space-3) var(--space-4);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-top: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* ---- Responsive ---- */
@media (max-width: 1200px) {
    .boxoffice-header-row,
    .boxoffice-row {
        grid-template-columns: 40px 1fr 80px 80px 160px;
    }
    
    .boxoffice-total-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 768px) {
    .boxoffice-header-row,
    .boxoffice-row {
        grid-template-columns: 36px 1fr 80px 140px;
    }
    
    /* Hide Suất chiếu column on mobile */
    .boxoffice-col:nth-child(3) {
        display: none;
    }
    
    .boxoffice-row .boxoffice-col:nth-child(3) {
        display: none;
    }
    
    .boxoffice-poster {
        width: 32px;
        height: 44px;
    }
    
    .boxoffice-revenue {
        font-size: var(--text-sm);
    }
    
    .boxoffice-total__value {
        font-size: var(--text-xl);
    }
    
    .boxoffice-total__value--revenue {
        font-size: var(--text-2xl);
    }
}
