/* ============================================================
   SAISHI.CSS v3.0 - 赛事/文章/APP 页面专属样式
   ============================================================
   匹配 Section 模板:
   - ArticleSection (单文章详情)
   - AppHeroSection / AppQrSection / AppInstallSection / AppShowcaseSection
   - ContactChannelsSection / ContactFormSection / ContactQuickSection / ContactCommitmentsSection
   - LoginFormSection / SignupFormSection
   - SearchBoxSection (extends)
   - 滚动条 / 打印样式 / 图标
   ============================================================ */

/* ============================================
   1. Single Post (ArticleSection)
   ============================================ */
.single-post {
    overflow: hidden;
}

.single-post .post-meta {
    font-size: 0.9rem;
}

.single-post .post-meta i {
    color: #7c3aed;
}

/* Post content typography */
.post-content {
    line-height: 1.8;
    font-size: 1.05rem;
    color: #1e1b2e;
}

.post-content :is(h2, h3, h4) {
    margin-block: 2rem 1rem;
    font-weight: 700;
    color: #4c1d95;
    line-height: 1.4;
}

.post-content h2 {
    font-size: 1.75rem;
    padding-bottom: var(--space-xs);
    border-bottom: 2px solid #ddd6fe;
}

.post-content h3 {
    font-size: 1.35rem;
}

.post-content :is(p, li) {
    margin-bottom: var(--space-sm);
}

