/* =========================================
   IDMeta Mobile SPA V1
   Independent stylesheet for m.idmeta.com
   ========================================= */

:root {
    --bg-dark: #0a0c14;
    --bg-card: rgba(18, 22, 38, 0.7);
    --gold: #d4af37;
    --gold-glow: rgba(212, 175, 55, 0.3);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --border-glass: rgba(255, 255, 255, 0.08);
    --primary-blue: #3b82f6;

    --tab-bar-height: 60px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: 'Noto Serif SC', 'Inter', serif;
    font-weight: 600;
}

/* App Layout */
.app-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    background: radial-gradient(circle at 50% 0%, rgba(30, 40, 70, 0.4) 0%, transparent 60%);
}

.app-header {
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 12, 20, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
}

.header-logo {
    font-family: 'Noto Serif SC', serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}

.header-logo span {
    color: var(--gold);
    margin: 0 4px;
}

.app-main {
    flex: 1;
    overflow-y: auto;
    padding-bottom: calc(var(--tab-bar-height) + var(--safe-area-bottom));
}

.bottom-spacer {
    height: 80px;
}

/* View Modules (Tab Routing) */
.view-module {
    display: none;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.view-module.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ----- Home / Hero Section ----- */
.hero-section {
    text-align: center;
    padding: 30px 0 40px;
}

.hero-title {
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.hero-title span {
    color: var(--gold);
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 90%;
    margin: 0 auto 30px;
}

.btn-primary {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: var(--gold);
    border: 1px solid var(--gold);
    padding: 14px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--gold-glow);
    transition: all 0.2s ease;
}

.btn-primary:active {
    transform: scale(0.96);
}

.philosophy-tag {
    display: inline-block;
    margin-top: 24px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-glass);
    padding: 6px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
}

/* ----- Features Grid (Scrollable) ----- */
.section-title {
    font-size: 1.25rem;
    margin-bottom: 16px;
    color: #fff;
    padding-left: 4px;
}

.feature-scroll {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    padding-bottom: 20px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    /* Firefox */
}

.feature-scroll::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.feature-card {
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 20px;
    scroll-snap-align: start;
}

.f-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #fff;
}

.feature-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ----- Glass About Box ----- */
.about-section {
    margin-top: 20px;
}

.glass-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.glass-box h3 {
    color: var(--gold);
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.glass-box p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* =========================================
   Bottom Native Tab Bar
   ========================================= */
.app-tab-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    height: calc(var(--tab-bar-height) + var(--safe-area-bottom));
    background: rgba(10, 12, 20, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    /* Align to top so safe area pads bottom */
    padding-top: 8px;
    padding-bottom: var(--safe-area-bottom);
    z-index: 999;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
}

.tab-item.active {
    color: var(--gold);
}

.tab-icon {
    font-size: 1.4rem;
    margin-bottom: 4px;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tab-item.active .tab-icon {
    transform: scale(1.15);
}

.tab-label {
    font-size: 0.7rem;
    font-weight: 500;
}

/* =========================================
   Mobile Sidebar Drawer Menu
   ========================================= */
.mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    /* Hidden off-screen to the left by default */
    width: 280px;
    height: 100vh;
    background: rgba(18, 22, 38, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-glass);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.5);
}

.mobile-sidebar.active {
    transform: translateX(280px);
    /* Slide in */
}

.mobile-sidebar .sidebar-header {
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-glass);
}

.mobile-sidebar .sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.mobile-sidebar .nav-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.2s, color 0.2s;
}

.mobile-sidebar .nav-item:active {
    background: rgba(255, 255, 255, 0.05);
}

.mobile-sidebar .nav-icon {
    font-size: 1.25rem;
    margin-right: 16px;
    width: 24px;
    text-align: center;
}
/* AI MingShu */
.mingshu-progress { display:flex; flex-direction:column; gap:12px; margin-top:16px; }
.progress-bar-track { width:100%; height:8px; background:var(--glass-bg); border-radius:10px; overflow:hidden; border:1px solid var(--border-glass); }
.progress-bar-fill { height:100%; background:linear-gradient(90deg, var(--gold), #fef08a); transition:width 0.4s ease; }
.progress-info { display:flex; justify-content:space-between; font-size:0.85rem; color:var(--text-secondary); font-weight:600; }
.progress-steps { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.step-badge { font-size:0.8rem; padding:4px 10px; background:rgba(255,255,255,0.05); border:1px solid var(--border-glass); border-radius:20px; color:var(--text-secondary); }
.step-badge.done { background:rgba(234,179,8,0.15); border-color:var(--gold); color:var(--gold); }

/* MingShu Chapters */
.ms-chapter { margin-bottom: 12px; border-radius: 12px; overflow: hidden; border:1px solid var(--border-glass); }
.ms-chapter-header { display:flex; align-items:center; padding:14px; background:rgba(255,255,255,0.05); cursor:pointer; user-select:none; }
.ms-chapter-icon { font-size:1.3rem; margin-right:12px; }
.ms-chapter-title { font-weight:700; color:var(--text-primary); flex-grow:1; font-size:1.05rem; }
.ms-chapter-toggle { font-size:0.8rem; color:var(--text-secondary); }
.ms-chapter-body { padding:0 16px; max-height:0; overflow:hidden; transition:max-height 0.4s ease, padding 0.4s ease; opacity:0; }
.ms-chapter-body.open { max-height:10000px; padding:16px; opacity:1; background:transparent; }
.ms-h1, .ms-h2, .ms-h3 { margin-top:1.5em; margin-bottom:0.8em; color:var(--text-primary); font-weight:700; }
