/* =====================================
   UI BASICS
   Common interface elements and controls
===================================== */
/* Language switcher dropdown styling */
#language-switcher {
  background: var(--color-language-switcher-bg);
  color: var(--color-text);
  border: 1px solid var(--color-language-switcher-border);
  border-radius: 4px;
  padding: 5px;
  cursor: pointer;
}

/* App Store button styles and hover effect */
.appstore-button {
  transition: transform 0.2s;
  width: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.appstore-button:hover {
  transform: scale(1.05);
}

/* Application name label */
.app-name {
  font-size: 1.2rem;
  color: #ddd;
  user-select: none;
  text-align: center;
  margin-bottom: 10px;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
  font-weight: 600;
}

/* Section-specific text alignment */
#contact-text {
  max-width: 600px;
  text-align: center;
}

/* =====================================
   Applications Grid
   Responsive grid layout for app cards
===================================== */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px 30px;
  width: 100%;
  max-width: var(--max-content-width);
  justify-items: center;
  margin-top: 20px;
}

/* =====================================
   App Item Card
   Card layout, hover effects, and image
===================================== */
.app-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: var(--app-item-max-width);
  background: linear-gradient(145deg, var(--color-app-item-bg-start), var(--color-app-item-bg-end));
  padding: 15px;
  border-radius: 32px 16px 32px 16px;
  box-sizing: border-box;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 8px 20px rgba(0,0,0,0.7);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  overflow: hidden;
  cursor: pointer;
}

/* Hover state for app cards */
.app-item:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 15px 30px rgba(255,255,255,0.15), inset 0 1px 0 rgba(255,255,255,0.2);
  background: linear-gradient(145deg, var(--color-app-item-hover-bg-start), var(--color-app-item-hover-bg-end));
  z-index: 10;
}

/* App card image */
.app-image {
  width: 70%;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  margin-bottom: 10px;
  flex-shrink: 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 5;
}

/* Image hover effect inside cards */
.app-item:hover .app-image {
  transform: scale(1.1);
  box-shadow: 0 10px 20px rgba(255,255,255,0.1);
}

/* Empty card placeholder */
.app-item.empty {
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}

/* Close button for cards (if applicable) */
.close-button {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
}

/* =====================================
   Hero Animation (Lottie)
===================================== */
.lottie-hero {
  width: 100%;
  max-width: 400px;
  height: auto;
  display: block;
}

/* =====================================
   Back Button
===================================== */
.back-button {
  display: inline-block;
  margin-bottom: 20px;
  padding: 8px 15px;
  font-size: 16px;
  cursor: pointer;
  background-color: var(--color-app-item-bg-start, #007aff);
  color: #fff;
  border: none;
  border-radius: 5px;
  user-select: none;
  transition: background-color 0.3s ease;
}
.back-button:hover {
  background-color: var(--color-app-item-hover-bg-start, #005bb5);
}

/* =====================================
   Full Image Display
===================================== */
.app-image-full {
  width: 100%;
  max-width: var(--max-content-width);
  height: auto;
  border-radius: 20px;
  margin: 20px auto;
  display: block;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.app-description {
  max-width: var(--max-content-width);
  margin: 0 auto 30px;
  padding: 0 20px;
  text-align: left;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
}

/* =====================================
   Header Row
===================================== */
.header-row {
  position: relative;
  height: 50px;
  display: flex;
  align-items: center;
}
.back-button {
  flex: 0 0 100px;
  margin: 0;
  z-index: 2;
}
.header-row h1 {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 3rem;
  user-select: none;
  font-weight: 600;
  pointer-events: none;
  white-space: nowrap;
  z-index: 1;
}

/* =====================================
   Footer
===================================== */
footer {
  color: #555;
  text-align: center;
  padding: 15px 10px;
  font-size: 14px;
}

/* =====================================
   "Back to Top" Button
===================================== */
#toTopBtn {
  display: none;
  position: fixed;
  bottom: 100px;
  right: 40px;
  z-index: 999;
  font-size: 18px;
  background-color: #303030;
  color: #b4b4b4;
  border: none;
  border-radius: 50%;
  padding: 12px 16px;
  cursor: pointer;
  transition: opacity 0.3s ease;
}
#toTopBtn:hover {
  background-color: #222;
  color: #fff;
}

/* =====================================
   About Section Layout
   Default two-column layout with responsive mobile adaptation
===================================== */
#about {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: var(--nav-height);
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: "text anim";
  gap: clamp(16px, 4vw, 40px);
  width: 100%;
  max-width: var(--max-content-width);
  align-items: start;
  justify-items: stretch;
}

.about-text-block {
  grid-area: text;
  width: 100%;
}
.about-animation-block {
  grid-area: anim;
  width: 100%;
  margin-top: 20px;
}

/* Mobile: stack text above animation */
@media (max-width: 900px) {
  .about-content {
    grid-template-columns: 1fr;
    grid-template-areas: "text" "anim";
    justify-items: center;
    gap: 20px;
  }
  .about-text-block,
  .about-animation-block {
    width: 100%;
    max-width: min(720px, 100%);
    margin: 0;
  }
  .about-animation-block {
    display: flex;
    justify-content: center;
  }
  .lottie-hero {
    display: block;
    width: auto;
    max-width: clamp(220px, 70vw, 340px);
    height: auto;
    margin: 0 auto;
  }
}
@media (max-width: 480px) {
  .lottie-hero {
    max-width: min(80vw, 320px);
  }
}