.post-content blockquote {
    border-inline-start: 4px solid #7c3aed;
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(135deg, #faf5ff 0%, #fdf2f8 100%);
    border-radius: 0 22px 22px 0;
    margin-block: var(--space-md);
    color: #5b4a6f;
    font-style: italic;
    box-shadow: 4px 8px 20px -18px rgba(88, 28, 135, 0.45);
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 18px;
    margin-block: var(--space-sm);
    box-shadow: 0 2px 6px rgba(76, 29, 149, 0.06), 0 12px 28px -12px rgba(76, 29, 149, 0.22);
}

.post-content a {
    color: #7c3aed;
    text-decoration: underline;
    text-decoration-color: rgba(124, 58, 237, 0.35);
    text-underline-offset: 3px;
    transition: color 0.25s ease, text-decoration-color 0.25s ease;
}

.post-content a:hover {
    color: #6d28d9;
    text-decoration-color: #6d28d9;
}

.post-content ul,
.post-content ol {
    padding-inline-start: 1.5rem;
}

.post-content code {
    background: linear-gradient(135deg, #ffe4ed, #fae8ff);
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.9em;
    color: #e11d48;
}

.post-content pre {
    background: linear-gradient(135deg, #1e1b4b 0%, #3b0764 55%, #701a75 100%);
    color: #fdf4ff;
    padding: var(--space-md);
    border-radius: 24px;
    overflow-x: auto;
    margin-block: var(--space-md);
    box-shadow: 0 22px 50px -24px rgba(59, 7, 100, 0.65);
}

.post-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin-block: var(--space-md);
}

.post-content table th,
.post-content table td {
    padding: var(--space-xs) var(--space-sm);
    border: 1px solid #d9cfee;
    text-align: start;
}

.post-content table th {
    background: linear-gradient(145deg, #f5f3ff, #fce7f3);
    font-weight: 600;
}

/* TOC */
.toc-box {
    border-inline-start: 3px solid #7c3aed;
    background: linear-gradient(90deg, rgba(167, 139, 250, 0.14), transparent);
    border-radius: 0 16px 16px 0;
}

.toc-box ol {
    padding-inline-start: 1.2rem;
}

.toc-box ol li {
    margin: 0.4rem 0;
}

.toc-box ol li a {
    transition: all 0.2s ease;
}

.toc-box ol li a:hover {
    color: #6d28d9;
    text-decoration: underline !important;
    padding-inline-start: 4px;
}

/* Tags */
.post-tags .badge {
    background: linear-gradient(135deg, #ede9fe, #fce7f3) !important;
    color: #4c1d95 !important;
    padding: 6px 12px;
    font-weight: 500;
    border-radius: 999px;
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.post-tags .badge:hover {
    background: linear-gradient(135deg, #7c3aed, #db2777) !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -12px rgba(124, 58, 237, 0.6);
}

/* Post nav */
.post-nav {
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.post-nav .btn {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   2. App Hero (AppHeroSection)
   ============================================ */
.app-hero-section {
    background: linear-gradient(120deg, #150e2b 0%, #35166f 30%, #86198f 68%, #a63a7b 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.app-hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255, 209, 102, 0.22), transparent 35%), linear-gradient(115deg, rgba(2, 0, 36, 0.5), rgba(88, 28, 135, 0.25));
    z-index: 0;
}

.app-hero-section > .container {
    position: relative;
    z-index: 1;
}

.app-hero-section h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.2;
    text-shadow: 0 4px 22px rgba(2, 0, 36, 0.35);
}

.app-hero-section img {
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), filter 0.6s ease;
    filter: drop-shadow(0 24px 30px rgba(21, 14, 43, 0.45));
}

.app-hero-section img:hover {
    transform: translateY(-12px) rotate(1.5deg);
    filter: drop-shadow(0 32px 42px rgba(124, 58, 237, 0.45));
}

.text-white-50 {
    color: rgba(255, 236, 255, 0.75) !important;
}

/* ============================================
   3. App QR (AppQrSection)
   ============================================ */
.app-qr-section {
    background: linear-gradient(145deg, #faf5ff 0%, #fdf2f8 45%, #ede9fe 100%);
}

.qr-card {
    background: linear-gradient(145deg, #ffffff, #f8f4ff);
    border: 2px solid transparent;
    border-radius: 28px;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.45s ease, border-color 0.35s ease;
}

.qr-card:hover {
    transform: scale(1.04) translateY(-2px);
    border-color: #f59e0b;
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.12), 0 18px 42px -12px rgba(124, 58, 237, 0.3), 0 6px 16px -8px rgba(245, 158, 11, 0.24);
}

.qr-card img {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* ============================================
   4. App Install Steps (AppInstallSection)
   ============================================ */
.app-install-section {
    background: radial-gradient(circle at 92% 12%, rgba(245, 158, 11, 0.18), transparent 36%), linear-gradient(145deg, #fff7ed 0%, #ffedd5 50%, #fce7f3 100%);
}

.app-install-section .badge.rounded-circle {
    width: 50px;
    height: 50px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    color: #fff;
    border-radius: 999px;
    box-shadow: 0 10px 22px -10px rgba(124, 58, 237, 0.6);
}

.app-install-section .bg-white {
    background: radial-gradient(circle at 10% 0%, rgba(167, 139, 250, 0.14), transparent 40%), #fff !important;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s ease, background 0.35s ease;
    position: relative;
    overflow: hidden;
}

.app-install-section .bg-white:hover {
    transform: translateY(-6px);
    box-shadow: 0 2px 6px rgba(21, 14, 43, 0.05), 0 28px 55px -24px rgba(124, 58, 237, 0.4);
}

.app-install-section .bg-white::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #f59e0b 0%, #ec4899 100%);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.app-install-section .bg-white:hover::before {
    transform: scaleY(1);
}

/* ============================================
   5. App Showcase (AppShowcaseSection)
   ============================================ */
.app-showcase-section {
    background: radial-gradient(circle at 8% 20%, rgba(20, 184, 166, 0.12), transparent 30%), linear-gradient(145deg, #f0fdfa 0%, #ecfeff 100%);
}

.app-showcase-section img {
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), filter 0.6s ease;
    filter: drop-shadow(0 20px 30px rgba(13, 148, 136, 0.25));
}

.app-showcase-section img:hover {
    transform: translateY(-8px) rotate(1deg);
    filter: drop-shadow(0 26px 38px rgba(13, 148, 136, 0.34));
}

.app-showcase-section .bg-white {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(236, 253, 245, 0.78)) !important;
    transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    border-inline-start: 3px solid transparent;
}

.app-showcase-section .bg-white:hover {
    border-inline-start-color: #14b8a6;
    transform: translateX(5px);
    box-shadow: 0 4px 10px -4px rgba(15, 23, 42, 0.05), 0 22px 44px -20px rgba(20, 184, 166, 0.4);
}

/* ============================================
   6. Contact Sections
   ============================================ */
.contact-channels-section {
    background: linear-gradient(145deg, #f7fee7 0%, #ecfccb 55%, #fef9c3 100%);
}

.contact-channels-section article {
    background: linear-gradient(145deg, #ffffff, #faf7ff);
    border: 1px solid #e5e0d3;
    border-radius: 22px;
    box-shadow: 0 4px 12px -10px rgba(76, 29, 149, 0.14);
    transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.contact-channels-section article:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 20px -14px rgba(15, 23, 42, 0.2), 0 32px 60px -28px rgba(124, 58, 237, 0.4);
    border-color: #7c3aed;
}

.contact-channels-section article ul li {
    transition: padding 0.25s ease;
}

.contact-channels-section article ul li:hover {
    padding-inline-start: 4px;
}

/* Contact Quick */
.contact-quick-section {
    background: linear-gradient(145deg, #fff7ed 0%, #ffedd5 45%, #fef3c7 100%);
}

.contact-quick-section .contact-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.28));
    backdrop-filter: blur(10px);
    border-radius: 26px;
    transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.contact-quick-section .contact-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 4px 10px -6px rgba(0, 0, 0, 0.06), 0 34px 65px -30px rgba(234, 88, 12, 0.35);
}

.contact-quick-section .contact-card i {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.contact-quick-section .contact-card:hover i {
    transform: scale(1.18) rotate(-8deg);
}

/* Contact Form */
.contact-form-section {
    background: linear-gradient(145deg, #faf8ff 0%, #eef2ff 55%, #e0e7ff 100%);
}

.contact-form-section .form-control,
.contact-form-section .form-select {
    border: 2px solid #d9c9ff;
    border-radius: 14px;
    background-color: rgba(255, 255, 255, 0.85);
    transition: all 0.3s ease;
}

.contact-form-section .form-control:focus,
.contact-form-section .form-select:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 0.28rem rgba(124, 58, 237, 0.12), 0 8px 20px -12px rgba(76, 29, 149, 0.25);
}

.contact-form-section button[type="submit"] {
    transition: all 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.contact-form-section button[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px -4px rgba(0, 0, 0, 0.08), 0 22px 40px -18px rgba(124, 58, 237, 0.45);
}

/* Contact Commitments */
.contact-commitments-section {
    background: linear-gradient(145deg, #fff1f2 0%, #fce7f3 55%, #fae8ff 100%);
}

.contact-commitments-section .bg-white {
    background: linear-gradient(145deg, #ffffff, #fff1f2) !important;
    transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    text-align: center;
}

.contact-commitments-section .bg-white:hover {
    transform: translateY(-6px);
    box-shadow: 0 4px 10px -6px rgba(0, 0, 0, 0.05), 0 30px 60px -26px rgba(225, 29, 72, 0.35);
}

.contact-commitments-section .bg-white i {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.contact-commitments-section .bg-white:hover i {
    transform: scale(1.18);
}

/* ============================================
   7. Login / Signup Forms
   ============================================ */
main:has(> .container > .bg-white > form) .input-group-text {
    background-color: #f5f3ff;
    border-color: #d9c9ff;
    border-inline-end: none;
}

main:has(> .container > .bg-white > form) .input-group .form-control {
    border-inline-start: none;
}

main:has(> .container > .bg-white > form) .input-group:focus-within .input-group-text {
    border-color: #7c3aed;
    background-color: #f3e8ff;
}

main:has(> .container > .bg-white > form) .input-group:focus-within .form-control {
    border-color: #7c3aed;
}

main:has(> .container > .bg-white > form) .form-check-input:checked {
    background-color: #7c3aed;
    border-color: #7c3aed;
}

main:has(> .container > .bg-white > form) button[type="submit"] {
    transition: all 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    font-weight: 600;
}

main:has(> .container > .bg-white > form) button[type="submit"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px -4px rgba(0, 0, 0, 0.08), 0 20px 40px -16px rgba(124, 58, 237, 0.4);
}

/* ============================================
   8. Icons
   ============================================ */
.icon-img {
    max-width: 32px;
    max-height: 32px;
    object-fit: contain;
}

.icon-emoji {
    display: inline-block;
    line-height: 1;
}

/* ============================================
   9. Hero Buttons (đã có ở theme.css nhưng bổ sung thêm)
   ============================================ */
.hero-buttons .btn {
    transition: all 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-buttons .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px -6px rgba(2, 0, 36, 0.2), 0 24px 45px -20px rgba(124, 58, 237, 0.45);
}

.hero-buttons .btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    border-color: #f97316;
    color: #4c1d95;
    font-weight: 600;
    box-shadow: 0 8px 18px -12px rgba(245, 158, 11, 0.7);
}

.hero-buttons .btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #ea580c 100%);
    border-color: #ea580c;
}

.hero-buttons .btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.18);
    color: #fff;
}

/* ============================================
   10. 自定义滚动条
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1ecf8;
}

::-webkit-scrollbar-thumb {
    background: #c4b5fd;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a78bfa;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #a78bfa #f1ecf8;
}

/* ============================================
   11. Print Styles
   ============================================ */
@media print {
    :is(.header,
        .footer,
        .sidebar-widgets,
        .social-share,
        #back-to-top,
        .breadcrumb-nav,
        .notice-bar,
        .cta-banner-section,
        .post-nav,
        .related-posts,
        .author-box,
        .pagination,
        .navbar-toggler,
        .nav-item) {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 12pt;
    }

    .single-post {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        max-width: 100% !important;
    }

    .post-content {
        font-size: 11pt;
        line-height: 1.6;
    }

    a {
        text-decoration: underline;
        color: #000 !important;
    }

    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #555;
    }

    a[href^="#"]::after,
    a[href^="javascript:"]::after,
    a[href^="mailto:"]::after,
    a[href^="tel:"]::after {
        content: "";
    }

    .post-content img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    :is(h1, h2, h3, h4) {
        page-break-after: avoid;
        color: #000 !important;
    }

    p, li {
        orphans: 3;
        widows: 3;
    }
}

/* ============================================
   12. Animations bổ sung
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.06);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.animate-pulse {
    animation: pulse 2.2s ease-in-out infinite;
}

/* ============================================
   13. Responsive
   ============================================ */
@media (max-width: 991.98px) {
    .post-content {
        font-size: 1rem;
    }

    .post-content h2 {
        font-size: 1.5rem;
    }

    .post-content h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 767.98px) {
    .single-post {
        padding: var(--space-md) !important;
    }

    .post-content {
        font-size: 0.95rem;
    }

    .post-content h2 {
        font-size: 1.35rem;
    }

    .post-nav {
        flex-direction: column;
    }

    .post-nav .btn {
        width: 100%;
    }

    .post-tags .badge {
        font-size: 0.8rem;
        padding: 4px 8px;
    }

    .app-hero-section h1 {
        font-size: 1.75rem;
    }

    .app-install-section .badge.rounded-circle {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .toc-box {
        padding: var(--space-sm) !important;
    }

    .qr-card img {
        max-width: 140px !important;
    }
}

@media (max-width: 575.98px) {
    .app-hero-section .row .col-lg-7 {
        text-align: center;
        color: #380e5c;
        background:
            radial-gradient(circle at 12% 8%, rgba(255, 209, 92, 0.55), transparent 42%),
            radial-gradient(circle at 88% 12%, rgba(255, 93, 162, 0.35), transparent 46%),
            radial-gradient(circle at 50% 95%, rgba(137, 82, 255, 0.28), transparent 58%);
        border-radius: 2.5rem 0.75rem 2.5rem 0.75rem;
        box-shadow:
            inset 0 0 0 2px rgba(56, 14, 92, 0.12),
            8px 10px 0 -5px rgba(255, 144, 32, 0.5),
            18px 22px 0 -12px rgba(255, 93, 162, 0.42),
            0 1.6rem 2.6rem -1.2rem rgba(56, 14, 92, 0.45);
        transition:
            color 0.6s cubic-bezier(0.22, 1, 0.36, 1),
            box-shadow 0.6s cubic-bezier(0.22, 1, 0.36, 1),
            border-radius 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .app-hero-section .badge.bg-warning {
        font-size: 0.85rem;
        color: #380e5c;
        background: linear-gradient(
            115deg,
            #ffd166 0%,
            #ff9f5a 28%,
            #ff5da2 64%,
            #c44dff 100%
        );
        box-shadow:
            inset 0 0 0 2px rgba(56, 14, 92, 0.85),
            0.35rem 0.45rem 0 0 rgba(56, 14, 92, 0.8),
            0 0.9rem 1.8rem -0.5rem rgba(196, 77, 255, 0.7);
        border-radius: 0.85rem 0.2rem 0.85rem 0.2rem;
        transition:
            color 0.6s cubic-bezier(0.22, 1, 0.36, 1),
            box-shadow 0.6s cubic-bezier(0.22, 1, 0.36, 1),
            border-radius 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .contact-channels-section article,
    .contact-quick-section .contact-card {
        padding: var(--space-md) !important;
        color: #380e5c;
        background:
            linear-gradient(
                145deg,
                rgba(255, 244, 214, 0.96) 0%,
                rgba(255, 222, 233, 0.92) 48%,
                rgba(228, 210, 255, 0.94) 100%
            );
        box-shadow:
            inset 0 0 0 2px rgba(56, 14, 92, 0.16),
            inset 0 0 0 6px rgba(255, 196, 73, 0.3),
            0.6rem 0.7rem 0 -0.3rem rgba(56, 14, 92, 0.35),
            14px 18px 0 -8px rgba(196, 77, 255, 0.28),
            0 1.4rem 2.2rem -1rem rgba(56, 14, 92, 0.4);
        border-radius: 1.6rem 0.375rem 1.6rem 0.375rem;
        transition:
            color 0.6s cubic-bezier(0.22, 1, 0.36, 1),
            box-shadow 0.6s cubic-bezier(0.22, 1, 0.36, 1),
            border-radius 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    }
}