/* ═══════════════════════════════════════════════════════════════════════════
   PERFECT PITCH MOBILE STYLES - WORKING VERSION
   Simple, functional mobile styles
   ═══════════════════════════════════════════════════════════════════════════ */

/* Mobile detection: actual mobile devices OR narrow portrait screens */
@media (max-width: 768px) and (orientation: portrait), (max-device-width: 768px) {
  
  /* ───────────────────────────────────────────────────────────────────────────
     HIDE DESKTOP ELEMENTS
     ─────────────────────────────────────────────────────────────────────────── */
  
  .sidebar,
  .content-secondary,
  .metrics-bar,
  .welcome-message,
  .welcome-back-message,
  .report-id,
  .processing-message,
  .report-progress,
  .activity-feed,
  .nav-divider,
  .header-center,
  .system-status-mini,
  .live-indicator,
  .report-actions,
  .report-status,
  .quick-actions,
  nav {
    display: none !important;
  }

  /* Hide the desktop "Create Report" card */
  [data-report-type="create-report"] {
    display: none !important;
  }

  /* ───────────────────────────────────────────────────────────────────────────
     MOBILE LAYOUT
     ─────────────────────────────────────────────────────────────────────────── */

  body {
    overflow-x: hidden;
  }

  .app-container {
    height: auto;
    min-height: 100vh;
  }

  /* Simplified header */
  .header {
    height: 56px;
    padding: 0 16px;
    position: sticky;
  }

  .logo {
    height: 32px;
  }

  .header-logout-btn {
    font-size: 14px;
    padding: 6px 12px;
  }

  /* Main layout */
  .main-layout {
    flex-direction: column;
  }

  .content-area {
    padding: 0;
  }

  .content-primary {
    width: 100%;
  }

  .content-section {
    padding: 0;
  }

  /* Section header */
  .section-header {
    padding: 16px;
    margin-bottom: 0;
  }

  .section-title {
    font-size: 24px;
  }

  .section-count {
    font-size: 14px;
    padding: 2px 8px;
    margin-left: 8px;
  }

  /* ───────────────────────────────────────────────────────────────────────────
     MOBILE CREDIT BAR
     ─────────────────────────────────────────────────────────────────────────── */

  .mobile-credit-bar {
    background: var(--bg-secondary);
    padding: 16px;
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 16px;
  }

  .credit-display {
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
  }

  .credit-display.no-credits {
    color: var(--clr-deep-clay);
  }

  .mobile-buy-credits {
    background: var(--clr-deep-clay);
    color: var(--clr-porcelain);
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
  }

  /* ───────────────────────────────────────────────────────────────────────────
     MOBILE REPORTS
     ─────────────────────────────────────────────────────────────────────────── */

  .report-list {
    margin: 0;
    padding: 0 16px;
  }

  .report-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 12px;
    display: block !important;
  }

  .report-info {
    margin-bottom: 12px;
  }

  .report-name {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 4px;
  }

  .report-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 4px;
  }

  .report-timestamp {
    font-size: 14px;
    color: var(--text-secondary);
  }

  /* Download button */
  .mobile-download-btn {
    display: flex !important;
    width: 100%;
    background: var(--clr-deep-clay);
    color: var(--clr-porcelain);
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 500;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-download-btn:active {
    background: var(--clr-cobalt-dawn);
  }

  /* ───────────────────────────────────────────────────────────────────────────
     DESKTOP HANDOFF
     ─────────────────────────────────────────────────────────────────────────── */

  .mobile-desktop-handoff {
    background: var(--bg-secondary);
    padding: 24px;
    margin: 24px 0;
    border-radius: 8px;
    text-align: center;
  }

  .handoff-text {
    font-family: 'Aleo', serif;
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 16px;
  }

  .mobile-magic-link-btn {
    background: transparent;
    border: 2px solid var(--clr-old-gold);
    color: var(--clr-old-gold);
    padding: 12px 24px;
    border-radius: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    font-weight: 500;
    width: 100%;
    min-height: 44px;
    cursor: pointer;
  }

  .mobile-magic-link-btn:active {
    background: var(--clr-old-gold);
    color: var(--clr-magnetite);
  }

  .mobile-magic-link-btn:disabled {
    opacity: 0.5;
  }

  /* ───────────────────────────────────────────────────────────────────────────
     MOBILE BILLING
     ─────────────────────────────────────────────────────────────────────────── */

  #section-billing {
    padding: 16px;
  }

  .purchase-options {
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
  }

  .purchase-option {
    padding: 20px;
  }

  .option-name {
    font-size: 20px;
  }

  .option-price {
    font-size: 28px;
    margin-bottom: 16px;
  }

  .option-features {
    text-align: left;
    margin-bottom: 20px;
  }

  .option-features li {
    font-size: 14px;
    margin-bottom: 8px;
    padding-left: 20px;
  }

  .purchase-btn {
    font-size: 16px;
    padding: 12px;
    min-height: 44px;
  }

  /* ───────────────────────────────────────────────────────────────────────────
     SUCCESS MODAL
     ─────────────────────────────────────────────────────────────────────────── */

  .modal-content {
    margin: 16px;
    padding: 24px;
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-title {
    font-size: 24px;
  }

  .modal-text {
    font-size: 16px;
  }

  .modal-actions {
    flex-direction: column;
    gap: 12px;
  }

  .modal-btn {
    width: 100%;
    min-height: 44px;
    font-size: 16px;
  }

  /* ───────────────────────────────────────────────────────────────────────────
     LANDING PAGE MOBILE FIXES
     ─────────────────────────────────────────────────────────────────────────── */

  /* Reduce excessive padding */
  .bg-white,
  .bg-dark,
  .bg-moonstone {
    padding: 40px 0;
  }

  .container-narrow,
  .container-wide {
    padding: 0 20px;
  }

  /* Hero section */
  #logo-holder {
    margin: 20px auto 30px auto;
  }

  .bg-white h1 {
    font-size: 28px !important;
    line-height: 1.2 !important;
    margin-bottom: 16px !important;
  }

  .bg-white h2 {
    font-size: 18px !important;
    line-height: 1.3 !important;
    margin: 16px 0 !important;
  }

  /* CTA buttons */
  .cta-primary,
  .cta-secondary,
  .cta-button {
    font-size: 16px;
    padding: 12px 24px;
    margin: 8px;
    display: block;
    width: calc(100% - 16px);
    text-align: center;
    min-height: 44px;
  }

  /* Problem points */
  .problem-points {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 0;
  }

  .problem-point {
    padding: 20px;
  }

  .problem-point h3 {
    font-size: 20px;
    margin-bottom: 8px;
  }

  .problem-point p {
    font-size: 16px;
  }

  /* Steps */
  .steps {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .step {
    padding: 20px;
  }

  /* Modules */
  .module-section {
    padding: 20px;
    margin-bottom: 20px;
  }

  .nested-modules {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 20px;
  }

  .module {
    padding: 16px;
  }

  /* Economics table */
  .economics-table {
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 20px 0;
  }

  .vs-divider {
    order: -1;
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  /* Footer */
  .footer-container {
    padding: 20px 16px;
  }
}

/* Tablet styles */
@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar {
    width: 240px;
  }

  .metrics-bar {
    flex-wrap: wrap;
  }

  .purchase-options {
    gap: 30px;
  }
}