/* MFTO Living Homepage & Dashboard Experience System - Official Theme CSS */
:root {
  --mfto-bg-dark: #070A0F;
  --mfto-bg-surface: rgba(15, 21, 32, 0.55);
  --mfto-bg-surface-hover: rgba(22, 30, 46, 0.65);
  --mfto-bg-surface-active: rgba(28, 38, 58, 0.8);

  --mfto-border-subtle: rgba(255, 255, 255, 0.07);
  --mfto-border-focus: rgba(245, 197, 99, 0.4);

  --mfto-text-primary: #F8FAFC;
  --mfto-text-secondary: #94A3B8;
  --mfto-text-muted: #64748B;

  --mfto-accent-amber: #F5C563;
  --mfto-accent-amber-subtle: rgba(245, 197, 99, 0.12);
  --mfto-accent-blue: #38BDF8;
  --mfto-accent-green: #34D399;

  --mfto-radius-lg: 16px;
  --mfto-radius-md: 12px;
  --mfto-radius-sm: 8px;

  --mfto-transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --mfto-transition-medium: 0.35s cubic-bezier(0.16, 1, 0.3, 1);

  --mfto-sidebar-width: 240px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse 800px 500px at 80% 10%, rgba(217,164,77,0.15), transparent 60%),
              linear-gradient(180deg, #1a2233 0%, #0c1119 60%, #05070a 100%);
  min-height: 100vh;
  color: var(--mfto-text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Root App Shell */
#app {
  display: flex;
  min-height: 100vh;
  width: 100vw;
  position: relative;
  background: radial-gradient(ellipse 800px 500px at 80% 10%, rgba(217,164,77,0.15), transparent 60%),
              linear-gradient(180deg, #1a2233 0%, #0c1119 60%, #05070a 100%);
}

/* Ambient Scene Background - Controlled Cinematic Depth */
.mfto-ambient-scene {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background: radial-gradient(circle at 85% 10%, rgba(245, 197, 99, 0.08) 0%, transparent 45%),
              radial-gradient(circle at 15% 75%, rgba(56, 189, 248, 0.06) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 50%, rgba(17, 24, 39, 0.9) 0%, #070A0F 100%);
}

.mfto-ambient-light-1 {
  position: absolute;
  top: -10%;
  right: -5%;
  width: 65vw;
  height: 65vw;
  background: radial-gradient(circle, rgba(245, 197, 99, 0.12) 0%, rgba(212, 149, 36, 0.03) 45%, transparent 70%);
  filter: blur(70px);
}

.mfto-ambient-light-2 {
  position: absolute;
  bottom: -5%;
  left: -10%;
  width: 70vw;
  height: 70vw;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.08) 0%, rgba(15, 23, 42, 0) 65%);
  filter: blur(80px);
}

/* Layout Shell */
.mfto-shell {
  display: flex;
  width: 100%;
  min-height: 100vh;
  z-index: 1;
}

.mfto-sidebar {
  width: var(--mfto-sidebar-width);
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 18px;
  background: rgba(10, 14, 22, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--mfto-border-subtle);
  z-index: 10;
}

.mfto-main-viewport {
  margin-left: var(--mfto-sidebar-width);
  flex: 1;
  min-height: 100vh;
  padding: 32px 40px 24px 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  z-index: 2;
}

/* Glassmorphism Surfaces */
.mfto-glass-surface {
  background: var(--mfto-bg-surface);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--mfto-border-subtle);
  border-radius: var(--mfto-radius-lg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: all var(--mfto-transition-medium);
}

.mfto-glass-surface:hover {
  background: var(--mfto-bg-surface-hover);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* Home Dashboard Container */
.mfto-home-container {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

/* Top Bar / Header */
.mfto-home-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.mfto-hero-text h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #F8FAFC;
  line-height: 1.25;
}

.mfto-hero-text p {
  font-size: 14px;
  color: var(--mfto-text-secondary);
  margin-top: 6px;
  font-weight: 400;
}

.mfto-account-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  min-height: 44px;
  min-width: 44px;
  border-radius: var(--mfto-radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--mfto-border-subtle);
  color: #F8FAFC;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mfto-account-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Spatial Functional Surface Cluster */
.mfto-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

/* Spatial Functional Surface Card */
.mfto-surface-card {
  position: relative;
  padding: 24px;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  overflow: hidden;
  touch-action: manipulation;
}

.mfto-card-media-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.mfto-card-media-bg img,
.mfto-card-media-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.18;
  transition: opacity var(--mfto-transition-medium);
}

.mfto-surface-card:hover .mfto-card-media-bg img {
  opacity: 0.28;
}

.mfto-surface-card.primary-focus {
  border-color: var(--mfto-border-focus);
  background: rgba(22, 30, 48, 0.75);
  box-shadow: 0 0 24px rgba(245, 197, 99, 0.15), 0 16px 36px rgba(0, 0, 0, 0.5);
}

.mfto-surface-card.secondary-signal {
  opacity: 0.92;
}

.mfto-surface-card.receded {
  opacity: 0.65;
}

.mfto-surface-card-header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.mfto-surface-content {
  position: relative;
  z-index: 1;
}

.mfto-surface-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #F8FAFC;
}

