/* ===== MOBILE WIDTH OPTIMIZATION WITH FONT FIXES ===== */
/* Minimal CSS to fix width issues and font sizes on mobile screens */

/* Prevent horizontal scrolling and fix font sizes */
@media screen and (max-width: 768px) {
  html,
  body {
    overflow-x: hidden;
    max-width: 100%;
    font-size: 14.5px;
  }

  * {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Main containers width fix */
  .container,
  .hero-container,
  .section-container,
  .content-container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Hero section width fix */
  .hero,
  .hero-content,
  .hero-section {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Feature badges container */
  .feature-badges,
  .badges-container {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 0.5rem !important;
  }

  /* Fix flash message animations on mobile - disable shimmer effect */
  .flash-message::before,
  .auth-card .flash-message::before {
    animation: none !important;
    display: none !important;
  }

  /* Disable slide-in animation on mobile for better performance */
  .flash-message,
  .auth-card .flash-message {
    animation: none !important;
  }

  /* Badge font size fix */
  .badge,
  .feature-badge {
    font-size: 0.8rem !important;
    padding: 0.5rem 1rem !important;
  }

  /* Heading font sizes for mobile */
  h1,
  .hero-title,
  .main-title {
    font-size: 1.65rem !important;
    line-height: 1.3 !important;
  }

  h2,
  .section-title {
    font-size: 1.35rem !important;
    line-height: 1.3 !important;
  }

  h3,
  .feature-title {
    font-size: 1.15rem !important;
    line-height: 1.4 !important;
  }

  h4 {
    font-size: 1.05rem !important;
    line-height: 1.4 !important;
  }

  /* Body text font sizes */
  p,
  .hero-description,
  .section-description,
  .feature-description {
    font-size: 1rem !important;
    line-height: 1.5 !important;
  }

  
  /* Stats section width fix */
  .stats-section,
  .hero-stats,
  .stats-container {
    width: 100% !important;
    max-width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.75rem !important;
  }

  /* Stats text size */
  .stat-number,
  .stat-value {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
  }

  .stat-label,
  .stat-text {
    font-size: 0.8rem !important;
    line-height: 1.3 !important;
  }

  /* Feature items section */
  .features-section,
  .feature-items,
  .intelligent-management {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Feature item cards */
  .feature-item,
  .feature-card {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 1.5rem !important;
    padding: 1rem !important;
  }

  /* Feature item text */
  .feature-item h3,
  .feature-card h3 {
    font-size: 1.05rem !important;
    margin-bottom: 0.5rem !important;
  }

  .feature-item p,
  .feature-card p {
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
  }

  /* Navigation width fix */
  .navbar,
  .header {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Brand/logo text size */
  .navbar-brand,
  .logo {
    font-size: 1.25rem !important;
  }

  /* Ensure no content overflows */
  .card,
  .hero-card,
  .feature-card {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
  }

  /* Text wrapping */
  .hero-title,
  .hero-description,
  .section-title,
  .section-description,
  .feature-title,
  .feature-description {
    width: 100% !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }

  .hero-stats {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 0.5rem !important;
  }
  .hero-stats .stat {
    flex: 1 1 0;
    text-align: center;
    min-width: 0;
  }
}

/* Medium screens (480px - 768px) */
@media screen and (min-width: 481px) and (max-width: 768px) {
  html,
  body {
    font-size: 16px;
  }

  /* Heading font sizes for medium screens */
  h1,
  .hero-title,
  .main-title {
    font-size: 2rem !important;
  }

  h2,
  .section-title {
    font-size: 1.7rem !important;
  }

  h3,
  .feature-title {
    font-size: 1.5rem !important;
  }

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

  /* Body text font sizes for medium screens */
  p,
  .hero-description,
  .section-description,
  .feature-description {
    font-size: 1.15rem !important;
  }

  /* Stats text size for medium screens */
  .stat-number,
  .stat-value {
    font-size: 1.6rem !important;
  }

  .stat-label,
  .stat-text {
    font-size: 1rem !important;
  }

  .badge,
  .feature-badge {
    font-size: 1rem !important;
  }

  .navbar-brand,
  .logo {
    font-size: 1.6rem !important;
  }
}

/* Very small screens (up to 480px) */
@media screen and (max-width: 480px) {
  html,
  body {
    font-size: 14px;
  }

  .container,
  .hero-container,
  .section-container,
  .content-container,
  .hero,
  .hero-content,
  .features-section {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  /* Font sizes for very small screens */
  h1,
  .hero-title,
  .main-title {
    font-size: 1.35rem !important;
  }

  h2,
  .section-title {
    font-size: 1.15rem !important;
  }

  h3,
  .feature-title {
    font-size: 1.05rem !important;
  }

  p,
  .hero-description,
  .section-description,
  .feature-description {
    font-size: 0.9rem !important;
  }

  .stats-section,
  .hero-stats,
  .stats-container {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }

  .stat-number,
  .stat-value {
    font-size: 1.05rem !important;
  }

  .stat-label,
  .stat-text {
    font-size: 0.75rem !important;
  }

  .badge,
  .feature-badge {
    font-size: 0.75rem !important;
    padding: 0.4rem 0.8rem !important;
  }

  .profile-card-header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.5rem 0.5rem !important;
    background: var(--primary) !important;
    color: #fff !important;
    border-top-left-radius: 8px !important;
    border-top-right-radius: 8px !important;
    gap: 0.25rem !important;
    flex-wrap: nowrap !important;
  }

  .profile-card-header .site-name {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 1rem !important;
    margin-right: 0.25rem !important;
  }

  .profile-card-header button,
  .profile-card-header .btn {
    font-size: 0.9rem !important;
    padding: 0.4rem 0.7rem !important;
    border-radius: 6px !important;
    margin-left: 0.15rem !important;
    margin-right: 0 !important;
    min-width: 70px !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important;
    max-width: 45% !important;
  }

  .section-description,
  .feature-description {
    font-size: 1.05rem !important;
    line-height: 1.6 !important;
  }
  .stat-label {
    font-size: 0.9rem !important;
    line-height: 1.4 !important;
  }

  .navbar,
  .header {
    min-height: 60px !important;
    height: 60px !important;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    display: flex !important;
    align-items: center !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    background: #fff !important;
    border-bottom: 1px solid #e2e8f0 !important;
  }
  .menu-btn,
  .navbar-toggler,
  .hamburger-menu {
    margin-right: 1rem !important;
    margin-left: 0.25rem !important;
    font-size: 1.7rem !important;
    height: 44px !important;
    width: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 8px !important;
  }
  .navbar-brand,
  .header-title {
    margin-left: 0.5rem !important;
  }
}

/* Extra small screens */
@media screen and (max-width: 320px) {
  .container,
  .hero-container,
  .section-container,
  .content-container,
  .hero,
  .hero-content,
  .features-section {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  h1,
  .hero-title,
  .main-title {
    font-size: 1.25rem !important;
  }

  p,
  .hero-description,
  .section-description {
    font-size: 0.85rem !important;
  }
}
