/* Đường dẫn: tubi-ai-pp-2/ui2/css/ui2-tabs.css */
/**
 * Tubi AI PP2 - UI2 Tâm Sự CSS
 * 
 * UI2: Menu tabs + 5 dots + Play bar
 * Font sizes tăng lớn cho dễ đọc
 * Toàn bộ chữ HOA
 * 
 * @package TubiAIPP2
 * @since 2.0.0
 */

/* Import Google Font - Poppins (tròn, dày, dễ đọc) */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;800;900&display=swap');

/* ============================================================================
   VARIABLES
   ============================================================================ */
:root {
    --tubi-ui2-tab-active: #FF0000;
    --tubi-ui2-tab-inactive: #0000B3;
    --tubi-ui2-tab-size-active: 20px;    /* Tăng từ 26px */
    --tubi-ui2-tab-size-inactive: 18px;  /* Tăng từ 22px */
    --tubi-ui2-separator: #999999;
    --tubi-ui2-separator-size: 18px;     /* Tăng từ 22px */
    --tubi-ui2-bg: #FFFFFF;
    --tubi-ui2-border: #E0E0E0;
    --tubi-ui2-shadow: rgba(0, 0, 0, 0.1);
    
    /* 5 Dots Colors */
    --tubi-ui2-dot-blue: #0000B3;
    --tubi-ui2-dot-yellow: #FFD700;
    --tubi-ui2-dot-red: #FF0000;
    --tubi-ui2-dot-white: #FFFFFF;
    --tubi-ui2-dot-orange: #FF8C00;
    
    /* Play Bar */
    --tubi-ui2-playbar-bg: #F8F9FA;
    --tubi-ui2-playbar-border: #E0E0E0;
    --tubi-ui2-playbar-text: #333333;
    --tubi-ui2-playbar-progress: #0000B3;
    --tubi-ui2-playbar-progress-bg: #E0E0E0;
}

/* ============================================================================
   CONTAINER
   ============================================================================ */
.tubi-ui2-wrap {
    width: 100%;
    background: transparent;
    font-family: 'Poppins', sans-serif;
}

/* ============================================================================
   MENU TABS
   ============================================================================ */
.tubi-ui2-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
}

/* Tab Button */
/* RESET THEME HELLO ELEMENTOR */
button.tubi-ui2-tab {
    border: none !important;
    border-radius: 0 !important;
    padding: 5px 8px !important;
    background: transparent !important;
}

.tubi-ui2-tab {
    padding: 5px 8px;
    border: none;
    background: transparent;
    color: var(--tubi-ui2-tab-inactive) !important;
    font-size: var(--tubi-ui2-tab-size-inactive) !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase !important;
    letter-spacing: 0.5px;
    text-decoration: none !important;
}

button.tubi-ui2-tab:hover,
.tubi-ui2-tab:hover {
    color: var(--tubi-ui2-tab-active) !important;
    background-color: transparent !important;
    border-color: transparent !important;
    transform: translateY(-1px);
    text-decoration: none !important;
}

button.tubi-ui2-tab.is-active,
.tubi-ui2-tab.is-active {
    color: var(--tubi-ui2-tab-active) !important;
    background-color: transparent !important;
    border-color: transparent !important;
    font-size: var(--tubi-ui2-tab-size-active) !important;
    font-weight: 700 !important;
    text-decoration: none !important;
}

.tubi-ui2-tab:focus {
    outline: 2px solid var(--tubi-ui2-tab-active);
    outline-offset: 2px;
}

/* Tab Text */
.tubi-ui2-tab-text {
    display: inline-block;
}

/* Separator */
.tubi-ui2-separator {
    color: var(--tubi-ui2-separator);
    font-size: var(--tubi-ui2-separator-size);
    user-select: none;
    font-weight: 700;
}

/* ============================================================================
   TAB TÂM SỰ - ANIMATION ĐỔI MÀU (5 màu cờ Phật giáo)
   ============================================================================ */