.mfto-surface-card.primary-focus .mfto-surface-icon {
  background: rgba(245, 197, 99, 0.12);
  border-color: rgba(245, 197, 99, 0.3);
  color: var(--mfto-accent-amber);
}

.mfto-surface-title {
  font-size: 20px;
  font-weight: 700;
  color: #F8FAFC;
  margin-top: 14px;
}

.mfto-surface-desc {
  font-size: 13px;
  color: var(--mfto-text-secondary);
  margin-top: 4px;
  line-height: 1.45;
}

.mfto-surface-footer {
  position: relative;
  z-index: 1;
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mfto-surface-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  min-height: 44px;
  border-radius: var(--mfto-radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #F8FAFC;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mfto-surface-btn:hover,
.mfto-surface-card.primary-focus .mfto-surface-btn {
  background: rgba(245, 197, 99, 0.15);
  border-color: rgba(245, 197, 99, 0.35);
  color: var(--mfto-accent-amber);
}

/* Trust Strip Bottom */
.mfto-trust-strip {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 16px 24px;
  border-radius: var(--mfto-radius-md);
  background: rgba(12, 17, 26, 0.6);
  border: 1px solid var(--mfto-border-subtle);
}

.mfto-trust-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--mfto-text-secondary);
  font-weight: 500;
}

.mfto-trust-item svg {
  color: var(--mfto-accent-amber);
}

/* Mobile Navigation & Top Bar Styles */
.mfto-mobile-bar {
  display: none;
}

.mfto-mobile-drawer {
  display: none;
}

.mfto-mobile-scene-layout {
  display: none;
}

