/* Mobile Responsive CSS for Benevolate Website */

/* Base Mobile Styles */
@media (max-width: 768px) {
  /* Typography */
  h1 {
    font-size: clamp(1.75rem, 8vw, 2.5rem) !important;
    line-height: 1.2 !important;
  }
  
  h2 {
    font-size: clamp(1.5rem, 6vw, 2rem) !important;
    line-height: 1.3 !important;
  }
  
  h3 {
    font-size: clamp(1.25rem, 5vw, 1.5rem) !important;
    line-height: 1.4 !important;
  }
  
  p {
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
  }
  
  /* Container and Spacing */
  .container {
    padding: 0 1rem !important;
  }
  
  .container-xxl {
    padding: 0 1rem !important;
  }
  
  /* Navigation */
  .navbar-menu {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-secondary, #111111);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-direction: column;
    align-items: stretch;
    padding: 1.5rem;
    gap: 1rem;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
  }
  
  .navbar-menu.active {
    transform: translateX(0);
  }
  
  .navbar-link {
    padding: 0.75rem 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 1.1rem !important;
  }
  
  .mobile-menu-toggle {
    display: flex !important;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
  }
  
  .hamburger-line {
    width: 100%;
    height: 3px;
    background: var(--text-primary, #ffffff);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
  }
  
  .mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }
  
  .mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
  }
  
  .mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }
  
  /* Buttons */
  .btn {
    min-height: 44px !important;
    font-size: 16px !important;
    padding: 0.75rem 1.5rem !important;
  }
  
  .btn-primary {
    width: 100% !important;
    text-align: center !important;
  }
  
  /* Forms */
  .form-control, .text-field, .select-field {
    min-height: 48px !important;
    font-size: 16px !important; /* Prevents zoom on iOS */
    padding: 12px 16px !important;
  }
  
  /* Cards and Sections */
  .card {
    margin-bottom: 1rem !important;
  }
  
  .section {
    padding: 3rem 0 !important;
  }
  
  .hero {
    padding: 5rem 0 3rem !important;
    min-height: 60vh !important;
  }
  
  /* Grid Layouts */
  .row {
    margin: 0 !important;
  }
  
  .col-md-6, .col-lg-4, .col-lg-6, .col-lg-8 {
    margin-bottom: 1.5rem !important;
  }
  
  /* Footer */
  .footer-content {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    text-align: center !important;
  }
  
  .footer-section h3 {
    font-size: 1.25rem !important;
    margin-bottom: 1rem !important;
  }
  
  .footer-section a {
    display: block !important;
    padding: 0.5rem 0 !important;
    font-size: 0.95rem !important;
  }
  
  .social-links {
    justify-content: center !important;
    margin-top: 1rem !important;
  }
  
  .footer-bottom {
    text-align: center !important;
    padding: 1rem 0 !important;
  }
  
  .footer-bottom p {
    font-size: 0.85rem !important;
    line-height: 1.5 !important;
  }
  
  /* Tables */
  .table-responsive {
    font-size: 0.9rem !important;
  }
  
  /* Modals */
  .modal-dialog {
    margin: 1rem !important;
    max-width: calc(100% - 2rem) !important;
  }
  
  /* Touch-friendly improvements */
  a, button, .btn, .navbar-link, .dropdown-link {
    min-height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  /* Prevent horizontal scroll */
  body {
    overflow-x: hidden !important;
  }
  
  body.menu-open {
    overflow: hidden !important;
  }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
  /* Even smaller typography */
  h1 {
    font-size: clamp(1.5rem, 7vw, 2rem) !important;
  }
  
  h2 {
    font-size: clamp(1.25rem, 5vw, 1.75rem) !important;
  }
  
  h3 {
    font-size: clamp(1.1rem, 4vw, 1.25rem) !important;
  }
  
  p {
    font-size: 0.9rem !important;
  }
  
  /* Tighter spacing */
  .container {
    padding: 0 0.75rem !important;
  }
  
  .section {
    padding: 2rem 0 !important;
  }
  
  .hero {
    padding: 4rem 0 2rem !important;
  }
  
  /* Smaller buttons */
  .btn {
    min-height: 40px !important;
    font-size: 14px !important;
    padding: 0.5rem 1rem !important;
  }
  
  /* Form improvements */
  .form-control, .text-field, .select-field {
    min-height: 44px !important;
    font-size: 16px !important;
    padding: 10px 12px !important;
  }
  
  /* Card spacing */
  .card {
    margin-bottom: 0.75rem !important;
  }
  
  .card-body {
    padding: 1rem !important;
  }
  
  /* Footer adjustments */
  .footer-content {
    gap: 1.5rem !important;
  }
  
  .footer-section h3 {
    font-size: 1.1rem !important;
  }
  
  .footer-section a {
    font-size: 0.9rem !important;
  }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .hero {
    padding: 3rem 0 2rem !important;
    min-height: 50vh !important;
  }
  
  .section {
    padding: 2rem 0 !important;
  }
  
  .navbar-menu {
    top: 60px;
  }
}

/* Tablet Styles */
@media (min-width: 769px) and (max-width: 1024px) {
  .container {
    padding: 0 2rem !important;
  }
  
  .hero {
    padding: 4rem 0 3rem !important;
  }
  
  .section {
    padding: 3rem 0 !important;
  }
  
  /* Grid adjustments for tablets */
  .col-md-6 {
    margin-bottom: 2rem !important;
  }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Ensure crisp text on high DPI displays */
  body {
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
  }
}

/* Print Styles */
@media print {
  .navbar, .footer, .btn, .mobile-menu-toggle {
    display: none !important;
  }
  
  .container {
    max-width: 100% !important;
    padding: 0 !important;
  }
  
  body {
    font-size: 12pt !important;
    line-height: 1.4 !important;
  }
  
  h1, h2, h3 {
    page-break-after: avoid !important;
  }
  
  p {
    orphans: 3 !important;
    widows: 3 !important;
  }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Dark Mode Mobile Adjustments */
@media (max-width: 768px) and (prefers-color-scheme: dark) {
  .navbar-menu {
    background: var(--bg-secondary, #1a1a1a) !important;
  }
  
  .card {
    background: var(--bg-card, rgba(255, 255, 255, 0.03)) !important;
  }
}

/* Light Mode Mobile Adjustments */
@media (max-width: 768px) and (prefers-color-scheme: light) {
  .navbar-menu {
    background: rgba(255, 255, 255, 0.95) !important;
    border-top: 1px solid rgba(0, 0, 0, 0.1) !important;
  }
  
  .navbar-link {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
  }
  
  .hamburger-line {
    background: var(--text-primary-light, #1a1a1a) !important;
  }
}
