/* ============================================================
   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: var(--color-accent);
}

/* Post content typography */
.post-content {
    line-height: 1.8;
    font-size: 1.05rem;
    color: var(--color-text);
}

.post-content :is(h2, h3, h4) {
    margin-block: 2rem 1rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.4;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

.post-content h2 {
    font-size: 1.75rem;
    padding-bottom: var(--space-xs);
    border-bottom: 2px dashed color-mix(in srgb, var(--color-primary) 42%, white);
}

.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 var(--color-accent);
    padding: var(--space-sm) var(--space-md);
    background: linear-gradient(135deg, color-mix(in srgb, var(--color-accent) 10%, white) 0%, var(--color-bg-soft) 100%);
    border-radius: 0 6px 6px 0;
    margin-block: var(--space-md);
    color: var(--color-text-muted);
    font-style: italic;
    box-shadow: 0 8px 22px rgba(20, 28, 48, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin-block: var(--space-sm);
    box-shadow: 0 10px 26px rgba(34, 40, 70, 0.12), 0 2px 8px rgba(34, 40, 70, 0.08);
    filter: saturate(1.02) contrast(1.01);
}

.post-content a {
    color: var(--color-accent);
    text-decoration: underline;
    transition: color 0.24s cubic-bezier(0.2, 0.8, 0.2, 1), text-shadow 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.post-content a:hover {
    color: var(--color-primary);
    text-shadow: 0 0 10px color-mix(in srgb, var(--color-accent) 28%, transparent);
}

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

.post-content code {
    background: linear-gradient(135deg, color-mix(in srgb, var(--color-bg-muted) 78%, white) 0%, color-mix(in srgb, var(--color-accent) 10%, white) 100%);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #c2410c;
}

.post-content pre {
    background: linear-gradient(160deg, #1b2238 0%, #29365a 55%, #1d2744 100%);
    color: #f8fafc;
    padding: var(--space-md);
    border-radius: 6px;
    overflow-x: auto;
    margin-block: var(--space-md);
    box-shadow: 0 14px 30px rgba(16, 24, 40, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.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 color-mix(in srgb, var(--color-primary) 18%, var(--color-border));
    text-align: start;
}

.post-content table th {
    background: linear-gradient(135deg, var(--color-bg-muted) 0%, color-mix(in srgb, var(--color-accent) 8%, white) 100%);
    font-weight: 600;
}

/* TOC */
.toc-box {
    border-inline-start: 3px solid var(--color-accent);
    border-radius: 4px;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-accent) 10%, transparent);
}

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

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

.toc-box ol li a {
    transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.toc-box ol li a:hover {
    color: var(--color-primary);
    text-decoration: underline !important;
    padding-inline-start: 4px;
}

/* Tags */
.post-tags .badge {
    background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%) !important;
    color: #4c1d95 !important;
    padding: 6px 12px;
    font-weight: 500;
    transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(91, 33, 182, 0.08);
}

.post-tags .badge:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(124, 58, 237, 0.22);
}

/* 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: radial-gradient(circle at top left, #fb7185 0%, #f97316 26%, #8b5cf6 68%, #334155 100%);
    color: #fff7ed;
    position: relative;
    overflow: hidden;
}

.app-hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.22) 0%, rgba(15, 23, 42, 0.34) 100%);
    z-index: 0;
    backdrop-filter: blur(2px);
}

.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 8px 22px rgba(15, 23, 42, 0.28);
}

.app-hero-section img {
    transition: transform 0.48s cubic-bezier(0.22, 1, 0.36, 1), filter 0.48s cubic-bezier(0.22, 1, 0.36, 1);
    filter: drop-shadow(0 18px 28px rgba(15, 23, 42, 0.22)) drop-shadow(0 6px 12px rgba(251, 113, 133, 0.16));
}

.app-hero-section img:hover {
    transform: translateY(-10px);
}

.text-white-50 {
    color: rgba(255, 247, 237, 0.74) !important;
}

/* ============================================
   3. App QR (AppQrSection)
   ============================================ */
.app-qr-section {
    background: linear-gradient(180deg, #fafafc 0%, #f7f7fb 100%);
}

.qr-card {
    transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    border: 2px solid transparent;
    border-radius: 5px;
    box-shadow: 0 8px 18px rgba(30, 41, 59, 0.06);
    background: linear-gradient(135deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.98) 100%);
}

.qr-card:hover {
    transform: scale(1.03);
    border-color: #f97316;
    box-shadow: 0 12px 24px rgba(249, 115, 22, 0.12), 0 6px 10px rgba(30, 41, 59, 0.08);
}

.qr-card img {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    filter: contrast(1.04) saturate(1.02);
}

/* ============================================
   4. App Install Steps (AppInstallSection)
   ============================================ */
.app-install-section {
    background: linear-gradient(180deg, #fff7ed 0%, #fffaf5 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, #fb7185 0%, #f97316 100%);
    color: #fff;
    box-shadow: 0 8px 16px rgba(249, 115, 22, 0.2);
}

.app-install-section .bg-white {
    transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
    border-radius: 5px;
    box-shadow: 0 8px 18px rgba(30, 41, 59, 0.06);
    background: linear-gradient(180deg, #ffffff 0%, #fffaf7 100%);
}

.app-install-section .bg-white:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 28px rgba(249, 115, 22, 0.12), 0 10px 18px rgba(30, 41, 59, 0.08);
}

.app-install-section .bg-white::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #fb7185 0%, #f59e0b 52%, #8b5cf6 100%);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.28s 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: linear-gradient(180deg, #fcfcfd 0%, #f8fafc 100%);
}

.app-showcase-section img {
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), filter 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    filter: drop-shadow(0 12px 24px rgba(30, 41, 59, 0.12)) drop-shadow(0 4px 8px rgba(139, 92, 246, 0.1));
}

