/* ============================================
   Bitcoin PeakDip - Post CSS (Tối ưu hóa)
   File: assets/css/post.css
   Phiên bản: 2.1.0 - Bổ sung ToC, Back to Top, Mobile
   ============================================ */

/* ===== RESET & BIẾN CỤC BỘ ===== */
:root {
    --post-max-width: 900px;
    --post-content-padding: 30px;
    --post-mobile-padding: 16px;
    --toc-width: 260px;
    --toc-mobile-breakpoint: 768px;
}

/* ===== ARTICLE HEADER - GỌN GÀNG ===== */
.article-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.article-title {
    font-size: 2.2em;
    background: linear-gradient(to right, var(--wave-trough), var(--wave-peak));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 12px;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9em;
}

.article-meta i {
    color: var(--wave-trough);
    margin-right: 5px;
    width: 16px;
}

/* ===== LAYOUT CHÍNH: TỐI ƯU KHÔNG GIAN ===== */
.article-with-outline {
    display: flex;
    gap: 25px;
    position: relative;
    max-width: var(--post-max-width);
    margin: 0 auto;
}

/* ===== TABLE OF CONTENTS SIDEBAR ===== */
.article-outline {
    flex: 0 0 var(--toc-width);
    position: sticky;
    top: 90px;
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    background: rgba(10, 15, 25, 0.6);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(0, 212, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    scrollbar-width: thin;
    scrollbar-color: var(--wave-trough) rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.article-outline:hover {
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.1);
}

/* Scrollbar styling */
.article-outline::-webkit-scrollbar {
    width: 5px;
}

.article-outline::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.article-outline::-webkit-scrollbar-thumb {
    background: var(--wave-trough);
    border-radius: 3px;
}

.article-outline::-webkit-scrollbar-thumb:hover {
    background: var(--wave-mid);
}

.outline-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.outline-header i {
    color: var(--wave-trough);
    font-size: 1em;
    animation: pulse 2s infinite;
}

.outline-header h3 {
    color: white;
    font-size: 1em;
    margin: 0;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.outline-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.outline-item {
    margin-bottom: 6px;
    font-size: 0.9em;
}

.outline-item a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1.4;
    border-left: 2px solid transparent;
}

.outline-item a i {
    color: var(--wave-trough);
    font-size: 0.5em;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.outline-item a:hover {
    background: rgba(0, 212, 255, 0.1);
    color: white;
    padding-left: 15px;
}

.outline-item a:hover i {
    opacity: 1;
    transform: scale(1.2);
}

.outline-item a.active {
    background: rgba(0, 212, 255, 0.15);
    color: white;
    border-left: 2px solid var(--wave-trough);
    font-weight: 500;
}

.outline-item a.active i {
    opacity: 1;
    color: white;
}

.outline-h3 a {
    font-size: 0.85em;
    padding-left: 28px;
}

/* Loading và no-headings states */
.loading-outline,
.no-headings {
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 20px 10px;
    font-style: italic;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.loading-outline i {
    color: var(--wave-trough);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== NỘI DUNG CHÍNH ===== */
.article-content {
    flex: 1;
    min-width: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
    border: none;
    word-wrap: break-word;
}

/* Typography */
.article-content h2 {
    color: white;
    font-size: 1.8em;
    margin: 30px 0 15px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    padding-bottom: 8px;
    scroll-margin-top: 80px; /* Cho smooth scroll với fixed header */
}

.article-content h3 {
    color: var(--wave-trough);
    font-size: 1.3em;
    margin: 25px 0 12px;
    scroll-margin-top: 80px;
}

.article-content p {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.7;
    margin-bottom: 18px;
    font-size: 1.05em;
}

.article-content ul, 
.article-content ol {
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.7;
    margin: 15px 0;
    padding-left: 25px;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content strong {
    color: var(--wave-trough);
}

.article-content em {
    color: var(--wave-mid);
}

.article-content a {
    color: var(--wave-trough);
    text-decoration: none;
    border-bottom: 1px dashed rgba(0, 212, 255, 0.3);
    transition: all 0.2s ease;
}

.article-content a:hover {
    color: white;
    border-bottom-color: white;
}

/* Blockquote */
.article-content blockquote {
    background: rgba(0, 212, 255, 0.05);
    border-left: 3px solid var(--wave-trough);
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: rgba(255, 255, 255, 0.9);
}

.article-content blockquote p:last-child {
    margin-bottom: 0;
}

/* ===== CODE BLOCKS ===== */
.article-content pre,
.article-content .highlighter-rouge {
    background: #1a1a2a;
    border-radius: 8px;
    padding: 16px;
    margin: 20px 0;
    overflow-x: auto;
    border: 1px solid rgba(0, 212, 255, 0.15);
    font-size: 0.95em;
    position: relative;
}

.article-content pre code,
.article-content .highlighter-rouge code {
    color: #e2e2e2;
    font-family: 'Fira Code', 'Courier New', monospace;
    line-height: 1.5;
}

/* Label cho code block */
.article-content .language-javascript.highlighter-rouge::before,
.article-content .language-js.highlighter-rouge::before {
    content: "JS";
    position: absolute;
    top: 8px;
    right: 12px;
    background: var(--wave-trough);
    color: black;
    font-size: 0.7em;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    opacity: 0.7;
    z-index: 1;
}

.article-content .language-html.highlighter-rouge::before {
    content: "HTML";
    position: absolute;
    top: 8px;
    right: 12px;
    background: #f16529;
    color: white;
    font-size: 0.7em;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    opacity: 0.7;
}

.article-content .language-css.highlighter-rouge::before {
    content: "CSS";
    position: absolute;
    top: 8px;
    right: 12px;
    background: #2965f1;
    color: white;
    font-size: 0.7em;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    opacity: 0.7;
}

.article-content .language-bash.highlighter-rouge::before,
.article-content .language-sh.highlighter-rouge::before {
    content: "BASH";
    position: absolute;
    top: 8px;
    right: 12px;
    background: #4eaa25;
    color: white;
    font-size: 0.7em;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    opacity: 0.7;
}

/* ===== TABLES ===== */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    overflow: hidden;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.article-content th {
    background: rgba(0, 212, 255, 0.15);
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--wave-trough);
}

.article-content td {
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.article-content tr:last-child td {
    border-bottom: none;
}

.article-content tr:hover td {
    background: rgba(0, 212, 255, 0.05);
}

/* ===== IMAGES ===== */
.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 25px auto;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* ===== INFO BOXES ===== */
.article-content .info-box,
.article-content .tip-box,
.article-content .warning-box {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    margin: 20px 0;
    border-radius: 8px;
    align-items: flex-start;
    border-left: 3px solid;
}

.article-content .info-box {
    background: rgba(0, 212, 255, 0.05);
    border-left-color: #00d4ff;
}

.article-content .tip-box {
    background: rgba(247, 147, 26, 0.05);
    border-left-color: #f7931a;
}

.article-content .warning-box {
    background: rgba(255, 46, 99, 0.05);
    border-left-color: #ff2e63;
}

.article-content .info-box i,
.article-content .tip-box i,
.article-content .warning-box i {
    font-size: 1.2em;
    flex-shrink: 0;
    margin-top: 2px;
}

.article-content .info-box i {
    color: #00d4ff;
}

.article-content .tip-box i {
    color: #f7931a;
}

.article-content .warning-box i {
    color: #ff2e63;
}

.article-content .info-box div,
.article-content .tip-box div,
.article-content .warning-box div {
    flex: 1;
}

.article-content .info-box strong,
.article-content .tip-box strong,
.article-content .warning-box strong {
    display: block;
    margin-bottom: 5px;
    color: white;
}

/* ===== STEP CONTAINER ===== */
.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.step {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px 15px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.step:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.step-number {
    width: 40px;
    height: 40px;
    background: rgba(0, 212, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 1.2em;
    font-weight: bold;
    color: var(--wave-trough);
    border: 1px solid rgba(0, 212, 255, 0.3);
    transition: all 0.2s ease;
}

.step:hover .step-number {
    background: var(--wave-trough);
    color: black;
    transform: scale(1.1);
}

.step h3 {
    color: white;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.step p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    margin: 0;
    font-size: 0.9em;
}

/* ===== POST HEADER ===== */
.post-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 25px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(0,212,255,0.1);
}

.post-header h1 {
    font-size: 2.5em;
    margin-bottom: 8px;
    background: linear-gradient(to right, #00d4ff, #ff2e63);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.post-header p {
    font-size: 1.1em;
    color: rgba(255,255,255,0.8);
}

.post-header div span {
    display: inline-block;
    margin: 5px;
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: bold;
}

/* ===== MOBILE OUTLINE ===== */
.mobile-outline {
    display: none;
    margin-bottom: 15px;
}

.mobile-outline-toggle {
    width: 100%;
    background: rgba(10, 15, 25, 0.8);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 10px;
    padding: 14px 18px;
    color: white;
    font-size: 1em;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.mobile-outline-toggle:hover {
    background: rgba(0, 212, 255, 0.15);
    border-color: var(--wave-trough);
}

.mobile-outline-toggle i:first-child {
    color: var(--wave-trough);
    font-size: 1.1em;
}

.mobile-outline-toggle i:last-child {
    margin-left: auto;
    transition: transform 0.3s ease;
    color: rgba(255, 255, 255, 0.7);
}

.mobile-outline-menu {
    display: none;
    background: rgba(10, 15, 25, 0.95);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 10px;
    padding: 16px;
    margin-top: 8px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    max-height: 60vh;
    overflow-y: auto;
}

.mobile-outline-menu.active {
    display: block;
    animation: slideDown 0.3s ease;
}

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

/* ===== ARTICLE FOOTER ===== */
.article-footer-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
    gap: 15px;
}

.footer-left, .footer-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.back-to-learn {
    color: var(--wave-trough);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
    padding: 10px 18px;
    background: rgba(0, 212, 255, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    transition: all 0.2s ease;
}

.back-to-learn:hover {
    background: rgba(0, 212, 255, 0.15);
    border-color: var(--wave-trough);
    transform: translateY(-2px);
}

.back-to-top {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
    transition: all 0.2s ease;
    opacity: 0.5;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--wave-trough);
    color: black;
    border-color: var(--wave-trough);
    transform: translateY(-2px);
}

.back-to-top:hover i {
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.share-article {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
    transition: all 0.2s ease;
}

.share-article:hover {
    background: rgba(0, 212, 255, 0.15);
    border-color: var(--wave-trough);
    transform: translateY(-2px);
}

.share-article:hover i {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: rotate(0); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

/* ===== ANIMATIONS ===== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .article-outline {
        flex-basis: 220px;
        padding: 14px;
    }
    
    .article-title {
        font-size: 2em;
    }
}

@media (max-width: 768px) {
    .article-with-outline {
        flex-direction: column;
        gap: 10px;
    }
    
    .article-outline {
        display: none;
    }
    
    .mobile-outline {
        display: block;
    }
    
    .article-header {
        margin-bottom: 15px;
    }
    
    .article-title {
        font-size: 1.8em;
    }
    
    .article-content {
        padding: 0;
    }
    
    .article-content p {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 15px;
    }
    
    .article-content h2 {
        font-size: 1.5em;
        margin: 25px 0 12px;
    }
    
    .article-content h3 {
        font-size: 1.2em;
        margin: 20px 0 10px;
    }
    
    .article-content pre,
    .article-content .highlighter-rouge {
        margin: 15px -16px;
        border-radius: 0;
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    .article-content pre code {
        white-space: pre-wrap;
        word-wrap: break-word;
    }
    
    .article-content table {
        margin: 15px -16px;
        width: calc(100% + 32px);
        border-radius: 0;
    }
    
    .steps-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .step {
        padding: 15px;
    }
    
    .post-header {
        padding: 20px 15px;
    }
    
    .post-header h1 {
        font-size: 1.8em;
    }
    
    .post-header p {
        font-size: 1em;
    }
    
    .post-header div span {
        display: block;
        margin: 8px 0 !important;
    }
    
    .article-footer-nav {
        flex-direction: column;
        align-items: stretch;
    }
    
    .footer-left, .footer-right {
        width: 100%;
        justify-content: center;
    }
    
    .footer-right {
        flex-direction: column;
    }
    
    .back-to-learn,
    .back-to-top,
    .share-article {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    .article-meta {
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .article-title {
        font-size: 1.5em;
    }
    
    .article-content p {
        font-size: 0.95rem;
    }
    
    .post-header h1 {
        font-size: 1.5em;
    }
    
    .post-header p {
        font-size: 0.95em;
    }
    
    .article-meta span {
        width: 100%;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .mobile-outline-toggle {
        padding: 12px 14px;
        font-size: 0.95em;
    }
}

@media (max-width: 360px) {
    .article-title {
        font-size: 1.3em;
    }
    
    .article-content h2 {
        font-size: 1.3em;
    }
    
    .article-content h3 {
        font-size: 1.1em;
    }
}

/* ===== IN ẤN ===== */
@media print {
    .article-outline,
    .mobile-outline,
    .article-footer-nav,
    .share-article,
    .back-to-top,
    .status-indicator,
    .sensor-network {
        display: none !important;
    }
    
    .article-with-outline {
        display: block;
    }
    
    .article-content {
        background: white;
        color: black;
        padding: 20px;
    }
    
    .article-content h2,
    .article-content h3,
    .article-content p,
    .article-content li {
        color: black;
    }
    
    .article-content a {
        color: blue;
        text-decoration: underline;
    }
    
    .article-content pre,
    .article-content code {
        border: 1px solid #ddd;
        background: #f5f5f5;
        color: #333;
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    .article-content a {
        color: #00d4ff;
        text-decoration: underline;
    }
    
    .step {
        border: 2px solid white;
    }
    
    .article-outline {
        border: 2px solid var(--wave-trough);
    }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
.post-language {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(156, 39, 176, 0.15);
    color: #9c27b0;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    border: 1px solid rgba(156, 39, 176, 0.3);
}

.post-language i {
    color: #9c27b0;
    font-size: 0.9em;
}

/* ===== CYCLE CARDS - DÙNG CHO BÀI VIẾT PHÂN TÍCH CHU KỲ ===== */
.cycle-card {
    border-left: 4px solid;
    padding: 20px;
    margin: 20px 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0 10px 10px 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cycle-card:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.cycle-2013 { border-left-color: #f7931a; }
.cycle-2017 { border-left-color: #9c27b0; }
.cycle-2021 { border-left-color: #2196f3; }
.cycle-2024 { border-left-color: #00d4ff; }

.cycle-card h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.cycle-2013 h4 { color: #f7931a; }
.cycle-2017 h4 { color: #9c27b0; }
.cycle-2021 h4 { color: #2196f3; }
.cycle-2024 h4 { color: #00d4ff; }

/* ===== TIMELINE - DÙNG CHO BẤT KỲ BÀI VIẾT NÀO CẦN TIMELINE ===== */
.cycle-timeline {
    display: flex;
    justify-content: space-between;
    margin: 30px 0;
    position: relative;
    padding: 20px 0;
}

.cycle-timeline::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #f7931a, #9c27b0, #2196f3, #00d4ff);
    transform: translateY(-50%);
    border-radius: 2px;
    z-index: 1;
}

.timeline-item {
    position: relative;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
    transition: transform 0.3s ease;
}

.timeline-item:hover {
    transform: translateY(-5px);
    border-color: #00d4ff;
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.3);
}

.timeline-item .year {
    font-weight: bold;
    color: #00d4ff;
    font-size: 1.1em;
}

.timeline-item .event {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

/* ===== GRID 2 CỘT - DÙNG CHO NHIỀU LOẠI BÀI VIẾT ===== */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.grid-card {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.grid-card:hover {
    transform: translateY(-5px);
    border-color: #00d4ff;
    box-shadow: 0 10px 20px rgba(0, 212, 255, 0.2);
}

.grid-card h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #00d4ff;
    font-size: 1.2em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.grid-card ul {
    margin: 0;
    padding-left: 20px;
}

.grid-card li {
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.9);
}

/* ===== CHART CONTAINER - DÙNG CHO BẤT KỲ BIỂU ĐỒ NÀO ===== */
.chart-container {
    position: relative;
    height: 300px;
    margin: 30px 0;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== RESPONSIVE CHO TẤT CẢ CÁC COMPONENT ===== */
@media (max-width: 768px) {
    .cycle-timeline {
        flex-direction: column;
        gap: 10px;
    }
    
    .cycle-timeline::before {
        display: none;
    }
    
    .timeline-item {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        padding: 12px 20px;
    }
    
    .timeline-item .year {
        margin-right: 15px;
    }
    
    .grid-2 {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 250px;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .cycle-card {
        padding: 15px;
    }
    
    .grid-card {
        padding: 15px;
    }
    
    .timeline-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .timeline-item .year {
        margin-right: 0;
    }


}

/* ===== INSTALL STEPS - HƯỚNG DẪN CÀI ĐẶT ỨNG DỤNG ===== */
.install-steps {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.install-step {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.install-step:hover {
    border-color: rgba(0, 212, 255, 0.3);
    background: rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
}

.step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.step-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--wave-trough), var(--wave-mid));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    color: #000;
    flex-shrink: 0;
}

.step-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

.step-content p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.step-screenshot {
    margin: 1rem 0;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.step-screenshot img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-height: 450px;
    object-fit: contain;
}

.caption {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.75rem;
    font-style: italic;
}

/* iOS và Android viền màu đặc trưng */
.ios-steps .install-step {
    border-left: 3px solid #007aff;
}

.android-steps .install-step {
    border-left: 3px solid #3ddc84;
}

/* Table lợi ích */
.install-benefits-table {
    margin: 1.5rem 0;
    width: 100%;
    border-collapse: collapse;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
}

.install-benefits-table th {
    background: rgba(0, 212, 255, 0.15);
    color: #fff;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--wave-trough);
}

.install-benefits-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.install-benefits-table tr:last-child td {
    border-bottom: none;
}

.install-benefits-table tr:hover td {
    background: rgba(0, 212, 255, 0.05);
}

.install-benefits-table i {
    color: var(--wave-trough);
    width: 24px;
    margin-right: 8px;
}

/* Responsive cho mobile */
@media (max-width: 768px) {
    .install-step {
        padding: 1rem;
    }
    
    .step-header {
        gap: 0.75rem;
    }
    
    .step-number {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .step-title {
        font-size: 1rem;
    }
    
    .step-screenshot {
        padding: 0.5rem;
    }
    
    .step-screenshot img {
        max-height: 320px;
    }
    
    .install-benefits-table th,
    .install-benefits-table td {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .step-screenshot img {
        max-height: 280px;
    }
    
    .install-benefits-table th,
    .install-benefits-table td {
        padding: 8px 10px;
        font-size: 0.9em;
    }
}

/* ===== CTA BOX ===== */
.cta-box {
    text-align: center;
    background: linear-gradient(135deg, rgba(0,212,255,0.1), rgba(156,39,176,0.1));
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cta-box h3 {
    color: #fff;
    margin-bottom: 0.75rem;
    font-size: 1.3rem;
}

.cta-box p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 1.5rem;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cta-btn.telegram {
    background: #0088cc;
    color: white;
}

.cta-btn.discord {
    background: #7289da;
    color: white;
}

.cta-btn.xcom {
    background: #000000;
    color: white;
}

.cta-btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

@media (max-width: 768px) {
    .cta-box {
        padding: 1.5rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .cta-btn {
        justify-content: center;
        width: 100%;
    }
}

/* ===== MOBILE TABLE OF CONTENTS - FLOATING HEADER ===== */
@media (max-width: 768px) {
    /* Container chứa TOC */
    .mobile-toc-container {
        position: relative;
        margin: 0 0 20px 0;
        background: rgba(10, 15, 25, 0.95);
        backdrop-filter: blur(15px);
        border-radius: 16px;
        border: 1px solid rgba(0, 212, 255, 0.25);
        overflow: hidden;
        transition: all 0.3s ease;
        z-index: 100;
    }
    
    /* Khi TOC ở trạng thái floating */
    .mobile-toc-container.floating {
        position: fixed;
        top: 70px;
        left: 16px;
        right: 16px;
        margin: 0;
        width: calc(100% - 32px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
        border-color: var(--wave-trough);
        animation: slideDown 0.3s ease;
    }
    
    @keyframes slideDown {
        from {
            transform: translateY(-20px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
    
    /* Header TOC - luôn hiển thị */
    .mobile-toc-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 0, 0, 0.3));
        cursor: pointer;
        user-select: none;
    }
    
    .mobile-toc-header h4 {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 0;
        font-size: 0.9rem;
        font-weight: 600;
        color: white;
    }
    
    .mobile-toc-header h4 i {
        color: var(--wave-trough);
        font-size: 0.9rem;
    }
    
    .mobile-toc-header .toc-toggle-icon {
        transition: transform 0.3s ease;
        color: rgba(255, 255, 255, 0.6);
    }
    
    .mobile-toc-header .toc-toggle-icon.rotated {
        transform: rotate(180deg);
    }
    
    /* Nội dung TOC - có thể thu gọn */
    .mobile-toc-content {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        background: rgba(0, 0, 0, 0.3);
    }
    
    .mobile-toc-content.expanded {
        max-height: 400px;
        overflow-y: auto;
        border-top: 1px solid rgba(0, 212, 255, 0.15);
    }
    
    /* Danh sách heading */
    .mobile-toc-list {
        padding: 12px 16px;
        list-style: none;
        margin: 0;
    }
    
    .mobile-toc-item {
        margin-bottom: 8px;
    }
    
    .mobile-toc-link {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 12px;
        color: rgba(255, 255, 255, 0.8);
        text-decoration: none;
        border-radius: 10px;
        font-size: 0.85rem;
        line-height: 1.4;
        transition: all 0.2s ease;
        border-left: 2px solid transparent;
    }
    
    .mobile-toc-link i {
        color: var(--wave-trough);
        font-size: 0.5rem;
        flex-shrink: 0;
        opacity: 0.6;
    }
    
    .mobile-toc-link:active {
        background: rgba(0, 212, 255, 0.15);
        transform: translateX(5px);
    }
    
    .mobile-toc-link.active {
        background: rgba(0, 212, 255, 0.15);
        color: white;
        border-left-color: var(--wave-trough);
    }
    
    .mobile-toc-link.active i {
        opacity: 1;
        color: white;
    }
    
    /* H3 có thụt lề */
    .mobile-toc-item-h3 .mobile-toc-link {
        padding-left: 28px;
        font-size: 0.8rem;
    }
    
    /* Progress bar khi scroll */
    .mobile-toc-progress-bar {
        position: absolute;
        bottom: 0;
        left: 0;
        height: 2px;
        background: linear-gradient(90deg, var(--wave-trough), var(--wave-peak));
        width: 0%;
        transition: width 0.1s linear;
    }
    
    /* Placeholder để tránh nhảy content khi TOC floating */
    .mobile-toc-placeholder {
        display: none;
    }
    
    .mobile-toc-placeholder.active {
        display: block;
        height: 70px;
    }
}