﻿/* Community Official Tablet Styles (768px - 1199px) */

/* =========================================
   1. Hero & Headers (Ported from Desktop) 
   ========================================= */
.official-hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 100px 0 60px;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 40px;
}

.official-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../../images/pattern.png');
    opacity: 0.05;
}

.official-hero h1 {
    font-family: 'Noto Serif SC', serif;
    font-size: 2.8rem;
    /* Slightly smaller than desktop */
    margin-bottom: 20px;
    color: #ffffff;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.official-hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-family: 'Noto Sans SC', sans-serif;
    color: #cbd5e1;
    position: relative;
    z-index: 1;
    max-width: 80%;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.section-header h2 {
    font-family: 'Noto Serif SC', serif;
    font-size: 2rem;
    color: #0f172a;
    font-weight: 700;
}

.header-decoration {
    width: 60px;
    height: 4px;
    background: #cba174;
    margin: 15px auto 0;
    border-radius: 2px;
}

/* =========================================
   2. Layout Structure (Responsive)
   ========================================= */
.official-layout-wrapper {
    display: flex;
    flex-direction: column;
}

/* Sidebar Header (Mobile Only) */
.sidebar-header-mobile {
    display: none;
}

/* ≥ 1024px: Sticky Sidebar & Grid Layout */
@media (min-width: 1024px) {
    .official-layout-wrapper {
        display: grid;
        grid-template-columns: 240px 1fr !important;
        gap: 30px;
        align-items: start;
    }

    .official-sidebar {
        position: sticky;
        top: 100px;
        background: white;
        padding: 20px;
        border-radius: 12px;
        border: 1px solid #e2e8f0;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
        display: block !important;
    }

    .filter-trigger {
        display: none !important;
    }
}

/* < 1024px: Drawer Sidebar */
@media (max-width: 1023.9px) {
    .official-layout-wrapper {
        display: block;
    }

    /* Floating Filter Trigger */
    .filter-trigger {
        display: flex;
        position: fixed;
        bottom: 40px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        color: #1e293b;
        padding: 14px 28px;
        border-radius: 50px;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.05);
        z-index: 2000;
        font-weight: 600;
        font-size: 1rem;
        align-items: center;
        gap: 10px;
        border: 1px solid rgba(255, 255, 255, 0.5);
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .filter-trigger:hover {
        transform: translateX(-50%) translateY(-4px) scale(1.02);
        box-shadow: 0 12px 40px rgba(203, 161, 116, 0.25);
        color: #0f172a;
    }

    .filter-trigger.hide-trigger {
        opacity: 0;
        pointer-events: none;
        transform: translateX(-50%) translateY(20px);
    }

    /* Drawer Sidebar */
    .official-sidebar {
        display: block;
        position: fixed;
        top: 140px !important;
        /* Fixed header offset */
        left: 0;
        bottom: 0;
        width: 250px !important;
        height: calc(100vh - 140px) !important;
        background: linear-gradient(160deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        z-index: 10000;
        padding: 25px !important;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
        box-shadow: 20px 0 50px rgba(15, 23, 42, 0.15);
        border-right: 1px solid rgba(255, 255, 255, 0.4);
    }

    .official-sidebar.active {
        transform: translateX(0);
    }

    .sidebar-header-mobile {
        display: flex !important;
    }

    .sidebar-header-mobile h3 {
        margin: 0;
        font-size: 1.2rem;
        color: #0f172a;
        font-weight: 700;
        font-family: 'Noto Serif SC', serif;
    }

    .close-filter {
        background: #f1f5f9;
        border: none;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        color: #64748b;
        font-size: 1.2rem;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.2s;
    }

    .close-filter:hover {
        background: #e2e8f0;
        color: #0f172a;
    }
}

.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.filter-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* =========================================
   3. Component Styles (Sidebar & Cards)
   ========================================= */

/* Groups & Buttons */
.filter-group {
    margin-bottom: 30px;
}

.filter-group h4 {
    font-size: 1.1rem;
    color: #0f172a;
    font-weight: 700;
    margin-bottom: 15px;
    font-family: 'Noto Serif SC', serif;
    padding-left: 12px;
    border-left: 4px solid #cba174;
}

.filter-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-btn {
    text-align: left;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #64748b;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: flex-start !important;
    /* Force left align */
    text-align: left !important;
    width: 100%;
}

.filter-btn:hover {
    background: #f1f5f9;
    color: #cba174;
    transform: none !important;
    /* Prevent shift */
}

.filter-btn.active {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%) !important;
    color: #1e3a8a;
    font-weight: 700;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.04);
}

.filter-btn.active .plat-dot {
    transform: scale(1.2);
}

/* Fix for persistent background colors & sticky hover */
.filter-btn:not(.active) {
    background: transparent !important;
    box-shadow: none !important;
    color: #64748b !important;
    transform: none !important;
}

.plat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 12px;
    background: #cbd5e1;
}

/* Main Content */
.official-main {
    min-height: 80vh !important;
    /* Push footer down */
}

/* Mixed Card (Ported & Adapted) */
.mixed-grid {
    grid-template-columns: repeat(2, 1fr);
    min-height: auto;
    gap: 20px;
}

.mixed-card {
    text-decoration: none;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
    height: 100%;
    display: none;
    /* Hidden by default until JS */
    flex-direction: column;
}

.mixed-card:hover {
    transform: translateY(-5px);
}

.mixed-cover {
    height: 180px;
    background-size: cover;
    background-position: center;
    background-color: #f1f5f9;
    position: relative;
}

.plat-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
}

.plat-tag.wechat {
    background: #07c160;
}

.plat-tag.channels {
    background: #fa9d3b;
}

.plat-tag.douyin {
    background: #fe2c55;
}

/* Add others if needed */

.mixed-body {
    padding: 15px;
    flex: 1;
}

.mixed-body h4 {
    font-size: 1rem;
    color: #334155;
    line-height: 1.5;
    font-weight: 600;
    margin: 0;
}

/* =========================================
   4. Pagination & Footer Elements
   ========================================= */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    margin-bottom: 30px;
}

.page-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    background: white;
    color: #1e293b;
    font-weight: 500;
}

.page-btn.active {
    background: #cba174;
    color: white;
    border-color: #cba174;
}

/* Modal Styling (Tablet) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    z-index: 100001;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.qr-modal {
    background: white;
    width: 90%;
    max-width: 400px;
    padding: 30px;
    border-radius: 16px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.qr-modal h3 {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.btn-close-modal {
    margin-top: 20px;
    padding: 10px 30px;
    border-radius: 20px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
}

/* Platform List (Bottom) */
.platform-list-wrapper {
    margin-top: 20px;
    text-align: center;
    border-top: 1px solid #f0f0f0;
    padding-top: 60px;
    padding-bottom: 60px;
}

.platform-list-title {
    font-size: 1.2rem;
    color: #94a3b8;
    margin-bottom: 30px;
    font-weight: 500;
}

.platform-list {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.platform-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    gap: 10px;
    transition: transform 0.3s;
}

.platform-item:hover {
    transform: translateY(-5px);
}

.plat-logo {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.platform-item span {
    font-size: 0.9rem;
    color: #475569;
    font-weight: 600;
}