/* ============================================================================
   PM Pulse - Responsive Styles
   Mobile-first responsive design for screens <= 640px
   ============================================================================ */

@media (max-width: 640px) {
  /* ========================================
     Layout & Container
     ======================================== */
  .container {
    padding: var(--space-sm);
  }

  /* ========================================
     Header
     ======================================== */
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-md) 0;
  }
  
  .header-left {
    width: 100%;
    padding-left: var(--space-sm);
  }
  
  .header-right {
    width: 100%;
    justify-content: flex-end;
  }
  
  .user-name {
    display: none;
  }
  
  .logo h1 {
    font-size: 1.1rem;
  }
  
  .logo-icon {
    font-size: 1.5rem;
  }
  
  .tagline {
    font-size: 0.7rem;
  }
  
  .login-btn {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.8rem;
  }

  /* ========================================
     Navigation
     ======================================== */
  .nav-bar {
    gap: 2px;
    padding: var(--space-sm) 0;
    margin-bottom: var(--space-md);
  }
  
  .nav-link {
    padding: var(--space-xs) var(--space-sm);
    font-size: 0.7rem;
  }

  /* ========================================
     Gauge Section
     ======================================== */
  .gauge-section {
    padding: var(--space-md);
    margin-bottom: var(--space-md);
  }
  
  .gauge-ring {
    width: 160px;
    height: 160px;
  }
  
  .gauge-value {
    font-size: 2.4rem;
  }
  
  .gauge-label {
    font-size: 0.85rem;
  }
  
  .gauge-title {
    font-size: 0.85rem;
  }
  
  .gauge-scale {
    font-size: 0.65rem;
    padding-top: var(--space-md);
  }

  /* ========================================
     Outlook Section
     ======================================== */
  .outlook-section {
    padding: var(--space-md);
    margin-bottom: var(--space-md);
  }
  
  .outlook-section h2 {
    font-size: 0.85rem;
    flex-wrap: wrap;
    margin-bottom: var(--space-md);
  }
  
  .outlook-section .subtitle {
    font-size: 0.65rem;
  }
  
  .outlook-bar-container {
    height: 24px;
    margin-bottom: var(--space-md);
  }
  
  .outlook-value {
    font-size: 0.75rem;
  }
  
  .outlook-factors {
    flex-direction: column;
    gap: var(--space-xs);
    font-size: 0.7rem;
  }
  
  .factor {
    font-size: 0.7rem;
  }

  /* ========================================
     Table Section - Horizontal Scroll
     ======================================== */
  .table-section {
    padding: var(--space-md);
  }
  
  .table-header {
    margin-bottom: var(--space-md);
  }
  
  .table-header h2 {
    font-size: 0.85rem;
  }
  
  .table-wrapper {
    margin: 0 calc(-1 * var(--space-md));
    padding: 0 var(--space-md);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .constituents-table {
    min-width: 480px;
    font-size: 0.7rem;
  }
  
  .constituents-table th {
    font-size: 0.55rem;
    padding: var(--space-xs) var(--space-xs);
    letter-spacing: 0.02em;
  }
  
  .constituents-table td {
    font-size: 0.65rem;
    padding: var(--space-xs) var(--space-xs);
  }
  
  .constituents-table th:first-child,
  .constituents-table td:first-child {
    width: 38%;
  }
  
  .event-header-row td {
    padding: var(--space-xs) var(--space-xs) !important;
  }
  
  .event-link,
  .event-link strong {
    font-size: 0.65rem !important;
  }
  
  .link-icon {
    margin-left: 3px;
  }
  
  .link-icon svg {
    width: 8px;
    height: 8px;
  }
  
  .category {
    font-size: 0.45rem;
    padding: 1px 4px;
  }
  
  .event-header-row .volume {
    font-size: 0.45rem;
  }
  
  .outcome-cell {
    padding-left: var(--space-sm) !important;
  }
  
  .direction {
    width: 18px;
    height: 18px;
    font-size: 0.65rem;
  }

  /* ========================================
     Buttons
     ======================================== */
  .btn {
    padding: var(--space-xs) var(--space-md);
    font-size: 0.75rem;
  }
  
  .btn-sm {
    padding: 3px var(--space-sm);
    font-size: 0.7rem;
  }
  
  .btn-icon {
    font-size: 0.8rem;
  }

  /* ========================================
     Disclaimer
     ======================================== */
  .disclaimer-section {
    margin-top: var(--space-md);
  }
  
  .disclaimer-box {
    padding: var(--space-sm);
  }
  
  .disclaimer-box h3 {
    font-size: 0.75rem;
  }
  
  .disclaimer-box p {
    font-size: 0.7rem;
    line-height: 1.5;
  }
  
  .disclaimer-box .disclaimer-data {
    font-size: 0.65rem;
  }

  /* ========================================
     Footer
     ======================================== */
  .footer {
    font-size: 0.7rem;
    padding: var(--space-md) 0;
  }
  
  .footer-links {
    gap: var(--space-xs);
    font-size: 0.65rem;
  }

  /* ========================================
     Legal Pages
     ======================================== */
  .legal-title {
    font-size: 1.3rem;
  }
  
  .legal-section h2 {
    font-size: 1rem;
  }
  
  .legal-section p,
  .legal-section li {
    font-size: 0.8rem;
  }

  /* ========================================
     Leaderboard Teaser
     ======================================== */
  .leaderboard-teaser {
    padding: var(--space-lg) var(--space-md);
    min-height: 280px;
  }
  
  .teaser-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
  }
  
  .leaderboard-teaser h2 {
    font-size: 1.3rem;
  }
  
  .teaser-desc {
    font-size: 0.85rem;
    margin-bottom: var(--space-lg);
  }
  
  .unlock-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.8rem;
  }
  
  .success-badge {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
  
  .notify-text {
    font-size: 0.8rem;
  }
  
  .coming-soon-tag {
    font-size: 0.65rem;
  }

  /* ========================================
     Geopolitics Page
     ======================================== */
  .geopolitics-section {
    padding: var(--space-md);
    min-height: 450px;
  }
  
  .geopolitics-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
  }
  
  .geopolitics-header h2 {
    font-size: 1rem;
  }
  
  .geo-icon {
    font-size: 1.2rem;
  }
  
  .geo-legend {
    width: 100%;
    justify-content: flex-start;
    font-size: 0.7rem;
    gap: var(--space-md);
  }
  
  .geo-map {
    min-height: 300px;
  }
  
  .geo-stats {
    flex-wrap: wrap;
    gap: var(--space-sm);
    padding: var(--space-sm);
    margin-top: var(--space-md);
  }
  
  .geo-stat {
    flex: 1;
    min-width: 70px;
  }
  
  .geo-stat .stat-value {
    font-size: 1.2rem;
  }
  
  .geo-stat .stat-label {
    font-size: 0.6rem;
  }
  
  .popup-timeline {
    grid-template-columns: 1fr;
  }
  
  .popup-content {
    min-width: 220px;
    padding: var(--space-sm);
  }
  
  .popup-title {
    font-size: 0.85rem;
  }
  
  .popup-category,
  .popup-risk {
    font-size: 0.6rem;
  }

  /* ========================================
     Tooltip adjustments
     ======================================== */
  .tooltip {
    width: 14px;
    height: 14px;
    font-size: 9px;
  }
  
  .tooltip:hover::after {
    font-size: 10px;
    max-width: 200px;
    padding: 6px 8px;
  }
}
