/* ==========================================================================
   MOBILE-APP NAVIGATION & RESPONSIVE STANDARD
   For: Sou. Aishwarya Abhijit Pacharne Website
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Compact 4-Line Hamburger Menu Button
   -------------------------------------------------------------------------- */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3.5px;
  width: 44px;
  height: 44px;
  padding: 8px;
  border: 1px solid rgba(6, 27, 58, 0.16);
  border-radius: 10px;
  background: #FFFFFF;
  color: var(--navy, #061B3A);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(6, 27, 58, 0.06);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  z-index: 101;
}

.menu-toggle:active {
  transform: scale(0.94);
  background: rgba(6, 27, 58, 0.04);
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background-color: currentColor;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, width 0.2s ease;
  transform-origin: center;
}

/* 4-Line Hamburger Animation when Open */
.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(5.5px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  opacity: 0;
  transform: scaleX(0);
}
.menu-toggle[aria-expanded="true"] span:nth-child(4) {
  transform: translateY(-5.5px) rotate(-45deg);
}

@media (max-width: 920px) {
  .menu-toggle {
    display: inline-flex;
  }
}

/* --------------------------------------------------------------------------
   2. Fixed 5-Item Mobile Bottom Navigation Bar
   -------------------------------------------------------------------------- */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  /* Safe spacing at page bottom so fixed bar never obscures content */
  body.has-bottom-nav {
    padding-bottom: calc(66px + env(safe-area-inset-bottom, 10px)) !important;
  }

  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid rgba(6, 27, 58, 0.12);
    box-shadow: 0 -4px 24px rgba(6, 27, 58, 0.09);
    padding-top: 4px;
    padding-bottom: env(safe-area-inset-bottom, 8px);
    transition: transform 0.25s ease, opacity 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
  }

  /* Automatically hide when virtual keyboard is active */
  .mobile-bottom-nav.is-keyboard-hidden {
    transform: translateY(105%);
    opacity: 0;
    pointer-events: none;
  }

  .bottom-nav-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 4px 2px 2px;
    text-decoration: none;
    color: #5E6878;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    border-radius: 8px;
    transition: color 0.18s ease, transform 0.12s ease;
    -webkit-tap-highlight-color: transparent;
    position: relative;
  }

  .bottom-nav-item:active {
    transform: scale(0.92);
  }

  .bottom-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-bottom: 2px;
    border-radius: 50%;
    transition: all 0.2s ease;
  }

  .bottom-nav-icon svg {
    width: 20px;
    height: 20px;
    transition: stroke 0.2s ease, transform 0.2s ease;
  }

  .bottom-nav-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-family: "Noto Sans Devanagari", "Inter", system-ui, sans-serif;
  }

  /* Active state indicator */
  .bottom-nav-item.is-active {
    color: var(--saffron, #F26A21);
    font-weight: 800;
  }

  .bottom-nav-item.is-active .bottom-nav-icon {
    background: rgba(242, 106, 33, 0.12);
  }

  .bottom-nav-item.is-active .bottom-nav-icon svg {
    stroke: var(--saffron, #F26A21);
    transform: scale(1.08);
  }

  .bottom-nav-item.is-active::after {
    content: "";
    position: absolute;
    top: -4px;
    left: 25%;
    right: 25%;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--saffron, #F26A21);
  }

  /* Distinctive Emergency / आणीबाणी button */
  .bottom-nav-item--emergency {
    color: #C0260B;
  }

  .bottom-nav-item--emergency .bottom-nav-icon {
    background: rgba(192, 38, 11, 0.08);
  }

  .bottom-nav-item--emergency .bottom-nav-icon svg {
    stroke: #C0260B;
  }

  .bottom-nav-item--emergency.is-active {
    color: #C0260B;
  }

  .bottom-nav-item--emergency.is-active .bottom-nav-icon {
    background: #C0260B;
  }

  .bottom-nav-item--emergency.is-active .bottom-nav-icon svg {
    stroke: #FFFFFF;
  }

  .bottom-nav-item--emergency.is-active::after {
    background: #C0260B;
  }
}

/* Landscape orientation optimization */
@media (max-width: 920px) and (orientation: landscape) and (max-height: 500px) {
  body.has-bottom-nav {
    padding-bottom: 50px !important;
  }
  .mobile-bottom-nav {
    padding-top: 2px;
    padding-bottom: env(safe-area-inset-bottom, 2px);
  }
  .bottom-nav-item {
    min-height: 44px;
    padding: 2px 2px;
    font-size: 0.62rem;
  }
  .bottom-nav-icon {
    width: 22px;
    height: 22px;
    margin-bottom: 1px;
  }
  .bottom-nav-icon svg {
    width: 16px;
    height: 16px;
  }
}

/* Desktop: absolutely ensure bottom nav is completely hidden */
@media (min-width: 769px) {
  .mobile-bottom-nav {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   3. Mobile Drawer & Header Modernization
   -------------------------------------------------------------------------- */
@media (max-width: 920px) {
  .nav__links {
    box-shadow: 0 16px 40px rgba(6, 27, 58, 0.16) !important;
    border: 1px solid rgba(6, 27, 58, 0.14) !important;
    border-radius: 14px !important;
    padding: 14px !important;
    background: #FFFFFF !important;
  }
  .nav__links a {
    min-height: 44px !important;
    font-size: 1rem !important;
    padding: 8px 14px !important;
    border-radius: 8px !important;
  }
}

/* --------------------------------------------------------------------------
   4. Emergency Section / Page Components
   -------------------------------------------------------------------------- */
.emergency-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.emergency-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  background: #FFFFFF;
  border: 1.5px solid rgba(6, 27, 58, 0.12);
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(6, 27, 58, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.emergency-card:hover {
  border-color: #F26A21;
  box-shadow: 0 8px 24px rgba(242, 106, 33, 0.12);
  transform: translateY(-2px);
}

.emergency-card__info {
  flex: 1 1 auto;
  min-width: 0;
}

.emergency-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #C0260B;
  background: rgba(192, 38, 11, 0.08);
  padding: 3px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
}

.emergency-card__title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy, #061B3A);
  line-height: 1.35;
}

.emergency-card__desc {
  margin: 0;
  font-size: 0.82rem;
  color: #5E6878;
  line-height: 1.4;
}

.emergency-card__call-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 10px 16px;
  background: #1F8A3B;
  color: #FFFFFF !important;
  font-size: 1.1rem;
  font-weight: 900;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(31, 138, 59, 0.28);
  transition: background 0.2s ease, transform 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.emergency-card__call-btn:hover {
  background: #176B2E;
}

.emergency-card__call-btn:active {
  transform: scale(0.95);
}

.emergency-card__call-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.emergency-banner {
  background: linear-gradient(135deg, #FFF1F0 0%, #FFF8EF 100%);
  border: 1.5px solid rgba(192, 38, 11, 0.2);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
}

.emergency-banner h2 {
  color: #C0260B;
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.4rem;
}

.emergency-banner p {
  margin: 0;
  color: #4A5568;
  font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   5. Attachment Control (Camera / Gallery / File Selection)
   -------------------------------------------------------------------------- */
.attachment-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attachment-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.attachment-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: 10px;
  border: 1.5px solid rgba(6, 27, 58, 0.16);
  background: #FFFFFF;
  color: #061B3A;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(6, 27, 58, 0.05);
  transition: all 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.attachment-action-btn:hover {
  border-color: #F26A21;
  background: #FFF9F5;
  color: #F26A21;
}

.attachment-action-btn:active {
  transform: scale(0.96);
}

.attachment-action-btn--camera {
  border-color: #F26A21;
  background: rgba(242, 106, 33, 0.08);
  color: #D35400;
}

.attachment-action-btn--camera:hover {
  background: rgba(242, 106, 33, 0.16);
  color: #C0392B;
}

.attachment-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid #D7DFE9;
  border-radius: 8px;
  background: #F8FAFC;
}

.preview-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.preview-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(6, 27, 58, 0.12);
}

.preview-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.preview-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: #061B3A;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-size {
  font-size: 0.76rem;
  color: #5E6878;
}

.preview-remove-btn {
  padding: 4px 10px;
  border: 1px solid rgba(192, 38, 11, 0.2);
  border-radius: 6px;
  background: #FFF1F0;
  color: #C0260B;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.preview-remove-btn:hover {
  background: #C0260B;
  color: #FFFFFF;
}

.attachment-hint {
  color: #5E6878;
  font-size: 0.8rem;
  line-height: 1.35;
}

/* --------------------------------------------------------------------------
   6. Mobile-First Suggestion Page Optimization
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .page-contact .page-hero {
    padding: 14px 0 4px !important;
  }
  .page-contact .page-hero .hero-card {
    display: none !important;
  }
  .page-contact .page-hero h1 {
    font-size: 1.55rem !important;
    margin-bottom: 2px !important;
  }
  .page-contact .page-hero .lead {
    font-size: 0.86rem !important;
    margin-bottom: 6px !important;
    line-height: 1.35 !important;
  }
  .page-contact .page-hero .label {
    display: none !important;
  }
  .page-contact .section {
    padding: 6px 0 28px !important;
  }
  .page-contact .grid.two {
    gap: 16px !important;
  }
}

