/**
 * Mobile Layout Styles
 * Responsive mobile-first design for consumer/public views
 */

/* ============================================
   BASE MOBILE STYLES
   ============================================ */

body.mobile {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bs-body-bg);
  min-height: 100vh;
  overflow-x: hidden;
  margin: 0 auto;
  scroll-behavior: smooth;
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  body.mobile {
    scroll-behavior: auto;
  }

  .mobile-services .service-card,
  .mobile .notification-icon,
  .mobile .service-card,
  .mobile .service-dashbaordicon,
  .mobile .service-icon,
  .mobile .service-title {
    animation: none !important;
    transition: none !important;
  }
}

body.mobile [class*="col-"] {
  flex: 0 0 100% !important;
  max-width: 100% !important;
}

/* ============================================
   MOBILE CONTAINER
   ============================================ */

.mobile-container {
  max-width: 450px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
}

/* ============================================
   HEADER SECTION
   ============================================ */

.mobile-header {
  background: var(--wg-gradient);
  color: white;
  position: relative;
  overflow: hidden;
}

/* ============================================
   USER GREETING
   ============================================ */

.mobile .user-greeting {
  display: flex;
  align-items: center;
  margin-bottom: 25px;
  position: relative;
  z-index: 2;
}

.mobile .user-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

  .mobile .user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

.mobile-profile-initial {
  font-weight: 600;
  font-size: 1.3rem;
  text-transform: uppercase;
}

.mobile .greeting-text {
  flex: 1;
}

  .mobile .greeting-text h6 {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
    font-weight: 400;
  }

  .mobile .greeting-text h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
  }

/* ============================================
   NOTIFICATION ICON
   ============================================ */

.mobile .notification-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  /* Accessibility: Ensure minimum touch target */
  min-width: 44px;
  min-height: 44px;
}

  .mobile .notification-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
  }

  /* Accessibility: Focus state for keyboard navigation */
  .mobile .notification-icon:focus {
    outline: 2px solid white;
    outline-offset: 2px;
    background: rgba(255, 255, 255, 0.3);
  }

  .mobile .notification-icon:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
  }

.mobile .notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: green;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: white;
  border: 2px solid white;
}

/* ============================================
   WELCOME SECTION
   ============================================ */

.mobile .welcome-section {
  position: relative;
  z-index: 2;
}

.mobile .welcome-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 0.89rem;
  line-height: 1.2;
}

.mobile .welcome-subtitle {
  font-size: 14px;
  opacity: 0.9;
  line-height: 1.4;
  font-weight: 300;
}

/* ============================================
   SERVICES GRID
   ============================================ */

.mobile .services-container {
  padding: 20px 15px 30px;
}

.mobile-services .services-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 8px;
  max-width: 320px;
  margin: 0 auto;
}

.mobile .service-card .card-body {
  padding: 0.45rem !important;
}

