/* ==========================================
   MOBILE-ONLY PREMIUM REDESIGN (PINK/WHITE)
   Matches "Alex" Welcome Hub Reference Image
   ========================================== */

:root {
    --mobile-font-scale: 1.0;
    --mobile-layout-scale: 100%;
    --mobile-layout-height: 100%;
}

@media (max-width: 1024px) {

    /* --- Base Layout --- */
    body {
        background-color: #fff5f7 !important;
        margin: 0;
        padding: 0;
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
        color: #333;
        font-size: calc(16px * var(--mobile-font-scale)) !important;
    }

    #blog-container {
        padding: 0 !important;
        margin: 0 auto !important;
        width: var(--mobile-layout-scale) !important;
        height: var(--mobile-layout-height) !important;
        max-width: 100%;
    }

    /* Hide PC-only elements and Chatbot */
    .modern-header,
    .sidebar h3,
    #subscriber-stats,
    .hero-nav,
    .bgm-player,
    #chatbot-container {
        display: none !important;
    }

    /* --- Mobile Header Bar --- */
    .mobile-hub-header {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        background: transparent;
        position: relative;
    }

    .hub-label {
        font-size: 1.1rem;
        font-weight: 500;
        color: #666;
    }

    .categories-title {
        font-size: 1.1rem;
        font-weight: 700;
        color: #000;
        margin: 0;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    .header-actions {
        display: flex;
        gap: 12px;
        align-items: center;
    }

    .mobile-notif-wrapper {
        position: relative;
        cursor: pointer;
    }

    .hub-icon {
        font-size: 1.4rem;
        color: #333;
        transition: transform 0.2s;
    }

    .hub-icon:active {
        transform: scale(0.9);
    }

    .notif-badge {
        position: absolute;
        top: -5px;
        right: -5px;
        background: #ff4d6d;
        color: white;
        font-size: 0.65rem;
        font-weight: 800;
        min-width: 16px;
        height: 16px;
        border-radius: 8px;
        display: none;
        /* Shown via JS */
        align-items: center;
        justify-content: center;
        border: 2px solid #fff5f7;
        padding: 0 4px;
    }

    .notif-badge.active {
        display: flex !important;
    }

    /* --- Mobile Search Container --- */
    .mobile-search-container {
        margin: 0 20px 16px;
        background: white;
        border-radius: 12px;
        padding: 8px 12px;
        display: flex;
        align-items: center;
        gap: 10px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        border: 1px solid rgba(255, 143, 163, 0.1);
    }

    .mobile-search-container input {
        border: none;
        outline: none;
        flex: 1;
        font-size: 0.95rem;
        color: #333;
        background: transparent;
    }

    .search-close-btn {
        background: transparent;
        border: none;
        color: #999;
        font-size: 1.2rem;
        cursor: pointer;
        padding: 0 4px;
    }

    /* --- Welcome Banner --- */
    .mobile-welcome-banner {
        display: block !important;
        margin: 0 20px 24px;
        padding: 24px 20px;
        background: #fde4e9;
        border-radius: 20px;
        box-shadow: 0 4px 10px rgba(255, 143, 163, 0.05);
    }

    .welcome-title {
        font-size: 1.4rem;
        font-weight: 700;
        color: #1a1a1a;
        margin-bottom: 8px;
        letter-spacing: -0.5px;
    }

    .welcome-subtitle {
        font-size: 1rem;
        color: #555;
        font-weight: 400;
    }

    /* --- Main Content Layout --- */
    .main-layout {
        display: block !important;
        padding: 0 20px 100px !important;
    }

    .sidebar {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
    }

    /* --- Category Card List --- */
    .mobile-category-section-title {
        display: block !important;
        font-size: 0.9rem;
        font-weight: 700;
        color: #999;
        margin-bottom: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    #category-list {
        background: white !important;
        border-radius: 24px !important;
        padding: 8px !important;
        margin: 0 !important;
        list-style: none !important;
        display: flex !important;
        flex-direction: column !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02) !important;
    }

    #category-list li {
        display: flex !important;
        align-items: center;
        padding: 16px 12px !important;
        border-bottom: 1px solid #f9f9f9;
        cursor: pointer;
        transition: background 0.2s;
    }

    #category-list li:last-child {
        border-bottom: none;
    }

    #category-list li:active {
        background: #fff0f3;
    }

    #category-list li::before {
        content: "";
        width: 12px;
        height: 12px;
        background: #ff8fa3;
        border-radius: 50%;
        margin-right: 16px;
    }

    #category-list li .cat-name {
        flex-grow: 1;
        font-size: 1.1rem;
        font-weight: 600;
        color: #222;
        margin: 0;
    }

    #category-list li::after {
        content: "\203A";
        font-size: 1.6rem;
        color: #ccc;
        font-weight: 300;
        margin-left: 10px;
    }

    /* --- Post Feed --- */
    .content-area {
        width: 100% !important;
        margin-top: 32px !important;
    }

    .mobile-recent-activity-title {
        display: block !important;
        font-size: 0.9rem;
        font-weight: 700;
        color: #999;
        margin-bottom: 16px;
        text-transform: uppercase;
    }

    .post-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
    }

    .post-card {
        background: white !important;
        border-radius: 20px !important;
        padding: 16px !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03) !important;
    }

    /* --- Bottom Navigation --- */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 85px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-top: 1px solid #eee;
        z-index: 1000;
        padding: 0 20px 20px;
        justify-content: space-around;
        align-items: center;
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.02);
    }

    .mobile-bottom-nav .nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: #bbb;
        gap: 4px;
        flex: 1;
    }

    .mobile-bottom-nav .nav-item.active {
        color: #ff5c7d;
    }

    .mobile-bottom-nav .nav-item svg {
        width: 26px;
        height: 26px;
    }

    .mobile-bottom-nav .nav-label {
        font-size: 0.75rem;
        font-weight: 600;
    }

    /* --- Mobile Settings Modal --- */
    .mobile-modal-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 2000;
        display: flex;
        align-items: flex-end;
    }

    .mobile-modal-content {
        background: white;
        width: 100%;
        border-radius: 24px 24px 0 0;
        padding: 30px 20px 50px;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
        animation: slideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }

    @keyframes slideUp {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }

    .mobile-modal-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 24px;
    }

    .mobile-modal-header h2 {
        font-size: 1.4rem;
        font-weight: 700;
        margin: 0;
    }

    .mobile-modal-header .close-btn {
        background: #f0f0f0;
        border: none;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        font-size: 1.2rem;
        cursor: pointer;
    }

    .settings-group {
        margin-bottom: 24px;
    }

    .settings-group label {
        display: block;
        font-size: 0.8rem;
        font-weight: 700;
        color: #999;
        margin-bottom: 12px;
        text-transform: uppercase;
    }

    .setting-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #f9f9f9;
        padding: 16px;
        border-radius: 16px;
    }

    .toggle-switch {
        background: #ff8fa3;
        color: white;
        border: none;
        padding: 6px 16px;
        border-radius: 20px;
        font-weight: 700;
        cursor: pointer;
    }

    .toggle-switch.off {
        background: #ddd;
    }

    .font-size-controls {
        display: flex;
        gap: 10px;
    }

    .font-size-controls button {
        flex: 1;
        padding: 12px;
        border: 1px solid #eee;
        border-radius: 12px;
        background: #fff;
        font-weight: 600;
        cursor: pointer;
    }

    .font-size-controls button.active {
        background: #ff8fa3;
        color: white;
        border-color: #ff8fa3;
    }

    .layout-controls {
        background: #f9f9f9;
        padding: 16px;
        border-radius: 16px;
    }

    .layout-controls span {
        display: block;
        margin-bottom: 10px;
        font-weight: 600;
    }

    .layout-controls input {
        width: 100%;
        accent-color: #ff8fa3;
    }

    .mobile-settings-body {
        max-height: 70vh;
        overflow-y: auto;
        padding-right: 10px;
        margin-right: -10px;
        scrollbar-width: thin;
        scrollbar-color: #ff8fa3 #f9f9f9;
    }

    /* Custom Scrollbar for Chrome/Safari/Edge */
    .mobile-settings-body::-webkit-scrollbar {
        width: 6px;
    }

    .mobile-settings-body::-webkit-scrollbar-track {
        background: #f9f9f9;
        border-radius: 10px;
    }

    .mobile-settings-body::-webkit-scrollbar-thumb {
        background: #ff8fa3;
        border-radius: 10px;
    }

    .setting-item-group {
        display: flex;
        justify-content: space-between;
        align-items: center;
        background: #f9f9f9;
        padding: 16px;
        border-radius: 16px;
        margin-bottom: 16px;
    }

    .setting-label {
        display: flex;
        flex-direction: column;
        gap: 4px;
        max-width: 65%;
    }

    .label-title {
        font-size: 1rem;
        font-weight: 700;
        color: #333;
    }

    .label-desc {
        font-size: 0.8rem;
        color: #999;
        line-height: 1.3;
    }

    .desc {
        font-size: 0.8rem;
        color: #999;
        margin-bottom: 16px;
        line-height: 1.4;
    }
}