/* ========================================
   DEVTRAQ MOBILE CSS - V7 FINAL
   Last Updated: January 8, 2026
   Fixes: Button spacing, header spacing
   ======================================== */

/* ========================================
   GLOBAL FIXES (ALL SCREEN SIZES)
   ======================================== */

/* Header spacing between logo and nav */
.navbar__brand {
  margin-right: 40px !important;
}

.navbar__nav {
  gap: 32px !important;
}

/* ========================================
   TABLET BREAKPOINT (1024px)
   ======================================== */
@media screen and (max-width: 1024px) {
  [style*="grid-template-columns: repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ========================================
   MOBILE BREAKPOINT (768px)
   ======================================== */
@media screen and (max-width: 768px) {
  
  /* --- NAVBAR --- */
  .navbar__actions > a.btn,
  .navbar__actions > a.btn--primary,
  .navbar__actions > a.btn--secondary,
  .navbar__actions .btn {
    display: none !important;
  }
  
  .navbar__mobile-toggle {
    display: flex !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 1000 !important;
  }
  
  .navbar__nav {
    display: none !important;
  }

  .navbar__nav--open {
    display: flex !important;
    flex-direction: column !important;
    position: absolute !important;
    top: 72px !important;
    left: 0 !important;
    right: 0 !important;
    background: white !important;
    padding: 24px !important;
    border-bottom: 1px solid #E5E7EB !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
    z-index: 999 !important;
    gap: 16px !important;
  }
  
  .navbar__nav--open .navbar__link {
    padding: 12px 0 !important;
    border-bottom: 1px solid #E5E7EB !important;
    display: block !important;
  }
  
  .navbar__nav--open .navbar__link:last-child {
    border-bottom: none !important;
  }

  /* --- FORCE SINGLE COLUMN GRIDS --- */
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4,
  [style*="grid-template-columns: repeat(2"],
  [style*="grid-template-columns: repeat(3"],
  [style*="grid-template-columns: repeat(4"],
  [style*="grid-template-columns: 1fr 1fr"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
  }

  /* --- HIDE DASHBOARD PREVIEW --- */
  .hero__image,
  .hero__image-placeholder {
    display: none !important;
  }

  /* --- PREVENT HORIZONTAL SCROLL --- */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
  }

  /* --- CONTAINER PADDING --- */
  .container {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* --- SECTIONS --- */
  section {
    padding: 50px 16px !important;
  }

  /* --- TYPOGRAPHY --- */
  h1, .hero__title {
    font-size: 1.75rem !important;
    line-height: 1.3 !important;
  }

  h2 {
    font-size: 1.5rem !important;
  }

  h3 {
    font-size: 1.25rem !important;
  }

  h4 {
    font-size: 1.1rem !important;
  }

  /* --- HERO ACTIONS --- */
  .hero__actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
  }

  .hero__actions .btn,
  .hero__actions a {
    width: 100% !important;
    max-width: 280px !important;
    text-align: center !important;
  }

  /* --- CARDS --- */
  .feature-card,
  .card {
    width: 100% !important;
    margin-bottom: 16px !important;
    padding: 30px 20px !important;
  }

  /* ========================================
     CTA BUTTONS - PROPER SPACING
     ======================================== */
  
  /* Target the CTA button container on pricing page */
  [style*="text-align: center"][style*="margin-bottom: 40px"] {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 16px !important;
  }
  
  /* Remove inline margin from buttons */
  [style*="text-align: center"] .btn[style*="margin-right"] {
    margin-right: 0 !important;
    margin-bottom: 0 !important;
  }
  
  /* General CTA button containers */
  [style*="display: flex"][style*="justify-content: center"],
  [style*="display: flex"][style*="gap: 16px"][style*="justify-content: center"] {
    flex-direction: column !important;
    align-items: center !important;
    gap: 16px !important;
  }
  
  /* Buttons in CTA sections */
  [style*="display: flex"][style*="justify-content: center"] .btn,
  [style*="text-align: center"] .btn {
    width: 100% !important;
    max-width: 280px !important;
    margin: 0 !important;
  }

  /* ========================================
     FLEXBOX TIMELINE - DO NOT OVERRIDE
     ======================================== */
  
  div[style*="background: #F5A623"][style*="border-radius: 50%"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex-shrink: 0 !important;
  }
  
  div[style*="width: 2px"][style*="background: linear-gradient"] {
    display: block !important;
    visibility: visible !important;
    flex-shrink: 0 !important;
  }

  /* --- SITE SCORE 2x2 GRID (keep it) --- */
  [style*="grid-template-columns: 1fr 1fr"][style*="gap: 20px"] {
    grid-template-columns: 1fr 1fr !important;
    display: grid !important;
    flex-direction: unset !important;
  }

  /* --- FOOTER --- */
  .footer__inner {
    flex-direction: column !important;
    text-align: center !important;
    gap: 20px !important;
  }
  
  .footer__grid {
    grid-template-columns: 1fr !important;
    text-align: center !important;
  }
  
  .footer__bottom {
    flex-direction: column !important;
    gap: 16px !important;
  }
}

/* ========================================
   SMALL MOBILE (480px)
   ======================================== */
@media screen and (max-width: 480px) {
  h1, .hero__title {
    font-size: 1.5rem !important;
  }

  h2 {
    font-size: 1.3rem !important;
  }

  .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  section {
    padding: 40px 12px !important;
  }

  .feature-card,
  .card {
    padding: 25px 16px !important;
  }

  [style*="grid-template-columns: 1fr 1fr"][style*="gap: 20px"] {
    display: flex !important;
    flex-direction: column !important;
  }
}

/* ========================================
   MODAL STYLES
   ======================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: white;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.modal-overlay.is-open .modal {
  transform: translateY(0);
}

.modal__header {
  padding: 24px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1F2937;
  margin: 0;
}

.modal__close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6B7280;
  padding: 4px;
}

.modal__close:hover {
  color: #1F2937;
}

.modal__body {
  padding: 24px;
}
