/* Premium Apps Section Redesign (Bento Box Layout) */

.apps-hero {
  background: var(--bg-snow);
  padding: 120px 0 80px;
  position: relative;
}

.connected-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: center;
}

.connected-content {
  padding-right: 2rem;
}

.connected-image-wrapper {
  position: relative;
}

.connected-image {
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.15);
  border: 4px solid white;
}

.apps-grid-section {
  padding: 6rem 0;
  background: var(--bg-cream);
  position: relative;
}

/* Bento Box Grid Setup */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2rem;
  margin-top: 4rem;
}

/* Base Card Styling */
.app-card {
  border-radius: 24px;
  padding: 3rem 2rem;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.stagger-container.visible .app-card {
  transform: translateY(0); /* Fix animation specificity */
}

.stagger-container.visible .app-card:hover {
  transform: translateY(-12px);
  z-index: 2;
}

/* Logo Wrapper */
.app-logo-wrapper {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  padding: 12px;
  background: var(--primary-light);
}

.app-card:nth-child(even) .app-logo-wrapper {
  background: var(--accent-light);
}
.app-logo-wrapper img {
  max-width: 100%;
  max-height: 100%;
}

.app-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.app-desc {
  font-size: 0.95rem;
  margin-bottom: 2rem;
  line-height: 1.5;
  opacity: 0.9;
}

/* 3D App Screenshot */
.app-screenshot {
  max-width: 100%;
  max-height: 250px;
  object-fit: contain;
  margin: 0 auto 2rem;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.15);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform: perspective(1000px) rotateX(0deg) rotateY(0deg) translateZ(0);
}

.stagger-container.visible .app-card:hover .app-screenshot {
  transform: perspective(1000px) rotateX(5deg) rotateY(-5deg) translateZ(20px) scale(1.05);
}

/* Base Play Store Button */
.play-store-btn {
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  margin-top: auto;
  font-size: 0.95rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.play-store-btn i {
  margin-right: 0.5rem;
  font-size: 1.1rem;
}


/* --- Card Themes (Floating White Cards) --- */

/* Base style overrides to match the clean feature card look */
.app-card {
  background: var(--bg-cream);
  color: var(--text-dark);
  border: 1px solid rgba(0,0,0,0.02);
  border-top: 4px solid var(--primary);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.stagger-container.visible .app-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
  border-color: rgba(0,0,0,0.02);
  border-top-color: var(--primary);
}

/* Alternate top border color */
.app-card:nth-child(even) {
  border-top-color: var(--accent);
}
.stagger-container.visible .app-card:nth-child(even):hover {
  border-top-color: var(--accent);
}

/* Fix text and button colors */
.app-card .app-title { color: var(--text-dark); }
.app-card .app-desc { color: var(--text-body); }
.app-card .play-store-btn {
  background: var(--bg-snow);
  color: var(--primary);
  border: 1px solid var(--border);
  box-shadow: none;
}
.app-card .play-store-btn:hover {
  background: var(--gradient-cta);
  color: white;
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.3);
}

/* Keep the grid sizing (Bento) but remove the hardcoded backgrounds */
.app-card.flagship-navy { grid-column: span 3; }
.app-card.flagship-coral { grid-column: span 3; }
.app-card.glass-light { grid-column: span 2; }


/* Responsive Layout */
@media (max-width: 992px) {
  .connected-grid { grid-template-columns: 1fr; text-align: center; }
  .connected-content { padding-right: 0; }
  .connected-content h1, .connected-content p { margin-left: auto; margin-right: auto; }
  .connected-content .flex { justify-content: center; }
  
  .app-card.flagship-navy,
  .app-card.flagship-coral,
  .app-card.glass-light {
    grid-column: span 6; /* Full width on mobile */
  }
}
@media (min-width: 993px) and (max-width: 1200px) {
  .app-card.glass-light { grid-column: span 3; /* 2 per row instead of 3 on medium screens */ }
  .app-card.glass-light:last-child { grid-column: span 6; /* full width for last item if orphaned */ }
}
