/*
 * misterselim - Modern Light Design System
 * Based on Release Calendar design, adapted for personal hub
 */

/* ============================================
   CSS Variables - Design Tokens
   ============================================ */
:root {
    /* Typography */
    --font-display: 'Sora', sans-serif;
    --font-body: 'DM Sans', sans-serif;

    /* Light Theme Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fb;
    --bg-tertiary: #f1f3f5;
    --bg-card: #ffffff;
    --bg-hover: #f1f3f5;

    /* Text Colors */
    --text-primary: #1a1a2e;
    --text-secondary: #4a5568;
    --text-muted: #718096;

    /* Accent Colors */
    --accent-primary: #3b82f6;
    --accent-primary-light: rgba(59, 130, 246, 0.1);
    --accent-secondary: #6366f1;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-info: #0ea5e9;

    /* App Colors */
    --app-finances: #10b981;
    --app-nutrition: #f59e0b;
    --app-media: #a855f7;
    --app-products: #3b82f6;
    --app-qanda: #ef4444;
    --app-projects: #6366f1;

    /* Borders & Effects */
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

    /* Spacing */
    --topbar-height: 72px;
    --container-padding: 3rem;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Dark Mode Tokens
   ============================================ */
[data-theme="dark"] {
    --bg-primary: #1a1b2e;
    --bg-secondary: #13141f;
    --bg-tertiary: #232436;
    --bg-card: #1e1f33;
    --bg-hover: #2a2b42;

    --text-primary: #e4e4ed;
    --text-secondary: #a0a0b8;
    --text-muted: #6b6b85;

    --border-color: #2d2e45;
    --border-hover: #3d3e55;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);

    --accent-primary-light: rgba(59, 130, 246, 0.15);
}

/* ============================================
   Base Styles & Reset
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    margin-bottom: 0.5em;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: #2563eb;
}

/* ============================================
   Topbar Navigation
   ============================================ */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
    border-bottom: 1px solid var(--border-color);
    z-index: 1030;
    display: flex;
    align-items: center;
    padding: 0 var(--container-padding);
    overflow: visible;
}

[data-theme="dark"] .topbar {
    background: var(--bg-primary);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.25rem;
    text-decoration: none;
    transition: opacity var(--transition-fast);
    max-height: var(--topbar-height);
    overflow: hidden;
}

.topbar-brand:hover {
    color: var(--text-primary);
    opacity: 0.8;
}

.topbar-brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
    font-size: 1.35rem;
    line-height: 1;
}

.topbar-brand-logo {
    height: 2rem;
    width: auto;
    object-fit: contain;
}

.topbar-brand-logo--full {
    height: calc(var(--topbar-height) - 1rem);
    margin: 0;
}

.topbar-brand-logo--mobile {
    display: none;
}

.topbar-brand--logo-only {
    gap: 0;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 2rem;
}

.topbar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 10px;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.topbar-nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.topbar-nav-link.active {
    color: var(--accent-primary);
    background: var(--accent-primary-light);
}

.topbar-nav-link i {
    font-size: 1.1rem;
}

/* Dropdown Styles */
.topbar-dropdown {
    position: relative;
}

.topbar-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 200px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-base);
    z-index: 1031;
}

.topbar-dropdown:hover .topbar-dropdown-menu,
.topbar-dropdown.open .topbar-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.topbar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-radius: 8px;
    transition: all var(--transition-fast);
}

.topbar-dropdown-item:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.topbar-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

.topbar-dropdown-menu-end {
    right: 0;
    left: auto;
}

/* User Section */
.topbar-end {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.topbar-user:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.topbar-user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: white;
}