/* Class để kích hoạt animation khi recording */
.tubi-ui2-tab[data-tab="tamsu"].is-animating {
    animation: buddhaFlagColors 2.5s ease-in-out infinite;
    font-weight: 800;  /* Dày hơn khi animating */
}

/* Animation đổi màu: Xanh → Vàng → Đỏ → Trắng → Cam */
@keyframes buddhaFlagColors {
    0%, 100% {
        color: #0000B3;  /* Xanh */
        text-shadow: 0 0 8px rgba(0, 0, 179, 0.5);
    }
    20% {
        color: #FFD700;  /* Vàng */
        text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
    }
    40% {
        color: #FF0000;  /* Đỏ */
        text-shadow: 0 0 8px rgba(255, 0, 0, 0.5);
    }
    60% {
        color: #FFFFFF;  /* Trắng */
        text-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
    }
    80% {
        color: #FF8C00;  /* Cam */
        text-shadow: 0 0 8px rgba(255, 140, 0, 0.5);
    }
}

/* ============================================================================
   PLAY BAR
   ============================================================================ */
.tubi-ui2-playbar {
    position: fixed;
    bottom: 15px;
    left: 0;
    right: 0;
    display: none;
    background: var(--tubi-ui2-playbar-bg);
    border: 1px solid var(--tubi-ui2-playbar-border);
    border-radius: 8px;
    padding: 10px;
    margin: 0 auto;
    width: fit-content;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
}
}

.tubi-ui2-playbar.is-visible {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Play Bar Info */
.tubi-ui2-playbar-info {
    margin-bottom: 12px;
}

.tubi-ui2-playbar-title {
    font-size: 24px;          /* Tăng từ 22px */
    font-weight: 700;
    color: var(--tubi-ui2-playbar-text);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase; /* CHỮ HOA */
    letter-spacing: 0.5px;
}

/* Progress Bar */
.tubi-ui2-playbar-progress-wrap {
    position: relative;
    height: 8px;
    background: var(--tubi-ui2-playbar-progress-bg);
    border-radius: 4px;
    margin-bottom: 8px;
    cursor: pointer;
}

.tubi-ui2-playbar-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.tubi-ui2-playbar-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--tubi-ui2-playbar-progress);
    border-radius: 4px;
    width: 0%;
    transition: width 0.1s linear;
    pointer-events: none;
}

/* Time Display */
.tubi-ui2-playbar-time {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    font-size: 22px;          /* Tăng từ 20px */
    font-weight: 700;         /* BOLD */
    color: #666666;
    margin-bottom: 12px;
}

.tubi-ui2-playbar-separator {
    color: #999999;
}

/* Controls */
.tubi-ui2-playbar-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.tubi-ui2-playbar-btn {
    width: 21px;
    height: 21px;
    border: none;
    border-radius: 50%;
    background: #FFFFFF;
    color: var(--tubi-ui2-tab-inactive);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.tubi-ui2-playbar-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.tubi-ui2-playbar-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.tubi-ui2-playbar-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tubi-ui2-playbar-btn:focus {
    outline: 2px solid var(--tubi-ui2-tab-active);
    outline-offset: 2px;
}

/* Main Play/Pause Button */
.tubi-ui2-playbar-btn-main {
    width: 21px;
    height: 21px;
    background: var(--tubi-ui2-tab-inactive);
    color: #FFFFFF;
}

.tubi-ui2-playbar-btn-main:hover {
    background: var(--tubi-ui2-tab-active);
}

.tubi-ui2-playbar-icon {
    font-size: 16px;
    line-height: 1;
}

.tubi-ui2-playbar-btn-main .tubi-ui2-playbar-icon {
    font-size: 16px;
}

/* Volume */
.tubi-ui2-playbar-volume {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
}

.tubi-ui2-playbar-volume-slider {
    width: 80px;
    height: 6px;
    border-radius: 3px;
    background: var(--tubi-ui2-playbar-progress-bg);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.tubi-ui2-playbar-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--tubi-ui2-tab-inactive);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tubi-ui2-playbar-volume-slider::-webkit-slider-thumb:hover {
    background: var(--tubi-ui2-tab-active);
    transform: scale(1.2);
}

.tubi-ui2-playbar-volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--tubi-ui2-tab-inactive);
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.tubi-ui2-playbar-volume-slider::-moz-range-thumb:hover {
    background: var(--tubi-ui2-tab-active);
    transform: scale(1.2);
}

