/* ==========================================
   STYLE.CSS - GIAO DIỆN PHONG CÁCH BÁO THANH NIÊN
   Màu chủ đạo: Xanh Thanh Niên (#00558F), Đỏ (#C5192D)
   Font chữ: Merriweather (tiêu đề báo chí) & Inter (nội dung)
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Merriweather:ital,wght@0,400;0,700;0,900;1,400&display=swap');

:root {
    --tn-blue: #00558F;
    --tn-blue-dark: #003e6b;
    --tn-blue-light: #e8f1f8;
    --tn-red: #C5192D;
    --card-bg-light: #ffffff;
    --card-bg-dark: #1e293b;
    --border-light: #e2e8f0;
    --border-dark: #334155;
}

body {
    -webkit-tap-highlight-color: transparent;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Font tiêu đề báo chí truyền thống */
.font-headline {
    font-family: 'Merriweather', Georgia, serif;
}

/* Custom Scrollbar tinh tế */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
}
.dark ::-webkit-scrollbar-thumb {
    background-color: #475569;
}

/* Ẩn scrollbar thanh menu */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Dải chạy tin tức Ticker */
.ticker-content {
    animation: scroll-left 35s linear infinite;
}
.ticker-content:hover {
    animation-play-state: paused;
}
@keyframes scroll-left {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* Skeleton Loading Animation */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}
.skeleton {
    background: #f1f5f9;
    background-image: linear-gradient(to right, #f1f5f9 0%, #e2e8f0 20%, #f1f5f9 40%, #f1f5f9 100%);
    background-repeat: no-repeat;
    background-size: 1000px 100%;
    animation: shimmer 1.8s infinite linear forwards;
}
.dark .skeleton {
    background: #1e293b;
    background-image: linear-gradient(to right, #1e293b 0%, #334155 20%, #1e293b 40%, #1e293b 100%);
}

/* Cắt dòng văn bản súc tích */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-4 {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Hiệu ứng rê chuột bài báo */
.article-item {
    transition: background-color 0.2s ease, transform 0.2s ease;
}
.article-item:hover {
    background-color: rgba(0, 85, 143, 0.03);
}
.dark .article-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.article-item img {
    transition: transform 0.35s ease;
}
.article-item:hover img {
    transform: scale(1.04);
}

/* Số thứ tự tin đọc nhiều phong cách Báo Thanh Niên */
.rank-badge {
    font-family: 'Merriweather', Georgia, serif;
    font-weight: 900;
    line-height: 1;
}

/* Header chuyên mục gạch chân xanh */
.category-header {
    border-bottom: 2px solid #00558F;
}
.dark .category-header {
    border-bottom: 2px solid #38bdf8;
}

/* Image fallback */
.img-fallback {
    background: linear-gradient(45deg, #f1f5f9, #e2e8f0);
}
.dark .img-fallback {
    background: linear-gradient(45deg, #1e293b, #334155);
}

/* Button & Badge */
.btn-thanhnien {
    background-color: #00558F;
    color: #ffffff;
    transition: background-color 0.2s ease;
}
.btn-thanhnien:hover {
    background-color: #00406C;
}

/* Hiệu ứng cho Chatbot */
#chatbot-fab {
    box-shadow: 0 4px 14px rgba(0, 85, 143, 0.4);
}

/* ==========================================
   GIỌNG ĐỌC TIN TỨC & NÚT MICRO
   ========================================== */
.speech-btn {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    user-select: none;
}

.speech-btn:hover {
    transform: translateY(-1px);
}

.speech-btn:active {
    transform: translateY(0);
}

/* Trạng thái đang phát giọng đọc */
.speech-btn.is-playing {
    background-color: #fee2e2 !important;
    color: #dc2626 !important;
    border: 1px solid #fca5a5 !important;
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.2);
}

.dark .speech-btn.is-playing {
    background-color: rgba(220, 38, 38, 0.2) !important;
    color: #f87171 !important;
    border-color: #ef4444 !important;
}

/* Sóng âm thanh động khi đang phát */
.sound-wave {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    height: 12px;
}

.sound-wave span {
    display: inline-block;
    width: 2.5px;
    background-color: currentColor;
    border-radius: 2px;
    animation: wave-bar 1s ease-in-out infinite alternate;
}

.sound-wave span:nth-child(1) { height: 4px; animation-delay: 0.1s; }
.sound-wave span:nth-child(2) { height: 12px; animation-delay: 0.3s; }
.sound-wave span:nth-child(3) { height: 7px; animation-delay: 0.2s; }
.sound-wave span:nth-child(4) { height: 10px; animation-delay: 0.4s; }

@keyframes wave-bar {
    0% { height: 3px; }
    100% { height: 12px; }
}

/* Viền sáng nổi bật bài báo đang được đọc */
.article-item.is-speaking {
    border-color: #00558F !important;
    box-shadow: 0 4px 15px rgba(0, 85, 143, 0.15);
}

.dark .article-item.is-speaking {
    border-color: #38bdf8 !important;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.15);
}

/* Huy hiệu Tóm tắt bài viết */
.summary-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 7px;
    border-radius: 4px;
    background: #e8f1f8;
    color: #00558F;
    vertical-align: middle;
    margin-right: 6px;
    line-height: 1.2;
}

.dark .summary-tag {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}