.topbar-user-avatar-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* Mobile Menu Toggle */
.topbar-toggle {
    display: none;
    padding: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

.topbar-chevron {
    font-size: 0.7rem;
    margin-left: 0.25rem;
}

/* ============================================
   Main Content Area
   ============================================ */
.main-content {
    margin-top: var(--topbar-height);
    padding: var(--container-padding);
    max-width: 1500px;
    margin-left: auto;
    margin-right: auto;
    flex: 1;
    width: 100%;
}

.container-custom {
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================================
   Page Header (shared across all pages)
   ============================================ */
.fin-page-header {
    padding-top: 2rem;
    margin-bottom: 2.5rem;
}

.fin-page-title {
    font-family: var(--font-display);
    font-weight: 700;
    margin: 0;
}

/* ============================================
   Cards
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: all var(--transition-base);
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.card-body {
    padding: 1.25rem;
}

.card-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* ============================================
   Badges
   ============================================ */
.badge {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.7rem;
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    letter-spacing: 0.02em;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.625rem 1.25rem;
    border-radius: 10px;
    border: none;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn-outline-primary {
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
}

.btn-outline-primary:hover {
    background: var(--accent-primary-light);
    color: var(--accent-primary);
}

.btn-outline-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-outline-secondary:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.btn-success {
    background: var(--accent-success);
    color: white;
}

.btn-success:hover {
    background: #059669;
    color: white;
}

.btn-danger {
    background: var(--accent-danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    color: white;
}

/* ============================================
   Forms
   ============================================ */
.form-control, .form-select {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-family: var(--font-body);
    transition: all var(--transition-fast);
}

.form-control:focus, .form-select:focus {
    background: var(--bg-primary);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-light);
    color: var(--text-primary);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-label {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-check-input:checked {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* ============================================
   Tables
   ============================================ */
.table {
    color: var(--text-primary);
    border-color: var(--border-color);
}

.table > thead {
    background: var(--bg-tertiary);
}

.table > thead > tr > th {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
}

.table > tbody > tr > td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table > tbody > tr:hover {
    background: var(--bg-hover);
}

/* ============================================
   Alerts
   ============================================ */
.alert {
    border: none;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
}

.alert-info {
    background: rgba(14, 165, 233, 0.1);
    color: #0369a1;
    border-left: 3px solid var(--accent-info);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    border-left: 3px solid var(--accent-success);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
    border-left: 3px solid var(--accent-warning);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    border-left: 3px solid var(--accent-danger);
}

/* ============================================
   Pagination
   ============================================ */
.pagination {
    gap: 0.25rem;
}

.page-link {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 0.5rem 0.875rem;
    font-family: var(--font-display);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.page-link:hover {
    background: var(--bg-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.page-item.active .page-link {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.page-item.disabled .page-link {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    opacity: 0.5;
}

/* ============================================
   Home Page - App Cards
   ============================================ */
.home-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.app-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.app-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-hover);
    color: inherit;
}

.app-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-card-count-wrapper {
    text-align: right;
}

.app-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.app-card-icon.finances {
    background: rgba(16, 185, 129, 0.1);
    color: var(--app-finances);
}

.app-card-icon.nutrition {
    background: rgba(245, 158, 11, 0.1);
    color: var(--app-nutrition);
}

.app-card-icon.media {
    background: rgba(168, 85, 247, 0.1);
    color: var(--app-media);
}

.app-card-icon.products {
    background: rgba(59, 130, 246, 0.1);
    color: var(--app-products);
}

.app-card-icon.qanda {
    background: rgba(239, 68, 68, 0.1);
    color: var(--app-qanda);
}

.app-card-icon.projects {
    background: rgba(99, 102, 241, 0.1);
    color: var(--app-projects);
}

.app-card-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.app-card-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.app-card-count {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.app-card-count.finances { color: var(--app-finances); }
.app-card-count.nutrition { color: var(--app-nutrition); }
.app-card-count.media { color: var(--app-media); }
.app-card-count.products { color: var(--app-products); }
.app-card-count.qanda { color: var(--app-qanda); }
.app-card-count.projects { color: var(--app-projects); }

.app-card-count-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ============================================
   Hero About Section
   ============================================ */
.hero-about {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 4rem;
    align-items: center;
    padding: 3rem 0;
    background: var(--bg-primary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    padding: 3rem;
    margin-bottom: 2rem;
}

.hero-about-label {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-muted);
    display: block;
    margin-bottom: 1rem;
}

.hero-about-title {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--text-primary);
    margin: 0 0 1.5rem;
}

.hero-about-title em {
    font-style: italic;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-about-desc {
    border-left: 2px solid var(--border-color);
    padding-left: 1.5rem;
    margin-bottom: 2.5rem;
}

.hero-about-desc p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0 0 1rem;
}

.hero-about-logo {
    margin-top: 0.5rem;
}

.hero-about-logo img {
    height: calc(var(--topbar-height) * 1.8);
    width: auto;
    object-fit: contain;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.hero-about-logo img:hover {
    opacity: 1;
}

.hero-about-desc p:last-child {
    margin-bottom: 0;
}

.hero-about-photo {
    position: relative;
}

.hero-about-photo img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: center 20%;
    border-radius: 16px;
    display: block;
}

.hero-about-namecard {
    position: absolute;
    bottom: -1rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    white-space: nowrap;
}

.hero-about-name {
    display: block;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.hero-about-role {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.hero-about-socials {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border-color);
}

.hero-about-socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: all var(--transition-fast);
}

.hero-about-socials a:hover {
    color: var(--accent-primary);
    background: var(--accent-primary-light);
}

@media (max-width: 991.98px) {
    .hero-about {
        grid-template-columns: 1fr minmax(200px, 300px);
        gap: 2.5rem;
        padding: 2rem;
    }
    .hero-about-title { font-size: 2.25rem; }
}

@media (max-width: 767.98px) {
    .hero-about {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 1.5rem;
    }
    .hero-about-photo {
        order: -1;
        max-width: 300px;
        margin: 0 auto;
    }
    .hero-about-title { font-size: 2rem; }
}

/* ============================================
   Utility Classes
   ============================================ */
.text-muted {
    color: var(--text-muted) !important;
}

.text-primary {
    color: var(--accent-primary) !important;
}

.bg-primary {
    background: var(--accent-primary) !important;
}

.bg-secondary {
    background: var(--bg-tertiary) !important;
}

.bg-light {
    background: var(--bg-secondary) !important;
}

.border-secondary {
    border-color: var(--border-color) !important;
}

.border-top, .border-bottom {
    border-color: var(--border-color) !important;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
}

.empty-state i {
    color: var(--text-muted);
}

.empty-state h5 {
    margin-bottom: 0.5rem;
}

/* ============================================
   Mobile Navigation
   ============================================ */
.mobile-nav {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    z-index: 999;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    box-shadow: var(--shadow-lg);
    transition: max-height var(--transition-slow), opacity var(--transition-base);
}

.mobile-nav.show {
    max-height: calc(100vh - var(--topbar-height));
    overflow-y: auto;
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 1rem;
    border-radius: 10px;
    transition: all var(--transition-fast);
}

.mobile-nav-link:hover, .mobile-nav-link.active {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.mobile-nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.75rem 0;
}

/* ============================================
   Site Footer
   ============================================ */
.site-footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 2rem var(--container-padding);
}

.site-footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-footer-nav {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.site-footer-nav a {
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.site-footer-nav a:hover {
    color: var(--text-primary);
}

.site-footer-info {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ============================================
   Theme Toggle
   ============================================ */
.theme-toggle-btn {
    border: none;
    background: transparent;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    cursor: pointer;
}

/* ============================================
   Login Button (Desktop: full button, Mobile: icon only)
   ============================================ */
.topbar-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: 10px;
    background: var(--accent-primary);
    color: white;
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.topbar-login-btn:hover {
    background: #2563eb;
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.topbar-login-btn i {
    font-size: 1.1rem;
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 991.98px) {
    :root {
        --container-padding: 1.5rem;
    }

    .topbar-nav {
        display: none;
    }

    .topbar-toggle {
        display: block;
        margin-left: 1rem;
    }
}

@media (max-width: 767.98px) {
    :root {
        --topbar-height: 64px;
        --container-padding: 1rem;
    }

    .topbar-brand span {
        display: none;
    }

    .topbar-brand-logo--desktop {
        display: none;
    }

    .topbar-brand-logo--mobile {
        display: block;
    }

    .topbar-brand-icon {
        display: none;
    }

    .topbar-user span {
        display: none;
    }

    .topbar-login-btn {
        background: transparent;
        color: var(--text-secondary);
        padding: 0.5rem;
        width: 36px;
        height: 36px;
        border-radius: 10px;
        justify-content: center;
        box-shadow: none;
    }

    .topbar-login-btn:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
        transform: none;
        box-shadow: none;
    }

    .topbar-login-btn span {
        display: none;
    }

    .topbar-login-btn i {
        font-size: 1.25rem;
    }

    .home-grid {
        grid-template-columns: 1fr;
    }

    /* iOS zoom prevention */
    .form-control, .form-select, textarea.form-control {
        font-size: 16px;
    }

    /* Touch-friendly targets */
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.25rem;
    }

    .page-link {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .topbar-toggle {
        min-width: 44px;
        min-height: 44px;
    }

    .blog-category-btn {
        min-height: 44px;
        padding: 0.625rem 1.25rem;
    }

    /* Typography scaling */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.35rem; }
    h3 { font-size: 1.15rem; }

    /* Blog article cover */
    .blog-article-cover {
        aspect-ratio: 16 / 9;
    }

    /* Blog article meta wrap */
    .blog-article-meta {
        flex-wrap: wrap;
        gap: 0.5rem 1rem;
    }

    /* Card padding reduction */
    .card-body { padding: 1rem; }
    .app-card { padding: 1.25rem; }
}

@media (max-width: 479.98px) {
    html { font-size: 15px; }
    .topbar { padding: 0 0.75rem; }
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.stagger-item {
    opacity: 0;
    animation: fadeIn 0.4s ease-out forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.05s; }
.stagger-item:nth-child(2) { animation-delay: 0.1s; }
.stagger-item:nth-child(3) { animation-delay: 0.15s; }
.stagger-item:nth-child(4) { animation-delay: 0.2s; }
.stagger-item:nth-child(5) { animation-delay: 0.25s; }

/* ============================================
   App-specific list styles
   ============================================ */
.entry-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.entry-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all var(--transition-fast);
}

.entry-item:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

.entry-item-title {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--text-primary);
}

.entry-item-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ============================================
   Wiki Content - Timeline List
   ============================================ */
.wiki-content ul.timeline {
    list-style: none;
    padding-left: 0;
    margin: 1.5rem 0;
    position: relative;
}

.wiki-content ul.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--accent-primary);
    border-radius: 1px;
}

.wiki-content ul.timeline li {
    position: relative;
    padding-left: 2rem;
    padding-bottom: 1.25rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.wiki-content ul.timeline li:last-child {
    padding-bottom: 0;
}

.wiki-content ul.timeline li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 16px;
    height: 16px;
    background: var(--accent-primary);
    border-radius: 50%;
    border: 3px solid var(--bg-primary);
    box-shadow: 0 0 0 2px var(--accent-primary);
}

.wiki-content h1,
.wiki-content h2,
.wiki-content h3,
.wiki-content h4,
.wiki-content h5,
.wiki-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* ============================================
   Blog Layout
   ============================================ */
.blog-header {
    text-align: center;
    padding: 2.5rem 0 1.5rem;
}

.blog-header-title {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.blog-header-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin: 0;
}

.blog-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.blog-category-btn {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.blog-category-btn:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
    background: var(--bg-hover);
}

.blog-category-btn.active {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.blog-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all var(--transition-base);
}

.blog-card--has-cover {
    padding: 0;
    overflow: hidden;
}

.blog-card--has-cover .blog-card-body {
    padding: 1.25rem 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.blog-card-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.blog-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.blog-card:hover .blog-card-cover img {
    transform: scale(1.04);
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-hover);
    color: inherit;
}

.wiki-badge {
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
    font-weight: 500;
}

[data-theme="dark"] .wiki-badge {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
}

.blog-article-meta .wiki-badge {
    font-size: 0.875rem;
    line-height: 1.5;
    padding: 0.15rem 0.7rem;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.blog-article-meta > span {
    display: inline-flex;
    align-items: center;
    line-height: 1.5;
}

.blog-card-header {
    display: flex;
    align-items: center;
}

.blog-card-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.35;
}

.blog-card-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-meta {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.blog-card-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Blog Article Detail */
.blog-article {
    max-width: 800px;
    margin: 0 auto;
    padding: 1.5rem 0;
}

.blog-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 0;
    margin-bottom: 1.5rem;
    transition: color var(--transition-fast);
}

.blog-back-link:hover {
    color: var(--accent-primary);
}

.blog-article-cover {
    width: 100%;
    aspect-ratio: 21 / 9;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.blog-article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-article-header {
    margin-bottom: 2.5rem;
}

.blog-article-header > .badge {
    margin-bottom: 1rem;
}

.blog-article-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
    margin-bottom: 1rem;
}

.blog-article-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.blog-article-meta i {
    margin-right: 0.35rem;
}

.blog-article-content {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-secondary);
}

.blog-article-content p {
    margin-bottom: 1.25rem;
}

.blog-article-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

.blog-article-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

@media (max-width: 767.98px) {
    .blog-header-title {
        font-size: 1.75rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-article-title {
        font-size: 1.5rem;
    }

    .blog-categories {
        justify-content: flex-start;
    }
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   Touch Device Adaptations
   ============================================ */
@media (hover: none) {
    .app-card:active,
    .blog-card:active,
    .proj-card:active,
    .mt-card:active {
        transform: scale(0.98);
    }

    .btn:active {
        transform: scale(0.97);
    }

    .wiki-comment-edit-btn {
        opacity: 0.6;
    }
}

/* ============================================
   Safe Area Insets (Notch Devices)
   ============================================ */
@supports (padding: env(safe-area-inset-left)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .topbar {
        padding-left: max(var(--container-padding), env(safe-area-inset-left));
        padding-right: max(var(--container-padding), env(safe-area-inset-right));
    }

    .mobile-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ============================================
   Responsive Table Utility
   ============================================ */
.table-responsive-mobile {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 767.98px) {
    .table-responsive-mobile table {
        min-width: 600px;
    }
}
