/*=============== MOBILE HOME PAGE STYLES ===============*/
/* This file contains mobile-specific styles for the main home page */
/* Only applies to screens smaller than 768px */

@media screen and (max-width: 767px) {
  .header,
  .nav.container {
    display: none !important;
  }

  .home__container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100vw !important;
    max-width: 100vw !important;
    padding: 0 !important;
    margin: 0 !important;
    text-align: center !important;
    position: relative !important;
    z-index: 2 !important;
  }
  .home__data {
    z-index: 10 !important;
    position: relative !important;
    opacity: 1 !important;
    visibility: visible !important;
    color: #fff !important;
    background: transparent !important;
    width: 95vw !important;
    max-width: 500px !important;
    margin: 2rem auto 1.5rem auto !important;
    padding: 2rem 1rem 1.5rem 1rem !important;
    border-radius: 1.2rem !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }
  .home__subtitle,
  .home__title,
  .home__description {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
    color: #fff !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
  }
  .home__cards {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 1.2rem !important;
    width: 100vw !important;
    margin: 0 auto 2rem auto !important;
    padding: 0 2vw 1.5rem 2vw !important;
    box-sizing: border-box !important;
    z-index: 1 !important;
  }
  .home__card-link {
    flex: 0 0 80vw !important;
    max-width: 80vw !important;
    min-width: 80vw !important;
    scroll-snap-align: center !important;
    display: block !important;
    transition: transform 0.3s cubic-bezier(.4,1.3,.6,1);
  }
  .home__card {
    width: 100% !important;
    min-height: 180px !important;
    max-width: 420px !important;
    margin: 0 auto !important;
    border-radius: 1.2rem !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: center !important;
    position: relative !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.10);
    background: #222;
  }
  .home__card-title {
    font-size: 1.2rem !important;
    padding: 1rem !important;
    width: 100% !important;
    text-align: center !important;
    z-index: 2 !important;
  }
  /* Hide scrollbar for a clean look */
  .home__cards::-webkit-scrollbar {
    display: none !important;
  }
  .home__cards {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
  }
  
  /*========== HEADER & NAVIGATION MOBILE ==========*/
  .header {
    padding: 0 1rem;
  }
  
  .nav.container {
    padding: 0;
    width: 100%;
  }
  
  .overlay-logo {
    margin-right: 1rem !important;
  }
  
  .overlay-logo-img {
    width: 120px;
    height: auto;
  }
  
  .nav__menu {
    position: fixed;
    top: 0;
    right: -100%;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(20px);
    width: 100%;
    height: 100vh;
    padding: 6rem 2rem 2rem;
    transition: right 0.4s ease;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    z-index: 999;
  }
  
  .nav__menu.show-menu {
    right: 0;
  }
  
  .nav__list {
    flex-direction: column !important;
    gap: 2rem !important;
    margin: 0 !important;
    width: 100%;
  }
  
  .nav__item {
    width: 100%;
  }
  
  .nav__link {
    font-size: 1.2rem;
    font-weight: 600;
    padding: 1rem 0;
    display: block;
    width: 100%;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .nav__auth {
    margin-left: 0 !important;
    margin-top: 2rem;
    width: 100%;
    justify-content: center;
  }
  
  .nav__auth .auth-btn {
    width: 100%;
    max-width: 200px;
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }
  
  .user-profile {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    text-align: center;
  }
  
  .nav__toggle {
    display: block !important;
    font-size: 1.5rem;
    color: var(--title-color);
    cursor: pointer;
    z-index: 1000;
  }
  
  .nav__close {
    display: block !important;
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 1.5rem;
    color: var(--title-color);
    cursor: pointer;
  }
  
  /*========== HOME SECTION MOBILE ==========*/
  .home {
    min-height: 100vh;
    padding-top: 6rem;
  }
  
  .home__container {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 0 1rem;
  }
  
  .home__data {
    text-align: center;
    order: 1;
  }
  
  .home__subtitle {
    font-size: 1rem;
    margin-bottom: 1rem;
  }
  
  .home__title {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
  }
  
  .home__description {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    padding: 0 1rem;
  }
  
  .home__cards {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    order: 2;
  }
  
  .home__card {
    height: 200px;
    border-radius: 1rem;
  }
  
  .home__card-title {
    font-size: 1.3rem;
    padding: 1rem;
  }
  
  .button {
    width: 100%;
    max-width: 300px;
    padding: 1rem 2rem;
    font-size: 1rem;
    margin: 0 auto;
  }
  
  /*========== ABOUT SECTION MOBILE ==========*/
  .about {
    padding: 3rem 1rem;
  }
  
  .about__container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .about__data {
    order: 2;
    text-align: center;
  }
  
  .about__image {
    order: 1;
  }
  
  .about__description {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
  }
  
  .section__title {
    font-size: 2rem;
    margin-bottom: 1rem;
  }
  
  /*========== SRI LANKA MAP SECTION MOBILE ==========*/
  .srilanka-map {
    padding: 3rem 1rem;
  }
  
  .srilanka-map .container {
    flex-direction: column !important;
    align-items: center !important;
    width: 100vw !important;
    max-width: 100vw !important;
    padding: 0 !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
  }
  .map-wrapper {
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 100vw !important;
    aspect-ratio: 9/6 !important;
    position: relative !important;
    margin: 0 auto 2rem auto !important;
    overflow: visible !important;
    background: none !important;
    display: block !important;
  }
  .map-wrapper img {
    width: 100vw !important;
    height: auto !important;
    max-width: 100vw !important;
    display: block !important;
    border-radius: 1.2rem !important;
  }
  .map-marker {
    position: absolute !important;
    transform: translate(-50%, -50%) scale(0.85) !important;
    z-index: 2 !important;
    font-size: 0.9rem !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    padding: 0 !important;
    margin: 0 !important;
    /* Make sure marker is not clipped */
    overflow: visible !important;
  }
  .map-marker-label {
    font-size: 0.65rem !important;
    padding: 1px 4px !important;
    border-radius: 8px !important;
    background: rgba(0,0,0,0.6) !important;
    color: #fff !important;
    white-space: nowrap !important;
    z-index: 3 !important;
    pointer-events: none !important;
    position: absolute !important;
  }
  .label-right .map-marker-label {
    left: 110% !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
  }
  .label-left .map-marker-label {
    right: 110% !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
  }
  .label-top .map-marker-label {
    left: 50% !important;
    bottom: 110% !important;
    transform: translateX(-50%) !important;
  }
  .label-bottom .map-marker-label {
    left: 50% !important;
    top: 110% !important;
    transform: translateX(-50%) !important;
  }
  .map-dot {
    width: 22px !important;
    height: 30px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 24px !important;
    max-height: 32px !important;
  }
  .map-category-buttons {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    gap: 0.5rem !important;
    width: 100vw !important;
    max-width: 100vw !important;
    padding: 0.5rem 0.5rem 0.5rem 0.5rem !important;
    margin-bottom: 1rem !important;
    box-sizing: border-box !important;
    scrollbar-width: none !important;
  }
  .map-category-buttons::-webkit-scrollbar {
    display: none !important;
  }
  .map-category-btn {
    flex: 0 0 auto !important;
    font-size: 0.9rem !important;
    padding: 0.6rem 1rem !important;
    border-radius: 2rem !important;
    white-space: nowrap !important;
    margin: 0 0.2rem !important;
  }
  
  /*========== POPULAR SECTION MOBILE ==========*/
  .popular {
    padding: 3rem 1rem;
  }
  
  .popular__container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .popular__card {
    max-width: 350px;
    margin: 0 auto;
  }
  
  .popular__title {
    font-size: 1.3rem;
  }
  
  /*========== EXPLORE SECTION MOBILE ==========*/
  .explore {
    padding: 3rem 1rem;
  }
  
  .explore__container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .explore__content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .explore__data {
    text-align: center;
  }
  
  .explore__description {
    font-size: 1rem;
    line-height: 1.6;
  }
  
  .explore__user {
    justify-content: center;
    margin-top: 1rem;
  }
  
  /*========== JOIN SECTION MOBILE ==========*/
  .join {
    padding: 3rem 1rem;
  }
  
  .join__container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .join__data {
    order: 2;
    text-align: center;
  }
  
  .join__image {
    order: 1;
  }
  
  .join__description {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
  }
  
  .join__form {
    flex-direction: column;
    gap: 1rem;
  }
  
  .join__input {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
  }
  
  .join__button {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
  }
  
  /*========== FOOTER MOBILE ==========*/
  .footer {
    padding: 3rem 1rem 2rem;
  }
  
  .footer__container {
    gap: 2rem;
  }
  
  .footer__content {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  
  .footer__data {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .footer__title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
  }
  
  .footer__links {
    gap: 0.5rem;
  }
  
  .footer__group {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .footer__social {
    justify-content: center;
    gap: 1rem;
  }
  
  .footer__social-link {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
  
  /*========== WHATSAPP FLOATING BUTTON MOBILE ==========*/
  .whatsapp-float {
    bottom: 20px;
    right: 20px;
  }
  
  .whatsapp-button {
    width: 60px;
    height: 60px;
  }
  
  .whatsapp-icon {
    font-size: 1.8rem;
  }
  
  .whatsapp-tooltip {
    display: none;
  }
  
  /*========== MODAL MOBILE ==========*/
  .modal-content.glass-modal {
    min-width: 90vw;
    width: 95vw;
    padding: 2rem 1.5rem;
    margin: 1rem;
  }
  
  .modal-title {
    font-size: 1.8rem;
  }
  
  .google-btn {
    padding: 0.8rem 1rem;
    font-size: 1rem;
  }
  
  .form-input {
    padding: 0.8rem 1rem;
    font-size: 1rem;
  }
  
  .auth-btn {
    padding: 0.8rem 1rem;
    font-size: 1rem;
  }
  
  /*========== SCROLL UP BUTTON MOBILE ==========*/
  .scrollup {
    right: 1rem;
    bottom: 1rem;
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
  }
  
  /*========== UTILITY CLASSES MOBILE ==========*/
  .container {
    margin-inline: 1rem;
  }
  
  .section {
    padding-block: 3rem 1rem;
  }
  
  .grid {
    gap: 1rem;
  }
  
  /*========== MAP POPUP MOBILE ==========*/
  .map-popup {
    min-width: 200px;
    max-width: 90vw;
    padding: 1rem;
  }
  
  .map-popup-title {
    font-size: 1rem;
  }
  
  .map-popup-snippet {
    font-size: 0.9rem;
  }
  
  .map-popup-link {
    font-size: 0.9rem;
  }
  
  /*========== MAP CATEGORY BUTTONS CONTAINER ==========*/
  .map-category-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0 1rem;
  }
  
  .map-category-btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  
  /* Hide desktop-only elements on mobile */
  .desktop-only {
    display: none !important;
  }
  
  /* Show mobile category buttons container */
  .map-category-buttons {
    display: flex !important;
  }
}

/*========== EXTRA SMALL MOBILE DEVICES ==========*/
@media screen and (max-width: 480px) {
  
  .home__title {
    font-size: 2rem;
  }
  
  .home__subtitle {
    font-size: 0.9rem;
  }
  
  .home__description {
    font-size: 0.9rem;
    padding: 0 0.5rem;
  }
  
  .section__title {
    font-size: 1.8rem;
  }
  
  .home__card {
    height: 180px;
  }
  
  .home__card-title {
    font-size: 1.2rem;
  }
  
  .button {
    padding: 0.8rem 1.5rem;
    font-size: 0.9rem;
  }
  
  .nav__link {
    font-size: 1.1rem;
  }
  
  .nav__auth .auth-btn {
    padding: 0.8rem 1.2rem;
    font-size: 0.9rem;
  }
  
  .overlay-logo-img {
    width: 100px;
  }
  
  .whatsapp-button {
    width: 55px;
    height: 55px;
  }
  
  .whatsapp-icon {
    font-size: 1.6rem;
  }
  
  .modal-content.glass-modal {
    padding: 1.5rem 1rem;
  }
  
  .modal-title {
    font-size: 1.6rem;
  }
  
  .footer__social-link {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }
  
  .scrollup {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }
}

/*========== LANDSCAPE MOBILE ORIENTATION ==========*/
@media screen and (max-width: 767px) and (orientation: landscape) {
  
  .home {
    min-height: auto;
    padding-top: 5rem;
  }
  
  .home__container {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
  
  .home__cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .nav__menu {
    padding: 4rem 2rem 1rem;
  }
  
  .nav__list {
    gap: 1rem;
  }
  
  .nav__link {
    font-size: 1rem;
    padding: 0.5rem 0;
  }
  
  .about__container,
  .join__container {
    grid-template-columns: 1fr 1fr;
  }
  
  .popular__container {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .footer__data {
    grid-template-columns: repeat(2, 1fr);
  }
}

/*========== TABLET SPECIFIC STYLES ==========*/
@media screen and (min-width: 768px) and (max-width: 1023px) {
  
  .home__container {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  
  .home__cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  .home__title {
    font-size: 3rem;
  }
  
  .home__description {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 2rem;
  }
  
  .about__container,
  .join__container {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  
  .popular__container {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  .explore__content {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
  
  .footer__data {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
  
  .nav__menu {
    position: fixed;
    top: 0;
    right: -100%;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(20px);
    width: 300px;
    height: 100vh;
    padding: 6rem 2rem 2rem;
    transition: right 0.4s ease;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    z-index: 999;
  }
  
  .nav__menu.show-menu {
    right: 0;
  }
  
  .nav__list {
    flex-direction: column !important;
    gap: 1.5rem !important;
    margin: 0 !important;
    width: 100%;
  }
  
  .nav__toggle {
    display: block !important;
  }
  
  .nav__close {
    display: block !important;
  }
}

/*========== ACCESSIBILITY IMPROVEMENTS ==========*/
@media screen and (max-width: 767px) {
  
  /* Improve touch targets */
  .nav__link,
  .button,
  .auth-btn,
  .whatsapp-button,
  .scrollup {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Improve focus states */
  .nav__link:focus,
  .button:focus,
  .auth-btn:focus,
  .form-input:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
  }
  
  /* Improve text contrast */
  .home__description,
  .about__description,
  .explore__description,
  .join__description {
    color: rgba(255, 255, 255, 0.9);
  }
  
  /* Reduce motion for users who prefer it */
  @media (prefers-reduced-motion: reduce) {
    .home__card,
    .button,
    .nav__menu,
    .whatsapp-button {
      transition: none;
    }
  }
  
  /*========== PERFORMANCE OPTIMIZATIONS ==========*/
  /* Optimize for mobile performance */
  .home__bg {
    will-change: transform;
  }
  
  .home__card {
    will-change: transform;
  }
  
  /* Improve touch scrolling */
  .main {
    -webkit-overflow-scrolling: touch;
  }
  
  /* Optimize images for mobile */
  img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
  
  /*========== MOBILE-SPECIFIC INTERACTIONS ==========*/
  /* Improve button touch feedback */
  .button:active,
  .auth-btn:active,
  .nav__link:active {
    transform: scale(0.98);
  }
  
  /* Improve card touch feedback */
  .home__card:active {
    transform: scale(0.98);
  }
  
  /* Smooth scrolling for anchor links */
  html {
    scroll-behavior: smooth;
  }
  
  /* Prevent horizontal scroll */
  body {
    overflow-x: hidden;
  }
} 