/* Reset and full-height */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  height: calc(var(--vh, 1vh) * 100);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Dynamic gradient background with smooth transitions */
body {
  background: linear-gradient(135deg, #1a1a1a, #000);
  transition: background 2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

body[data-theme="originalidea"] {
  background: linear-gradient(135deg, #1a1a1a, #000);
}

body[data-theme="marketing"] {
  background: linear-gradient(135deg, #053b20 0%, #047042 100%);
}

body[data-theme="impact"] {
  background: linear-gradient(135deg, #00614a 0%, #55a38b 100%);
}

body[data-theme="change"] {
  background: linear-gradient(135deg, #601A58 0%, #AC2E9E 100%);
}

body[data-theme="invent"] {
  background: linear-gradient(135deg, #1b053b 0%, #2f0470 100%);
}

/* Fullscreen liquid glass effect */
.liquid-card {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh; /* Dynamic viewport height for mobile browsers */
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(30px) saturate(150%);
  overflow: hidden;
}

/* Animated highlight "glint" */
.glint-effect {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 255, 255, 0.3),
    transparent 60%
  );
  filter: blur(60px);
  animation: glint 8s ease-in-out infinite alternate;
  pointer-events: none;
}

/* Different glint colors for themes */
body[data-theme="marketing"] .glint-effect,
body[data-theme="impact"] .glint-effect {
  background: radial-gradient(
    circle at 30% 30%,
    rgba(126, 227, 167, 0.3),
    transparent 60%
  );
}

body[data-theme="change"] .glint-effect,
body[data-theme="invent"] .glint-effect {
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 255, 255, 0.3),
    transparent 60%
  );
}

@keyframes glint {
  0%   { transform: translate(0%, 0%) scale(1); }
  50%  { transform: translate(20%, 10%) scale(1.1); }
  100% { transform: translate(40%, 30%) scale(1); }
}

/* Solutions container */
.solutions-container {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Solution cards */
.solution-card {
  position: absolute;
  width: 100%;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.solution-card.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Solution logo - Centered with rounded corners like original */
.solution-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  /* Centering transform - kept separate from animation */
  transform: translate(-50%, -50%);
  width: 40vmin;
  max-width: 300px;
  border-radius: 20%; /* iOS-style rounded corners */
  /* Only transition left position for UI show/hide, not transform */
  transition: left 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              max-width 0.8s cubic-bezier(0.4, 0, 0.2, 1),
              scale 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  /* Animation uses separate 'scale' property to avoid conflicting with centering transform */
  animation: logoBreath 8s ease-in-out infinite;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  object-fit: contain;
  display: block;
}

/* When UI is shown on desktop, move logo to left - keep same size */
@media (min-width: 769px) {
  body.show-ui .solution-logo {
    left: calc(50% - 250px);  /* Fixed distance from center */
    width: 40vmin;
    max-width: 300px;
  }
}

@keyframes logoBreath {
  0%, 100% { 
    scale: 1;
  }
  50% { 
    scale: 1.02;
  }
}

/* Solution content - Desktop: beside logo, Mobile: below logo */
.solution-content {
  position: absolute;
  color: white;
  opacity: 0;
  transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
  display: none;
  overflow-y: visible;
}

/* Desktop positioning - text to the right of logo */
@media (min-width: 769px) {
  .solution-content {
    left: calc(50% + 20px);  /* Fixed 20px gap from logo edge */
    right: 5%;
    top: 15%;
    bottom: 15%;
    transform: none;
    text-align: left;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding-top: 20px;
    padding-bottom: 20px;
  }
  
  /* Inner wrapper uses margin:auto for proper centering in flex container */
  /* This centers when content fits, and scrolls from top when it overflows */
  .solution-content .content-inner {
    margin-top: auto;
    margin-bottom: auto;
  }
  
  .solution-description {
    flex-shrink: 1;
  }
  
  .description-wrapper.expanded .solution-description {
    flex-shrink: 0;
    overflow-y: visible;
  }
}

body.show-ui .solution-card.active .solution-content {
  opacity: 1;
  display: block;
}

@media (min-width: 769px) {
  body.show-ui .solution-card.active .solution-content {
    display: flex;
  }
}

.solution-title {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  margin: 0 0 10px 0;
  line-height: 1.2;
  flex-shrink: 0; /* Prevent title from shrinking */
}

.solution-subtitle {
  font-size: clamp(0.9rem, 1.5vw, 1.1rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin: 0 0 15px 0;
  color: rgba(255, 255, 255, 0.7);
  flex-shrink: 0; /* Prevent subtitle from shrinking */
}

/* Description wrapper */
.description-wrapper {
  margin-bottom: 20px;
}

.solution-description {
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
  line-height: 1.6;
  font-weight: 300;
  margin: 0 0 5px 0;
  color: rgba(255, 255, 255, 0.85);
  padding-right: 20px;
  letter-spacing: 0.01em;
  position: relative;
  /* Use line-clamp to truncate at line boundaries, not mid-line */
  display: -webkit-box;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.description-wrapper.expanded .solution-description {
  -webkit-line-clamp: unset;
  line-clamp: unset;
  display: block;
  overflow-y: visible;
}

/* See more indicator - below the description */
.see-more {
  display: inline-block;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 0.9em;
  transition: color 0.3s ease;
  padding: 5px 0;
}

.see-more:hover {
  color: rgba(255, 255, 255, 1);
}

/* Format bullet points */
.solution-description ul {
  margin: 10px 0;
  padding-left: 20px;
  list-style: none;
}

.solution-description ul li {
  position: relative;
  padding-left: 15px;
  margin-bottom: 8px;
}

.solution-description ul li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: rgba(255, 255, 255, 0.5);
}

/* Invisible scrollbar */
.solution-description::-webkit-scrollbar {
  width: 4px;
}

.solution-description::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
}

.solution-description::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.solution-description::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Solution link - Truly transparent with white border only */
.solution-link {
  display: inline-flex;
  align-items: center;
  padding: 14px 35px;
  background: transparent !important;
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  transition: border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
              transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0; /* Prevent link from shrinking */
}


.solution-link:hover {
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Solution selector - Clean minimal design */
.solution-selector {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 25px;
  padding: 20px 30px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(30px) saturate(150%);
  border-radius: 30px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

body.show-ui .solution-selector {
  opacity: 1;
  visibility: visible;
}

/* Selector icons - Just the images with rounded corners */
.selector-icon {
  width: 80px;
  height: 80px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.selector-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 20%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  /* Reduce brightness and add slight tint to soften the white */
  filter: brightness(0.7) opacity(0.85);
}

.selector-icon:hover {
  transform: translateY(-5px) scale(1.1);
}

.selector-icon:hover img {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  filter: brightness(0.9) opacity(0.95);
}

.selector-icon.active {
  transform: scale(1.05);
}

.selector-icon.active img {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  filter: brightness(1) opacity(1);
}

/* Active indicator dot */
.selector-icon.active::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Smooth crossfade transitions between solutions */
.solution-card {
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.solution-card.fade-out {
  opacity: 0;
  visibility: visible;
  pointer-events: none;
}

.solution-card.fade-in {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  /* Fix iOS Safari viewport issues */
  .liquid-card {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    height: -webkit-fill-available; /* iOS Safari fix */
  }
  
  .solutions-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    height: -webkit-fill-available;
  }
  
  /* Center logo properly on mobile - initial state (no UI) */
  .solution-logo {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    width: 35vmin !important;
    max-width: 180px !important;
    height: 35vmin !important;
    max-height: 180px !important;
  }
  
  /* When UI shown on mobile - keep logo centered, text below */
  body.show-ui .solution-logo {
    position: fixed !important;
    top: 15% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    width: 25vmin !important;
    max-width: 120px !important;
    height: 25vmin !important;
    max-height: 120px !important;
  }
  
  /* Mobile content positioning - below logo */
  .solution-content {
    position: fixed !important;
    left: 5% !important;
    right: 5% !important;
    top: calc(20% + 15vmin) !important;
    bottom: 100px !important; /* Ensure space for selector icons */
    transform: none !important;
    text-align: center !important;
    overflow-y: auto !important;
    padding-bottom: 20px !important;
  }
  
  body.show-ui .solution-content {
    display: block !important;
  }
  
  .solution-title {
    font-size: 1.3rem;
  }
  
  .solution-subtitle {
    font-size: 0.9rem;
    margin-bottom: 10px;
  }
  
  .solution-description {
    font-size: 0.85rem;
    margin-bottom: 5px;
    line-height: 1.5;
    -webkit-line-clamp: 4;
    line-clamp: 4;
  }
  
  .description-wrapper.expanded .solution-description {
    -webkit-line-clamp: unset;
    line-clamp: unset;
    display: block;
    overflow-y: visible;
  }
  
  .description-wrapper {
    margin-bottom: 15px;
  }
  
  /* Center see more on mobile */
  .see-more {
    display: block;
    text-align: center;
  }
  
  .solution-link {
    padding: 10px 25px;
    font-size: 0.85rem;
  }
  
  .solution-selector {
    position: fixed;
    bottom: 0;
    padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 20px);
    gap: 8px;
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 10px;
  }
  
  .selector-icon {
    width: 45px;
    height: 45px;
  }
}

/* Landscape mode on mobile */
@media (max-width: 812px) and (orientation: landscape) {
  /* Initial centered logo in landscape */
  .solution-logo {
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
  }
  
  /* When UI shown in landscape - logo to left, text to right */
  body.show-ui .solution-logo {
    position: fixed !important;
    top: 50% !important;
    left: 15% !important;
    transform: translate(-50%, -50%) !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    width: 15vmin !important;
    max-width: 80px !important;
    height: 15vmin !important;
    max-height: 80px !important;
  }
  
  body.show-ui .solution-content {
    position: fixed !important;
    left: 30% !important;
    right: 5% !important;
    top: 10% !important;
    bottom: 80px !important;
    transform: none !important;
    text-align: left !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
  }
  
  .solution-description {
    font-size: 0.8rem;
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }
  
  .description-wrapper.expanded .solution-description {
    -webkit-line-clamp: unset;
    line-clamp: unset;
    display: block;
    overflow-y: visible;
  }
  
  /* Left-align "more" in landscape */
  .see-more {
    text-align: left;
  }
  
  .solution-selector {
    bottom: 0;
    padding-bottom: calc(env(safe-area-inset-bottom, 10px) + 5px);
    padding-top: 5px;
    padding-left: 10px;
    padding-right: 10px;
    gap: 6px;
  }
  
  .selector-icon {
    width: 35px;
    height: 35px;
  }
}