/* Mobile & Touch Responsive Adaptation (iPhone 390x844 / 428x926) */
@media (max-width: 900px) {
  .mfto-shell {
    flex-direction: column;
  }

  /* Hide Desktop Sidebar on Mobile */
  .mfto-sidebar {
    display: none;
  }

  /* Mobile Bar (Header Header & Hamburger Toggle) */
  .mfto-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px 16px;
    background: rgba(10, 14, 22, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--mfto-border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
  }

  .mfto-hamburger-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #F8FAFC;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .mfto-hamburger-btn:active {
    background: rgba(245, 197, 99, 0.15);
    border-color: rgba(245, 197, 99, 0.3);
  }

  /* Mobile Drawer Nav Overlay */
  .mfto-mobile-drawer {
    display: block;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(7, 10, 15, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }

  .mfto-mobile-drawer.open {
    opacity: 1;
    pointer-events: auto;
  }

  .mfto-mobile-drawer-content {
    background: rgba(15, 21, 32, 0.95);
    border-bottom: 1px solid var(--mfto-border-subtle);
    padding: 20px 16px;
    transform: translateY(-10px);
    transition: transform 0.25s ease;
  }

  .mfto-mobile-drawer.open .mfto-mobile-drawer-content {
    transform: translateY(0);
  }

  .mfto-mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .mfto-main-viewport {
    margin-left: 0;
    padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px)) 16px;
    min-height: calc(100vh - 60px);
  }

  .mfto-home-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 16px;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
  }

  .mfto-hero-text h1 {
    font-size: 22px;
    line-height: 1.3;
  }

  .mfto-hero-text p {
    font-size: 13px;
  }

  /* Hide 4-card grid on mobile to enforce Section 12 rule */
  .mfto-dashboard-grid {
    display: none;
  }

  /* Mobile Scene Layout (1 Focus Dominant Hero + Compact Secondary Rail) */
  .mfto-mobile-scene-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 16px;
    margin-bottom: 24px;
  }

  /* Dominant Primary Focus Hero Card (Translucent Glassmorphism) */
  .mfto-primary-hero-card {
    position: relative;
    padding: 20px;
    border-radius: var(--mfto-radius-lg);
    border: 1px solid var(--mfto-border-focus);
    background: rgba(20,27,40,0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 0 24px rgba(245, 197, 99, 0.15), 0 12px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
  }

  .mfto-hero-card-badge {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
  }

  .mfto-focus-tag {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--mfto-accent-amber);
    background: rgba(245, 197, 99, 0.12);
    border: 1px solid rgba(245, 197, 99, 0.3);
    padding: 4px 10px;
    border-radius: 999px;
  }

  .mfto-stock-tag {
    font-size: 11px;
    font-weight: 600;
    color: #34D399;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.25);
    padding: 4px 10px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  .mfto-hero-card-details {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .mfto-hero-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .mfto-hero-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(245, 197, 99, 0.15);
    border: 1px solid rgba(245, 197, 99, 0.3);
    color: var(--mfto-accent-amber);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mfto-hero-title {
    font-size: 20px;
    font-weight: 700;
    color: #F8FAFC;
  }

  .mfto-hero-product-info {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    margin-top: 4px;
  }

  .mfto-hero-model-name {
    font-size: 15px;
    font-weight: 600;
    color: #F8FAFC;
  }

  .mfto-hero-price-tag {
    font-size: 18px;
    font-weight: 800;
    color: var(--mfto-accent-amber);
  }

  .mfto-hero-desc {
    font-size: 13px;
    color: var(--mfto-text-secondary);
    line-height: 1.4;
  }

  .mfto-hero-action-bar {
    margin-top: 6px;
  }

  .mfto-hero-cta-btn {
    width: 100%;
    min-height: 48px;
    border-radius: var(--mfto-radius-md);
    background: linear-gradient(135deg, rgba(245,197,99,0.95) 0%, rgba(212,149,36,0.95) 100%);
    border: none;
    color: #070A0F;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(245, 197, 99, 0.25);
    transition: transform 0.15s ease;
  }

  .mfto-hero-cta-btn:active {
    transform: scale(0.98);
  }

  /* Compact Secondary Rail */
  .mfto-compact-rail {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .mfto-rail-header {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mfto-text-muted);
    padding-left: 4px;
  }

  .mfto-rail-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .mfto-rail-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    min-height: 60px;
    border-radius: var(--mfto-radius-md);
    background: rgba(20,27,40,0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--mfto-border-subtle);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    cursor: pointer;
    touch-action: manipulation;
  }

  .mfto-rail-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #F8FAFC;
    flex-shrink: 0;
  }

  .mfto-rail-item-content {
    flex: 1;
    min-width: 0;
  }

  .mfto-rail-item-title {
    font-size: 15px;
    font-weight: 600;
    color: #F8FAFC;
  }

  .mfto-rail-item-sub {
    font-size: 12px;
    color: var(--mfto-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
  }

  .mfto-rail-item-action {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #F8FAFC;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
  }

  /* Mobile Trust Strip (2x2 Grid) */
  .mfto-trust-strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 14px 16px;
    background: rgba(12, 17, 26, 0.7);
  }

  .mfto-trust-item {
    font-size: 11px;
    gap: 8px;
    line-height: 1.3;
  }
}

/* Touch Target Minimum Standard */
button, .mfto-surface-card, .mfto-nav-btn {
  min-height: 44px;
}