/* ============================================================================
   SLEEP OVERLAY (Tab 4)
   ============================================================================ */
.tubi-ui2-sleep-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.5s ease;
}

.tubi-ui2-sleep-overlay.is-visible {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tubi-ui2-sleep-content {
    text-align: center;
    color: white;
}

.tubi-ui2-sleep-text {
    font-size: 34px;          /* Tăng từ 32px */
    font-weight: 700;         /* BOLD */
    margin-bottom: 28px;
    line-height: 1.5;
    text-transform: uppercase; /* CHỮ HOA */
    letter-spacing: 1px;
}

.tubi-ui2-sleep-close {
    padding: 14px 28px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    border-radius: 8px;
    color: white;
    font-size: 22px;           /* Tăng từ 20px */
    font-weight: 700;          /* BOLD */
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase; /* CHỮ HOA */
    letter-spacing: 0.5px;
}

.tubi-ui2-sleep-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* ============================================================================
   QUOTE OVERLAY (Tab 5)
   ============================================================================ */
/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 768px) {
    .tubi-ui2-menu {
        padding: 14px 12px;
        gap: 8px;
    }
    
    .tubi-ui2-tab {
        padding: 8px 10px;
        font-size: 24px;          /* Tăng từ 22px (+2) */
        font-weight: 700;         /* BOLD */
    }
    
    .tubi-ui2-tab.is-active {
        font-size: 28px;          /* Tăng từ 26px (+2) */
        font-weight: 700;         /* BOLD */
    }
    
    .tubi-ui2-separator {
        font-size: 24px;          /* Tăng từ 22px (+2) */
    }
    
    .tubi-ui2-playbar {
        padding: 14px 16px;
    }
    
    .tubi-ui2-playbar-title {
        font-size: 22px;          /* Tăng từ 20px */
        font-weight: 700;         /* BOLD */
    }
    
    .tubi-ui2-playbar-time {
        font-size: 20px;          /* Tăng từ 18px */
        font-weight: 700;         /* BOLD */
    }
    
    .tubi-ui2-playbar-btn {
        width: 40px;
        height: 40px;
    }
    
    .tubi-ui2-playbar-btn-main {
        width: 50px;
        height: 50px;
    }
    
    .tubi-ui2-playbar-volume-slider {
        width: 60px;
    }
}

@media (max-width: 480px) {
    .tubi-ui2-menu {
        padding: 12px 8px;
        gap: 3px;              /* ✅ Giảm từ 6px → 3px (gọn hơn) */
    }
    
    .tubi-ui2-tab {
        padding: 4px 5px;      /* ✅ Giảm từ 6px 8px → 4px 5px (gọn hơn) */
        font-size: 20px;       /* ✅ Giảm từ 22px → 20px (vẫn đủ lớn cho người già) */
        font-weight: 700;      /* BOLD */
    }
    
    .tubi-ui2-tab.is-active {
        font-size: 23px;       /* ✅ Giảm từ 26px → 23px (tỉ lệ với tab thường) */
        font-weight: 700;      /* BOLD */
    }
    
    .tubi-ui2-separator {
        font-size: 20px;       /* ✅ Giảm từ 22px → 20px (đồng bộ với tab) */
        padding: 0 2px;        /* ✅ Thêm padding nhỏ cho separator */
    }
    
    .tubi-ui2-playbar {
        padding: 12px;
    }
    
    .tubi-ui2-playbar-title {
        font-size: 21px;          /* Tăng từ 19px */
        font-weight: 700;         /* BOLD */
    }
    
    .tubi-ui2-playbar-time {
        font-size: 19px;          /* Tăng từ 17px */
        font-weight: 700;         /* BOLD */
    }
    
    .tubi-ui2-playbar-btn {
        width: 21px;
        height: 21px;
    }
    
    .tubi-ui2-playbar-btn-main {
        width: 46px;
        height: 46px;
    }
    
    
    
    .tubi-ui2-playbar-controls {
        gap: 8px;
    }
    
    .tubi-ui2-playbar-volume {
        display: none; /* Hide volume on very small screens */
    }
    
    .tubi-ui2-sleep-text {
        font-size: 30px;          /* Tăng từ 28px */
        font-weight: 700;         /* BOLD */
    }
    
}

