/* ===== RESPONSIVE - MOBILE FIRST ===== */

/* ===== BOTTOM NAVIGATION (Mobile) ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 16px;
  color: var(--text-tertiary);
  transition: color var(--transition-fast);
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item .nav-icon {
  font-size: 24px;
  line-height: 1;
}

.bottom-nav-item .nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.bottom-nav-item .nav-badge {
  position: absolute;
  top: 4px;
  right: 8px;
  width: 16px;
  height: 16px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== TOP HEADER ===== */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-header h1 {
  font-size: var(--font-size-xl);
  font-weight: 800;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.top-header-actions {
  display: flex;
  gap: 8px;
}

.top-header-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  font-size: 20px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.top-header-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* ===== MAIN CONTENT AREA ===== */
.main-content {
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom));
  min-height: calc(100vh - var(--header-height));
  min-height: calc(100dvh - var(--header-height));
}

/* ============================================
   TABLET (480px - 768px)
   ============================================ */
@media (min-width: 480px) {
  .card-item {
    max-height: 550px;
  }

  .action-btn {
    width: 60px;
    height: 60px;
    font-size: 26px;
  }

  .action-btn-nope,
  .action-btn-like {
    width: 68px;
    height: 68px;
    font-size: 30px;
  }

  .new-match-avatar {
    width: 72px;
    height: 72px;
  }

  .message-avatar {
    width: 60px;
    height: 60px;
  }

  .photos-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .bottom-nav {
    display: none;
  }

  .main-content {
    padding-bottom: 0;
  }

  .discover-container,
  .chat-container,
  .profile-container {
    height: calc(100vh - 60px);
    height: calc(100dvh - 60px);
  }
}

/* ============================================
   DESKTOP (> 768px)
   ============================================ */
@media (min-width: 768px) {
  /* App layout with sidebar */
  .app-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
    height: 100dvh;
  }

  /* Sidebar */
  .sidebar {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    height: 100vh;
    height: 100dvh;
    position: sticky;
    top: 0;
  }

  .sidebar-logo {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
  }

  .sidebar-logo-icon {
    font-size: 28px;
  }

  .sidebar-logo-text {
    font-size: var(--font-size-lg);
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }

  .sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-md);
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    cursor: pointer;
  }

  .sidebar-nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
  }

  .sidebar-nav-item.active {
    background: rgba(254, 60, 114, 0.1);
    color: var(--primary);
  }

  .sidebar-nav-item .icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
  }

  .sidebar-nav-item .nav-badge {
    margin-left: auto;
    width: 20px;
    height: 20px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .sidebar-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid var(--border-color);
    cursor: pointer;
    transition: background var(--transition-fast);
  }

  .sidebar-profile:hover {
    background: var(--bg-tertiary);
  }

  .sidebar-profile .avatar {
    width: 40px;
    height: 40px;
  }

  .sidebar-profile-info {
    flex: 1;
    min-width: 0;
  }

  .sidebar-profile-name {
    font-size: var(--font-size-sm);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sidebar-profile-trust {
    font-size: var(--font-size-xs);
    color: var(--text-tertiary);
  }

  /* Main content */
  .main-area {
    overflow-y: auto;
    background: var(--bg-primary);
  }

  /* Discover desktop */
  .discover-container {
    height: 100%;
    padding: 24px;
  }

  .card-stack {
    padding: 0;
  }

  .card-item {
    max-width: 400px;
    max-height: 580px;
  }

  .card-actions {
    padding: 24px;
  }

  .action-btn {
    width: 64px;
    height: 64px;
    font-size: 28px;
  }

  .action-btn-nope,
  .action-btn-like {
    width: 72px;
    height: 72px;
    font-size: 32px;
  }

  /* Matches desktop */
  .matches-desktop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 24px;
  }

  /* Chat desktop - split view */
  .chat-desktop {
    display: grid;
    grid-template-columns: 320px 1fr;
    height: 100%;
  }

  .chat-desktop .messages-list {
    border-right: 1px solid var(--border-color);
  }

  .chat-desktop .chat-view {
    display: flex;
  }

  /* Profile desktop */
  .profile-desktop {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 32px;
    padding: 32px;
    max-width: 1000px;
    margin: 0 auto;
  }

  .profile-desktop .profile-header {
    background: transparent;
    border-bottom: none;
    padding-bottom: 0;
  }

  /* Modal desktop */
  .modal {
    max-width: 520px;
  }

  /* Landing page */
  .landing-hero {
    min-height: 80vh;
    padding: 80px 24px;
  }

  .landing-hero h1 {
    font-size: var(--font-size-3xl);
  }

  .landing-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    padding: 80px 24px;
    max-width: 1100px;
    margin: 0 auto;
  }

  .landing-cta {
    padding: 80px 24px;
  }
}

/* ============================================
   LARGE DESKTOP (> 1024px)
   ============================================ */
@media (min-width: 1024px) {
  .card-stack {
    display: flex;
    gap: 24px;
  }

  .card-item {
    max-width: 360px;
    max-height: 540px;
    position: relative;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .bottom-nav,
  .top-header,
  .card-actions,
  .chat-input-bar {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }
}

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