*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Ensure html and body have no default margins/padding for connect layout */
html,
body {
  margin: 0;
  padding: 0;
}

/* For connect layout specifically, ensure no overflow on both html and body */
body.connect-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

body.connect-layout,
body.connect-layout html {
  height: 100vh;
  max-height: 100vh;
}

body,
h1,
h2,
h3,
h4,
p,
li,
figure,
figcaption,
blockquote,
dl,
dd {
  margin: 0;
  font-family: Inter, sans-serif;
  color: #ffffff;
}

a:hover {
  text-decoration: none;
}

body {
  scroll-behavior: smooth;
  text-rendering: optimizeSpeed;
  line-height: 1.5;
  background-color: #F1F5F9;
  background-image: asset-url("left-deco.png");
  background-repeat: no-repeat;
  background-position: bottom left;
  background-attachment: fixed;
}

/* Apply flex layout only to non-homepage layouts */
body:not(.homepage) {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* For connect layout, ensure proper flexbox behavior to prevent extra scrollable space */
body.connect-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-thumb {
  background: #64748B;
  width: 5px;
}

.right-deco,
.left-deco,
.right-mobile-deco,
.left-mobile-deco {
  position: absolute;
}

.right-deco,
.right-mobile-deco{
  top: 0;
  right: 0;
}

.left-deco,
.left-mobile-deco {
  left: 0;
  bottom: 0;
}

.left-mobile-deco,
.right-mobile-deco {
  display: none;
}

/* Header styles - exclude radioapp-connect-layout */
body:not(.radioapp-connect-layout) header {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 46px 40px;
  height: 40px;
}

header span {
  font-size: 20px;
  line-height: 24px;
  letter-spacing: 0.3px;
  color: #252F3D;
}

/* Header styling for admin and connect pages - overrides common_layout.css */
body:not(.homepage):not(.radioapp-connect-layout) header span {
  font-size: 20px;
  line-height: 20px;
  letter-spacing: -0.5px;
  color: #4A5568;
  font-weight: 500;
  margin-left: 0px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Ensure consistent header padding for admin and connect pages */
body:not(.homepage):not(.radioapp-connect-layout) header {
  padding: 46px 40px !important;
}

/* Specific override for connect layout to reduce top spacing */
body.connect-layout header {
  padding: 0px 40px 16px 40px !important;
}

/* Specific override for admin layout to reduce top spacing */
body:not(.homepage):not(.connect-layout) header {
  padding: 24px 40px 16px 40px !important;
}

/* Style main content for non-homepage layouts */
body:not(.homepage) main {
  position: relative;
  z-index: 5;
  display: flex;
  margin: 0;
  padding-top: 30px;
  align-items: flex-start;
  flex: 1;
  min-height: 0;
}

/* Reduce main content top padding for connect layout */
body.connect-layout main {
  padding-top: 0px;
}

/* Reduce main content top padding for admin layout */
body:not(.homepage):not(.connect-layout) main {
  padding-top: 0px;
}

/* Base main styling for all pages */
main {
  position: relative;
  z-index: 5;
}

input,
button,
textarea,
select {
  font: inherit;
}

.wrapper-with-arrow {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1280px;
  min-height: 100%;
  margin: 0 auto;
}

.back-arrow {
  position: absolute;
  top: 0;
  left: 40px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(40, 40, 47, 0.4);
  border-radius: 4px;
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
}

.back-arrow a {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-arrow:hover {
  cursor: pointer;
}

.container {
  width: 100%;
  max-width: 490px;
  padding: 0 20px;
  margin: 0 auto;
}

.title {
  font-weight: 800;
  font-size: 40px;
  line-height: 130%;
  letter-spacing: -2px;
  color: #252F3D;
}

.add-location-link {
  font-size: 15px;
  line-height: 150%;
  display: inline-block;
  margin-top: 24px;
  color: #E65660;
}

.locations-section {
  margin: 64px 0 16px;
}

.locations-section ul.locations-list {
  padding-left: 16px;
  max-height: 230px;
  overflow-y: scroll;
}

.locations-section ul.locations-list li{
  margin-bottom: 16px;
  color: #252F3D !important;
  opacity: 0.8 !important;
}

.locations-section ul.locations-list li a {
  font-size: 12px;
  line-height: 26px;
  text-decoration-line: underline;
  color: #28282F;
  display: inline-block;
  transform: translateY(-2px);
}

.success-wrapper {
  width: 88px;
  margin: 0 auto 32px;
}

.additional-info {
  margin-top: -8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 24px;
  color: #252F3D;
  opacity: 0.6;
}

/* New footer styles with no transparency */
footer {
  background-color: #393743 !important;
  width: 100% !important;
  padding: 20px 0 12px !important;
  margin: 0 !important;
  font-weight: 400 !important;
  font-size: 12px !important;
  line-height: 24px !important;
  color: white !important;
  text-align: center !important;
}

footer * {
  color: white !important;
}

/* Homepage-specific footer styling */
body.homepage footer {
  position: relative !important;
  padding-top: 20px !important;
  margin-top: 50px !important;
  clear: both !important;
}

/* Keep footer at the bottom for non-homepage layouts */
body:not(.homepage) footer {
  position: relative !important;
  margin-top: auto !important;
}

.footer-links {
  display: flex !important;
  justify-content: center !important;
  margin-top: 10px !important;
}

.footer-links > a {
  text-decoration: none !important;
  padding-bottom: 4px !important;
  border-bottom: 0.5px solid rgba(255, 255, 255, 0.5) !important;
  margin: 0 10px !important;
}

.footer-links > a:hover {
  border-bottom-color: white !important;
}

footer > .rights {
  padding-top: 10px !important;
}

@media screen and (min-height: 1300px) {
  footer > .rights {
    padding-top: 5px;
  }
}

@media screen and (max-width: 767px) {
  body {
    background-image: asset-url("left-mobile-deco.png");
  }

  .desktop-only {
    display: none;
  }

  .left-deco,
  .right-deco {
    display: none;
  }

  .left-mobile-deco,
  .right-mobile-deco {
    display: block;
  }

  .wrapper-with-arrow {
    padding: 0;
    flex-direction: column;
    gap: 40px;
    align-items: start;
  }

  .back-arrow {
    margin-left: 20px;
    position: static;
  }

  .back-arrow a {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .title {
    font-size: 35px;
  }

  .success-wrapper {
    width: 64px;
  }

  .additional-info {
    margin-bottom: 40px;
  }

  body:not(.homepage) .main {
    align-items: flex-start;
  }
  
  .cookies-warning {
    font-size: 12px;
  }

  .cookies-ok {
    font-size: 12px;
    padding: 6px 12px;
  }

  header {
    margin: 0; /* Fixed the margin issue */
  }

  body.homepage footer {
    margin-top: 30px;
    padding-top: 20px;
  }
  
  footer {
    padding: 15px 20px;
  }
  
  .footer-links {
    flex-wrap: wrap;
  }

  /* Additional styles for benefits list */
  body.homepage .benefits {
    text-align: left !important;
    padding-left: 20px !important; /* Add proper indentation for list items */
  }
  
  body.homepage .description,
  body.homepage .localize {
    text-align: left !important; /* Keep description and localization text left-aligned */
  }

  .homepage-main {
    padding: 0 15px !important;
    margin-bottom: 0 !important; /* Further reduced */
    gap: 0 !important; /* Remove gap in mobile view */
  }

  body.homepage .text-container {
    width: 100%;
    max-width: 100%;
    min-width: auto;
    padding: 0 !important; /* Remove padding */
    text-align: left !important;
    margin-bottom: 0 !important; /* Further reduced */
  }
  
  body.homepage .image-container {
    margin-top: 0 !important; /* Changed from -20px to 0 */
    margin-left: 0 !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    max-width: 100% !important;
    overflow: visible !important;
    height: auto !important; /* Allow height to adjust naturally */
    margin-bottom: 0 !important; /* Changed from -20px to 0 */
    padding: 0 !important; /* Remove all padding */
  }
  
  body.homepage .device {
    transform: scale(0.8) !important; /* Increased from 0.6 to 0.8 to make phone bigger */
    margin: 0 auto !important; /* Remove negative margins */
  }
  
  /* Reduce space after phone to minimize footer gap */
  body.homepage footer {
    margin-top: 5px !important; /* Further reduced */
    padding-top: 10px !important; /* Further reduced */
  }

  body.homepage .home-title {
    font-size: 28px !important;
    justify-content: space-between !important;
    margin-bottom: 25px !important; /* Increased from 15px to 25px to add more space after title */
    width: 100% !important;
  }
  
  body.homepage .app-buttons {
    justify-content: center !important; /* Changed from flex-start to center */
    width: 100% !important;
    display: flex !important;
  }

  /* Mobile-specific header padding for connect layout */
  body.connect-layout header {
    padding: 0px 20px 8px 20px !important;
  }

  /* Mobile-specific header padding for admin layout */
  body:not(.homepage):not(.connect-layout) header {
    padding: 16px 20px 8px 20px !important;
  }

  /* Mobile connect layout centering */
  body.connect-layout main {
    padding: 20px 0 !important;
  }

  body.connect-layout .container {
    padding: 0 15px !important;
    text-align: left !important;
  }
}

/* Add styles to prevent layout jumps during page load */
html {
  scroll-behavior: smooth;
}

/* Hide content while loading to prevent flash of unstyled content */
html.js-loading {
  visibility: hidden;
  opacity: 0;
}

/* When content is loaded, make it visible with a smooth fade */
html {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* Make sure the homepage main keeps its horizontal layout */
.homepage-main {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 64px !important;
  max-width: 1280px !important;
  padding: 40px 40px 0 !important;
  margin: 0 auto !important;
  position: relative !important;
  overflow: visible !important;
}

/* Ensure image container appears to the right on the homepage but partially in the dark side */
body.homepage .image-container {
  margin-top: -70px !important;
  position: relative !important;
  margin-left: 110px !important;
  overflow: hidden !important;
  height: 800px !important;
  margin-bottom: 0 !important;
  display: block !important;
}

@media screen and (max-width: 1440px) {
  body.homepage .image-container {
    margin-left: 104px !important;
  }
}

@media screen and (max-width: 1240px) {
  body.homepage .image-container {
    margin-left: 24px !important;
  }
}

@media screen and (max-width: 1000px) {
  .homepage-main {
    flex-direction: column-reverse !important;
    align-items: center !important;
    padding: 10px 20px 0 !important; /* Reduced from 20px to 10px */
    gap: 10px !important; /* Reduced from 20px to 10px */
  }
  
  body.homepage .image-container {
    margin: 0 auto !important; /* Reset all margins */
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 400px !important;
    padding: 0 !important; /* Remove all padding */
  }
  
  body.homepage .text-container {
    display: block !important;
    text-align: left !important;
    width: 100% !important;
  }
  
  body.homepage .app-buttons {
    justify-content: flex-start !important;
  }
}

/* Style the text container for homepage */
body.homepage .text-container {
  width: 100%;
  max-width: 450px;
  min-width: 450px;
}

@media screen and (max-width: 1000px) {
  body.homepage .text-container {
    max-width: 100%;
    min-width: auto;
  }
}

@media screen and (max-width: 767px) {
  .homepage-main {
    padding: 0 15px !important;
    margin-bottom: 0 !important; /* Further reduced */
    gap: 0 !important; /* Remove gap in mobile view */
  }

  body.homepage .text-container {
    width: 100%;
    max-width: 100%;
    min-width: auto;
    padding: 0 !important; /* Remove padding */
    text-align: left !important;
    margin-bottom: 0 !important; /* Further reduced */
  }
  
  body.homepage .image-container {
    margin-top: 0 !important; /* Changed from -20px to 0 */
    margin-left: 0 !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    max-width: 100% !important;
    overflow: visible !important;
    height: auto !important; /* Allow height to adjust naturally */
    margin-bottom: 0 !important; /* Changed from -20px to 0 */
    padding: 0 !important; /* Remove all padding */
  }
  
  body.homepage .device {
    transform: scale(0.8) !important; /* Increased from 0.6 to 0.8 to make phone bigger */
    margin: 0 auto !important; /* Remove negative margins */
  }
  
  body.homepage .home-title {
    font-size: 28px !important;
    justify-content: space-between !important;
    margin-bottom: 25px !important; /* Increased from 15px to 25px to add more space after title */
    width: 100% !important;
  }
  
  body.homepage .home-title div {
    flex: 1 !important;
    text-align: left !important;
  }
  
  body.homepage .description {
    margin-bottom: 10px !important;
    text-align: left !important;
  }
  
  body.homepage .benefits {
    text-align: left !important;
    padding-left: 20px !important;
    margin-top: 10px !important;
    margin-bottom: 10px !important;
    gap: 5px !important;
  }
  
  body.homepage .localize {
    margin: 10px 0 30px !important;
    text-align: left !important;
  }
  
  body.homepage footer {
    margin-top: 5px !important; /* Further reduced */
    padding-top: 10px !important; /* Further reduced */
  }

  body.homepage .app-buttons {
    justify-content: center !important; /* Changed from flex-start to center */
    width: 100% !important;
    display: flex !important;
  }
}

/* Ensure the featured badge stays on the right in all viewports */
body.homepage .home-title img {
  margin-left: auto !important; /* Push to the right */
}

/* Make sure the loading styles don't interfere with layout */
html.js-loading body.homepage {
  min-height: 100vh;
}

/* Ensure the main content is properly contained */
body.homepage .content-clearfix {
  clear: both;
  height: 1px;
  overflow: hidden;
  margin-top: -1px;
}

/* Ensure content wrapper has minimum height */
.content-wrapper {
  min-height: 80vh;
}

.desktop-only {
  display: flex;
  align-items: center; 
}

.cookies-warning {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #2D3B48;
  color: #ffffff;
  padding: 10px;
  text-align: center;
  z-index: 9999;
}

.cookies-ok {
  background-color: #3BB273;
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 10px;
}

.cookies-ok:hover {
  background-color: #349F69;
}

.header-logo {
  margin-right: 10px;
  margin-top: -2px;
  width: 18px;
  height: auto;
  max-width: 100%;
  display: block;
}

/* Add proper background styling for the homepage to ensure dark/light contrast */
body.homepage {
  position: relative;
}

body.homepage:before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 40%; /* Match the original width in main.css */
  background-color: #fff;
  z-index: -1;
}

/* Adjust width at different breakpoints to match original */
@media screen and (min-width: 2000px) {
  body.homepage:before {
    width: 44%;
  }
}

@media screen and (max-width: 1160px) {
  body.homepage:before {
    width: 44%;
  }
}

@media screen and (max-width: 1000px) {
  body.homepage:before {
    display: none;
  }
}

/* Fix home-title layout to have featured image on the right */
body.homepage .home-title {
  margin-bottom: 62px !important;
  display: flex !important;
  justify-content: space-between !important; /* This ensures the items are at opposite ends */
  width: 100% !important; /* Ensure the container takes full width */
  font-family: "Inter", sans-serif !important;
  font-weight: 800 !important;
  font-size: 40px !important;
  line-height: 52px !important;
  position: relative !important;
  letter-spacing: -2px !important;
  z-index: 5 !important;
}

/* Ensure the featured badge stays on the right in all viewports */
body.homepage .home-title img {
  margin-left: auto !important; /* Push to the right */
}

@media screen and (max-width: 767px) {
  body.homepage .home-title {
    font-size: 28px !important;
    justify-content: space-between !important;
    margin-bottom: 25px !important; /* Increased from 15px to 25px to add more space after title */
    width: 100% !important;
  }
  
  /* Additional styles for better mobile display of title */
  body.homepage .home-title div {
    flex: 1 !important; /* Take available space */
    text-align: left !important;
  }

  body.homepage .app-buttons {
    justify-content: center !important; /* Changed from flex-start to center */
    width: 100% !important;
    display: flex !important;
  }
}

/* Style for the new subtitle */
.subtitle {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 20px 0;
  opacity: 0.9;
  letter-spacing: -0.5px;
}

@media screen and (max-width: 767px) {
  body.homepage .subtitle {
    font-size: 20px !important;
    font-weight: 600 !important;
    margin-bottom: 15px !important;
    text-align: left !important;
  }
}

/* Make feature titles stand out */
.benefits li strong {
  font-weight: 700;
  color: #fff; /* Brighter white for contrast */
}

@media screen and (max-width: 767px) {
  /* Ensure feature titles stand out on mobile too */
  body.homepage .benefits li strong {
    font-weight: 700 !important;
    display: inline-block !important;
    color: #fff !important;
    margin-bottom: 2px !important;
  }
}

/* Toast notification */
.toast-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.toast {
  background-color: rgba(59, 178, 115, 0.95);
  color: white;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 16px;
  max-width: 90%;
  text-align: center;
  animation: toast-in-out 3s ease-in-out forwards;
  pointer-events: none;
}

.toast.error {
  background-color: rgba(220, 53, 69, 0.95);
}

@keyframes toast-in-out {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  10% {
    opacity: 1;
    transform: translateY(0);
  }
  90% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-20px);
  }
}

/* Loading Spinner */
.loading-spinner {
  display: inline-block;
  position: relative;
  width: 40px;
  height: 40px;
}

.loading-spinner:after {
  content: " ";
  display: block;
  width: 30px;
  height: 30px;
  margin: 5px;
  border-radius: 50%;
  border: 3px solid #252F3D;
  border-color: #252F3D transparent #252F3D transparent;
  animation: spinner 1.2s linear infinite;
}

.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.7);
  z-index: 999;
}

@keyframes spinner {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Ensure connect layout container is properly centered */
body.connect-layout .container {
  width: 100%;
  max-width: 490px;
  padding: 0 20px;
  margin: 0 auto;
  text-align: left;
}

/* Content wrapper for connect layout - matches admin layout approach */
body.connect-layout .content-wrapper {
  flex: 1 0 auto;
  position: relative;
  z-index: 1;
  padding-top: 2rem;
}