/* ẨN CÁC PHẦN KHÔNG CẦN */
.tubi-ui2-playbar-info,
.tubi-ui2-playbar-title,
.tubi-ui2-playbar-time,
.tubi-ui2-playbar-progress-wrap,
#tubi-ui2-playbar-prev,
#tubi-ui2-playbar-next {
    display: none !important;
}

/* CHỈ 4 NÚT ICON */
.tubi-ui2-playbar-volume-slider {
    display: none !important;
}

/* ẨN PLAYBAR */
.tubi-ui2-playbar {
    display: none !important;
}

/* INLINE CONTROLS - PLAY + MUTE (Cầu Kinh, Thiền Định, Ngủ Ngon, Tấm Lòng Bồ Tát) */
.tubi-ui2-inline-controls {
    display: none;
    align-items: center;
    gap: 4px;
    margin-left: 8px;
}

.tubi-ui2-inline-controls.is-visible {
    display: inline-flex;
}

.tubi-ui2-inline-btn {
    display: inline-flex;
    width: 21px;
    height: 21px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #FF8C00;  /* Cam cờ Phật */
    color: #FFFFFF;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.tubi-ui2-inline-btn:hover {
    background: #FF7700;  /* Cam đậm hơn khi hover */
    transform: scale(1.05);
}

.tubi-ui2-inline-btn:active {
    transform: scale(0.95);
}

/* Play button active state */
.tubi-ui2-inline-btn#tubi-ui2-inline-play.is-playing {
    background: #FF7700;  /* Cam đậm khi đang play */
}

/* ============================================================================
   TOGGLE ICONS: PLAY/PAUSE (with high specificity to override theme)
   ============================================================================ */

/* Default state: Show play icon, hide pause icon */
.tubi-ui2-inline-btn#tubi-ui2-inline-play .tubi-ui2-icon-play {
    display: block !important;
}

.tubi-ui2-inline-btn#tubi-ui2-inline-play .tubi-ui2-icon-pause {
    display: none !important;
}

/* Playing state: Hide play icon, show pause icon */
.tubi-ui2-inline-btn#tubi-ui2-inline-play.is-playing .tubi-ui2-icon-play {
    display: none !important;
}

.tubi-ui2-inline-btn#tubi-ui2-inline-play.is-playing .tubi-ui2-icon-pause {
    display: block !important;
}

/* ============================================================================
   TOGGLE ICONS: VOLUME/MUTED (with high specificity to override theme)
   ============================================================================ */

/* Default state: Show volume icon, hide muted icon */
.tubi-ui2-inline-btn#tubi-ui2-inline-mute .tubi-ui2-icon-volume {
    display: block !important;
}

.tubi-ui2-inline-btn#tubi-ui2-inline-mute .tubi-ui2-icon-muted {
    display: none !important;
}

/* Muted state: Hide volume icon, show muted icon */
.tubi-ui2-inline-btn#tubi-ui2-inline-mute.is-muted .tubi-ui2-icon-volume {
    display: none !important;
}

.tubi-ui2-inline-btn#tubi-ui2-inline-mute.is-muted .tubi-ui2-icon-muted {
    display: block !important;
}

/* SVG icon styles */
.tubi-ui2-inline-icon {
    width: 21px;
    height: 21px;
    pointer-events: none;
}