.app-showcase-section img:hover {
    transform: translateY(-5px) rotate(-1deg);
}

.app-showcase-section .bg-white {
    transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    border-inline-start: 3px solid transparent;
    border-radius: 4px;
    box-shadow: 0 6px 14px rgba(30, 41, 59, 0.05);
    background: linear-gradient(135deg, #ffffff 0%, #fdf4ff 100%);
}

.app-showcase-section .bg-white:hover {
    border-inline-start-color: #8b5cf6;
    transform: translateX(5px);
    box-shadow: 0 12px 22px rgba(139, 92, 246, 0.12), 0 6px 10px rgba(30, 41, 59, 0.08);
}

/* ============================================
   6. Contact Sections
   ============================================ */
.contact-channels-section {
    background: linear-gradient(180deg, #ffffff 0%, #faf7ff 100%);
}

.contact-channels-section article {
    transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    border: 1px solid #e9d5ff;
    border-radius: 5px;
    box-shadow: 0 8px 18px rgba(30, 41, 59, 0.05);
    background: linear-gradient(180deg, #ffffff 0%, #fdfbff 100%);
}

.contact-channels-section article:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 28px rgba(124, 58, 237, 0.12), 0 8px 14px rgba(30, 41, 59, 0.08);
    border-color: #8b5cf6;
}

.contact-channels-section article ul li {
    transition: padding 0.2s ease-out, color 0.2s ease-out;
}

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

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

.contact-quick-section .contact-card {
    transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    border-radius: 5px;
    box-shadow: 0 8px 18px rgba(30, 41, 59, 0.05);
    background: linear-gradient(180deg, #ffffff 0%, #fffaf5 100%);
}

.contact-quick-section .contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 26px rgba(249, 115, 22, 0.12), 0 8px 12px rgba(30, 41, 59, 0.08);
}

.contact-quick-section .contact-card i {
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), color 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    color: #f97316;
}

.contact-quick-section .contact-card:hover i {
    transform: scale(1.1) rotate(-5deg);
    color: #ea580c;
}

/* Contact Form */
.contact-form-section {
    background: linear-gradient(180deg, #fff7fb 0%, #faf5ff 100%);
}

.contact-form-section .form-control,
.contact-form-section .form-select {
    border: 2px solid #e9d5ff;
    transition: all 0.22s cubic-bezier(0.22, 1, 0.36, 1);
    border-radius: 5px;
    box-shadow: inset 0 1px 2px rgba(30, 41, 59, 0.03);
    caret-color: #ec4899;
    accent-color: #8b5cf6;
    outline-color: #c084fc;
}

.contact-form-section .form-control:focus,
.contact-form-section .form-select:focus {
    border-color: #ec4899;
    box-shadow: 0 0 0 0.2rem rgba(236, 72, 153, 0.12), 0 8px 18px rgba(236, 72, 153, 0.08);
    outline-color: #ec4899;
}

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

.contact-form-section button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 24px rgba(236, 72, 153, 0.18), 0 6px 12px rgba(30, 41, 59, 0.08);
}

/* Contact Commitments */
.contact-commitments-section {
    background: linear-gradient(180deg, #f8fafc 0%, #fef2f2 100%);
}

.contact-commitments-section .bg-white {
    transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    text-align: center;
    border-radius: 5px;
    box-shadow: 0 8px 18px rgba(30, 41, 59, 0.05);
    background: linear-gradient(180deg, #ffffff 0%, #fff7f7 100%);
}

.contact-commitments-section .bg-white:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 26px rgba(251, 113, 133, 0.12), 0 8px 12px rgba(30, 41, 59, 0.08);
}

.contact-commitments-section .bg-white i {
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), color 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    color: #fb7185;
}

.contact-commitments-section .bg-white:hover i {
    transform: scale(1.15);
    color: #e11d48;
}

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

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

main:has(> .container > .bg-white > form) .input-group:focus-within .input-group-text {
    border-color: #ec4899;
    background-color: #fdf2f8;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

main:has(> .container > .bg-white > form) .input-group:focus-within .form-control {
    border-color: #ec4899;
    box-shadow: 0 0 0 0.2rem rgba(236, 72, 153, 0.1);
}

main:has(> .container > .bg-white > form) .form-check-input:checked {
    background-color: #8b5cf6;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
    accent-color: #8b5cf6;
}

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

main:has(> .container > .bg-white > form) button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 24px rgba(124, 58, 237, 0.18), 0 6px 12px rgba(30, 41, 59, 0.08);
}

/* ============================================
   8. Icons
   ============================================ */
.icon-img {
    max-width: 32px;
    max-height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(30, 41, 59, 0.12));
}