.mobile-services .service-card {
  background-color: transparent;
  color: var(--bs-body-color);
  border-radius: 16px;
  padding: 5px 2px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.mobile .service-card {
  text-align: center;
}

  /* Accessibility: Focus state for service cards */
  .mobile .service-card:focus,
  .mobile .service-card:focus-within {
    outline: 2px solid var(--wg-primary, #0d6efd);
    outline-offset: 2px;
  }

  .mobile .service-card a:focus {
    outline: none;
  }

  .mobile .service-card a:focus-visible {
    outline: 2px solid var(--wg-primary, #0d6efd);
    outline-offset: 2px;
    border-radius: 8px;
  }

/* ============================================
   SERVICE ICONS
   ============================================ */

.mobile .service-icon {
  margin: 0 auto 12px !important;
}

.mobile-services .service-icon {
  width: var(--icon-size);
  height: var(--icon-size);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  font-size: 24px;
  box-shadow: var(--wg-shadow);
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
  overflow: hidden;
}

  /* Font icon scaling */
  .mobile-services .service-icon i {
    font-size: calc(var(--icon-size) * 0.45);
  }

.mobile .service-dashbaordicon {
  width: 45px;
  height: 45px;
  display: flex;
  border: 2px solid var(--bs-icon-bg);
  align-items: center;
  justify-content: center;
  color: var(--theme-primary);
  font-size: 24px;
  box-shadow: var(--wg-shadow);
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
}

.service-dashbaordicon.square-shape {
  border-radius: var(--bs-border-radius-rounded) !important;
}

.service-dashbaordicon.rounded-shape {
  border-radius: var(--bs-border-radius-circle) !important;
}

/* ============================================
   SERVICE CARD HOVER STATES
   ============================================ */

.mobile .service-card:hover .service-dashbaordicon {
  background-color: var(--theme-primary-hover, #e9ecef);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  transition: background-color 0.3s ease, border-radius 0.3s ease;
}

  .mobile .service-card:hover .service-dashbaordicon i {
    color: var(--bs-icon-color);
  }

.mobile .service-card:hover .service-icon {
  box-shadow: var(--wg-shadow-hover);
}

.mobile .service-card:hover .service-title {
  color: var(--wg-primary) !important;
}

/* ============================================
   SERVICE TITLE
   ============================================ */

.mobile .service-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--bs-body-color);
  margin: 0;
  position: relative;
  z-index: 2;
  transition: color 0.3s ease;
}

/* ============================================
   ANIMATIONS
   ============================================ */

/* Float animation for decorative elements */
@keyframes float {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }

  50% {
    transform: translate(-20px, -10px) rotate(2deg);
  }
}

/* Loading pulse animation */
.mobile-services .service-card.loading .service-icon {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

/* Staggered slide-in animation for service cards */
.mobile-services .service-card {
  animation: slideInUp 0.6s ease forwards;
  opacity: 0;
  transform: translateY(30px);
}

  .mobile-services .service-card:nth-child(1) {
    animation-delay: 0.1s;
  }

  .mobile-services .service-card:nth-child(2) {
    animation-delay: 0.2s;
  }

  .mobile-services .service-card:nth-child(3) {
    animation-delay: 0.3s;
  }

  .mobile-services .service-card:nth-child(4) {
    animation-delay: 0.4s;
  }

  .mobile-services .service-card:nth-child(5) {
    animation-delay: 0.5s;
  }

  .mobile-services .service-card:nth-child(6) {
    animation-delay: 0.6s;
  }

  .mobile-services .service-card:nth-child(7) {
    animation-delay: 0.7s;
  }

  .mobile-services .service-card:nth-child(8) {
    animation-delay: 0.8s;
  }

@keyframes slideInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* ============================================
   AUTH BUTTONS
   ============================================ */

.auth-buttons {
  font-size: 1.2rem;
  font-weight: 600;
}

  .auth-buttons a {
    color: var(--wg-primary) !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0 10px;
    transition: var(--transition);
    padding: 5px 10px;
    border-radius: 2px;
    border-bottom: 2px solid transparent;
  }

    .auth-buttons a:hover {
      border-bottom-color: var(--wg-primary);
    }

    /* Accessibility: Focus state for auth buttons */
    .auth-buttons a:focus {
      outline: 2px solid var(--wg-primary);
      outline-offset: 2px;
      border-radius: 4px;
    }

    .auth-buttons a:focus-visible {
      outline: 2px solid var(--wg-primary);
      outline-offset: 2px;
    }

/* ============================================
   PAGE LOADER - DARK THEME
   ============================================ */

[data-bs-theme="dark"] #pageLoader {
  background: rgba(33, 37, 41, 0.95);
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/* Small mobile screens */
@media (max-width: 375px) {
  :root {
    --icon-size: 55px;
  }

  .mobile .service-title {
    font-size: 14px;
  }

  .brand-logo img {
    height: 70px;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .mobile .service-card {
    border: 2px solid currentColor;
  }

  .mobile .notification-badge {
    border-width: 3px;
  }

  .auth-buttons a {
    text-decoration: underline;
  }
}

/* Print styles */
@media print {
  .mobile .notification-icon,
  .mobile-header,
  .auth-buttons {
    display: none !important;
  }

  .mobile-services .service-card {
    animation: none;
    opacity: 1;
    transform: none;
    break-inside: avoid;
  }
}