/* ============================================================================
   STOP BUTTON - Emergency Stop All Services
   ============================================================================ */

.tubi-ui2-stop-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 21px;  /* ✅ Bằng nút Play */
    height: 21px;  /* ✅ Bằng nút Play */
    padding: 0;  /* ✅ Giống nút Play */
    margin-left: 4px;  /* ✅ Gap giống Play-Mute */
    border: none;
    border-radius: 8px;  /* Vuông, khác với Play (circular) */
    background: #96705B;  /* Nâu sồng */
    color: #FFFFFF;  /* Icon trắng */
    cursor: pointer;
    transition: all 0.2s ease;
}

.tubi-ui2-stop-btn:hover {
    background: #7D5A49;  /* Nâu đậm hơn khi hover */
    transform: scale(1.05);  /* Giống Play */
}

.tubi-ui2-stop-btn:active {
    transform: scale(0.95);  /* Giống Play */
}

/* Stop icon */
.tubi-ui2-stop-icon {
    width: 21px;  /* ✅ Bằng nút Play */
    height: 21px;  /* ✅ Bằng nút Play */
    pointer-events: none;
}

/* Hide stop button initially (show only when needed) */
.tubi-ui2-stop-btn.is-hidden {
    display: none;
}

/* ============================================================================
   QUOTE OVERLAY (Tab 5: Trích Dẫn)
   ============================================================================ */

.tubi-ui2-quote-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.tubi-ui2-quote-card {
    background: white;
    border-radius: 20px;
    max-width: 700px;
    width: 100%;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideUp 0.4s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Custom scrollbar */
.tubi-ui2-quote-card::-webkit-scrollbar {
    width: 8px;
}

.tubi-ui2-quote-card::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.tubi-ui2-quote-card::-webkit-scrollbar-thumb {
    background: #FF8C00;
    border-radius: 10px;
}

.tubi-ui2-quote-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.tubi-ui2-quote-close:hover {
    background: #FF8C00;
    color: white;
    transform: rotate(90deg);
}

.tubi-ui2-quote-icon {
    font-size: 60px;
    color: #FF8C00;
    margin-bottom: 20px;
    line-height: 1;
    text-align: center;
}

.tubi-ui2-quote-title {
    font-size: 28px;
    font-weight: 700;
    color: #FF8C00;
    margin-bottom: 25px;
    line-height: 1.4;
    text-align: center;
}

.tubi-ui2-quote-divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(to right, #FF8C00, #FFA500);
    margin: 0 auto 25px;
    border-radius: 2px;
}

.tubi-ui2-quote-content {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.8;
    text-align: justify;
    margin-bottom: 30px;
}

.tubi-ui2-quote-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.tubi-ui2-quote-btn-next {
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Quicksand', sans-serif;
    background: #FF8C00;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 140, 0, 0.3);
}

.tubi-ui2-quote-btn-next:hover {
    background: #FFA500;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 140, 0, 0.4);
}

.tubi-ui2-quote-footer {
    text-align: center;
    font-size: 16px;
    color: #666;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.tubi-ui2-quote-footer a {
    color: #0000B3;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.tubi-ui2-quote-footer a:hover {
    color: #FF8C00;
    text-decoration: underline;
}

/* Mobile responsive - CỠ CHỮ TO cho người già */
@media (max-width: 768px) {
    .tubi-ui2-quote-card {
        padding: 30px 25px;
        border-radius: 15px;
    }

    .tubi-ui2-quote-title {
        font-size: 24px;
        font-weight: 700;
    }

    .tubi-ui2-quote-content {
        font-size: 20px;
        font-weight: 600;
        line-height: 1.9;
    }

    .tubi-ui2-quote-icon {
        font-size: 50px;
    }

    .tubi-ui2-quote-btn-next {
        width: 100%;
        font-size: 18px;
        padding: 15px 30px;
    }

    .tubi-ui2-quote-footer {
        font-size: 18px;
    }
}