.icon-emoji {
    display: inline-block;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(30, 41, 59, 0.12));
}

/* ============================================
   9. Hero Buttons (đã có ở theme.css nhưng bổ sung thêm)
   ============================================ */
.hero-buttons .btn {
    transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    border-radius: 5px;
    box-shadow: 0 8px 16px rgba(30, 41, 59, 0.08);
}

.hero-buttons .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 28px rgba(30, 41, 59, 0.14), 0 6px 12px rgba(139, 92, 246, 0.12);
}

.hero-buttons .btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #fb7185 100%);
    border-color: #f59e0b;
    color: #3b0764;
    font-weight: 600;
}

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

.hero-buttons .btn-outline-light:hover {
    background-color: rgba(255, 247, 237, 0.18);
    color: #fffaf5;
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

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

::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #f5f3ff 0%, #fff7ed 100%);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #a78bfa 0%, #fb7185 100%);
    border-radius: 4px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #8b5cf6 0%, #f97316 100%);
}

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

/* ============================================
   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(20px);
        filter: blur(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        filter: saturate(1);
    }
    50% {
        transform: scale(1.05);
        filter: saturate(1.08);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.7s 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: #1f2937;
        text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7), 0 8px 18px rgba(31, 41, 55, 0.08);
        filter: saturate(1.03);
        opacity: 0.99;
    }

    .app-hero-section .badge.bg-warning {
        font-size: 0.85rem;
        background: linear-gradient(135deg, #ff8a3d 0%, #ffb84d 55%, #ffd166 100%);
        color: #2b1600;
        border-color: #ff9f43;
        border-style: solid;
        box-shadow: 0 2px 6px rgba(255, 138, 61, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.35) inset;
        text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
        border-radius: 4px;
        outline-color: rgba(255, 159, 67, 0.3);
        caret-color: #2b1600;
        accent-color: #ff9f43;
        transition: background 0.22s ease-out, color 0.22s ease-out, box-shadow 0.22s ease-out, filter 0.22s ease-out;
        filter: saturate(1.08) contrast(1.02);
        opacity: 1;
    }

    .contact-channels-section article,
    .contact-quick-section .contact-card {
        padding: var(--space-md) !important;
        background: linear-gradient(145deg, #ffffff 0%, #f7f8fb 100%);
        color: #243042;
        border-color: rgba(90, 105, 140, 0.18);
        border-style: solid;
        box-shadow: 0 8px 18px rgba(24, 39, 75, 0.08), 0 1px 2px rgba(24, 39, 75, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.9) inset;
        text-shadow: none;
        border-radius: 5px;
        outline-color: rgba(79, 70, 229, 0.18);
        backdrop-filter: blur(6px) saturate(1.04);
        -webkit-backdrop-filter: blur(6px) saturate(1.04);
        transition: background 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease, filter 0.24s ease;
        filter: saturate(1.01);
        opacity: 1;
        caret-color: #4f46e5;
        accent-color: #14b8a6;
    }
}