/* Mobile Responsive Styles for FOSSBilling Theme */

/* Base Mobile Styles */
@media (max-width: 767.98px) {
  /* Improve header spacing on mobile */
  header.mb-4 {
    margin-bottom: 1rem !important;
  }
  
  /* Enhance navbar on mobile */
  .navbar {
    padding: 0.5rem 1rem;
  }
  
  /* Improve mobile menu */
  .navbar-collapse {
    background-color: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    margin-top: 0.5rem;
  }
  
  /* Mobile menu items */
  .navbar-nav .nav-item {
    margin-bottom: 0.5rem;
    width: 100%;
  }
  
  /* Mobile buttons */
  .navbar-nav .btn {
    display: block;
    width: 100%;
    margin-bottom: 0.5rem;
    text-align: center;
  }
  
  /* Welcome banner on mobile */
  .welcome-banner {
    padding: 1rem;
    font-size: 0.9rem;
  }
  
  /* Card layouts on mobile */
  .card {
    margin-bottom: 1rem;
  }
  
  /* Improve form elements on mobile */
  input, select, textarea, .form-control {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
  }
  
  /* Better touch targets */
  .nav-link, .btn, a {
    padding: 0.5rem 0.75rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  
  /* Improve mobile footer */
  footer {
    text-align: center;
    padding: 1rem 0;
  }
  
  /* Account balance display on mobile */
  .account-balance {
    margin: 1rem 0;
  }
}

/* Small Mobile Devices */
@media (max-width: 575.98px) {
  /* Container padding adjustments */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Smaller headings on very small screens */
  h1, .h1 { font-size: 1.75rem; }
  h2, .h2 { font-size: 1.5rem; }
  h3, .h3 { font-size: 1.25rem; }
  
  /* Stack buttons on very small screens */
  .btn-group {
    flex-direction: column;
  }
  
  /* Adjust table display on small screens */
  table {
    display: block;
    overflow-x: auto;
  }
}

/* Medium devices (tablets) */
@media (min-width: 768px) and (max-width: 991.98px) {
  /* Sidebar adjustments for tablets */
  .sidebar {
    width: 25%;
  }
  
  .main-content {
    width: 75%;
  }
}

/* Mobile Navigation Drawer */
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 85%;
  height: 100%;
  background-color: #fff;
  z-index: 1050;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  overflow-y: auto;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
  padding: 1rem;
}

.mobile-nav-drawer.show {
  transform: translateX(0);
}

.mobile-nav-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1040;
  display: none;
}

.mobile-nav-backdrop.show {
  display: block;
}

/* Mobile-specific navigation */
@media (max-width: 767.98px) {
  .mobile-nav-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
  }
  
  /* Mobile login/logout buttons */
  .btn-logout, .btn-sign-up {
    width: 100%;
    margin: 0.5rem 0;
  }
  
  /* Mobile menu items */
  .mobile-nav-drawer .nav-item {
    margin-bottom: 0.75rem;
  }
  
  /* Mobile account balance */
  .mobile-nav-drawer .account-balance {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
  }
}

/* Fix for iOS input zoom */
@media screen and (-webkit-min-device-pixel-ratio: 0) { 
  select,
  textarea,
  input {
    font-size: 16px !important;
  }
}

/* Improved mobile touch targets */
.sidebar-icon {
  width: 24px;
  height: 24px;
  margin-right: 0.5rem;
}

/* Mobile-friendly buttons */
.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Mobile-friendly dropdown menus */
@media (max-width: 767.98px) {
  .dropdown-menu {
    width: 100%;
    margin-top: 0.25rem;
  }
  
  .dropdown-item {
    padding: 0.75rem 1rem;
  }
}
