/* Custom styles for mobile responsiveness and layout fixes */

/* 
   ROOT AND BODY SETUP
   Default: Allow scrolling (good for mobile)
*/
html,
body {
  height: 100% !important;
  overflow-y: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* 
   REACT ROOT FIX
*/
#root {
  min-height: 100vh !important;
  height: auto !important;
  width: 100% !important;
  overflow: visible !important;
}

/* 
   APP WRAPPER FIX
   Default: Scrollable column
*/
#root>div {
  overflow-y: visible !important;
  overflow-x: hidden !important;
  height: auto !important;
  min-height: 100vh !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  position: relative !important;
}

/* 
   HEADER FIX
*/
header {
  flex-shrink: 0 !important;
  position: relative !important;
  z-index: 50 !important;
  padding-top: 1.5rem !important;
  padding-bottom: 1.5rem !important;
  margin-bottom: 0 !important;
  background-color: transparent !important;
  min-height: 80px !important;
}

/* 
   MAIN CONTENT FIX
   Default: Column layout (mobile)
*/
main {
  flex: 1 0 auto !important;
  display: flex !important;
  flex-direction: column !important;
  padding-top: 3rem !important;
  padding-bottom: 8rem !important;
  margin-top: 0 !important;
  overflow: visible !important;
  height: auto !important;
  min-height: 0 !important;
}

/* 
   TEXT CONTAINER FIX
*/
main>div:first-child {
  justify-content: flex-start !important;
  padding-top: 2rem !important;
  flex: 0 0 auto !important;
}

/* 
   IMAGE CONTAINER FIX
*/
main>div:nth-child(2) {
  flex: 0 0 auto !important;
  display: flex !important;
  justify-content: center !important;
  padding-top: 2rem !important;
  padding-bottom: 2rem !important;
  opacity: 1 !important;
  visibility: visible !important;
  overflow: visible !important;
}

/* 
   SOCIAL ICONS REMOVAL
   Target the flex container with gap-4 which holds the icons.
   We use !important to override inline styles or Tailwind classes.
*/
.flex.gap-4 {
  display: none !important;
}

/* 
   FOOTER FIX
*/
footer {
  flex-shrink: 0 !important;
  margin-top: auto !important;
  padding-top: 2rem !important;
  padding-bottom: 2rem !important;
  position: relative !important;
  z-index: 50 !important;
  background-color: transparent !important;
}

/* 
   DESKTOP / HORIZONTAL MODE (No Scroll)
   Target screens larger than 1024px
*/
@media (min-width: 1024px) {

  /* Lock body and root to viewport height to prevent scrolling */
  html,
  body,
  #root,
  #root>div {
    height: 100vh !important;
    overflow: hidden !important;
  }

  /* Main content: Horizontal Layout */
  main {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding-top: 0 !important;
    padding-bottom: 8rem !important;
    /* Increased padding to clear footer */
    padding-left: 4rem !important;
    padding-right: 4rem !important;
    height: 100% !important;
  }

  /* Left Side: Text Data */
  main>div:first-child {
    width: 50% !important;
    padding-top: 0 !important;
    align-items: flex-start !important;
    text-align: left !important;
    /* Ensure internal content has space */
    padding-bottom: 2rem !important;
  }

  /* Right Side: Floating Image */
  main>div:nth-child(2) {
    width: 50% !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    justify-content: center !important;
    align-items: center !important;
  }

  /* Ensure image fits within the viewport */
  main>div:nth-child(2) img {
    max-height: 65vh !important;
    /* Reduced slightly to ensure fit */
    width: auto !important;
    object-fit: contain !important;
  }

  /* Footer adjustments for desktop */
  footer {
    position: absolute !important;
    bottom: 0 !important;
    width: 100% !important;
    padding-bottom: 1.5rem !important;
    height: auto !important;
  }
}

/* 
   MOBILE SPECIFIC ADJUSTMENTS
*/
@media (max-width: 768px) {

  html,
  body {
    font-size: 16px;
  }

  header {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }

  main {
    padding-top: 4rem !important;
  }

  main h1 {
    font-size: 2.5rem !important;
    line-height: 1.2 !important;
    margin-top: 1rem !important;
    margin-bottom: 1.5rem !important;
  }

  img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
  }
}