/* ============================================================
   ProductivityHub — Style iOS Home Screen pour le menu principal
   S'active SEULEMENT quand <html data-style="ios">.
   N'override PAS l'animation fadeInUp existante (.app-card opacity:0).
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ================  Fond — clair par défaut, sombre auto  ================ */
html[data-style="ios"] body {
  background: #f5f5f7 !important;
  background-attachment: fixed !important;
  color: #1d1d1f !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  min-height: 100vh;
}

html[data-style="ios"][data-theme="dark"] body {
  background: #1C1C1E !important;
  background-attachment: fixed !important;
  color: #ffffff !important;
}

/* ================  Conteneur global  ================ */
html[data-style="ios"] .app-container {
  max-width: 900px !important;
  padding: 40px 30px !important;
}

/* ================  Header  ================ */
html[data-style="ios"] header {
  padding: 30px 0 50px !important;
}

html[data-style="ios"] .main-title {
  font-size: 56px !important;
  font-weight: 700 !important;
  letter-spacing: -0.03em !important;
  color: #1d1d1f !important;
  text-shadow: none !important;
  margin-bottom: 10px !important;
  background: none !important;
  -webkit-text-fill-color: initial !important;
}

html[data-style="ios"][data-theme="dark"] .main-title {
  color: #ffffff !important;
  text-shadow: 0 4px 30px rgba(99, 102, 241, 0.5) !important;
}

html[data-style="ios"] .subtitle {
  font-size: 16px !important;
  color: rgba(0, 0, 0, 0.55) !important;
  font-weight: 400 !important;
}

html[data-style="ios"][data-theme="dark"] .subtitle {
  color: rgba(255, 255, 255, 0.65) !important;
}

/* ================  Grille des apps  ================ */
html[data-style="ios"] .app-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(140px, 160px)) !important;
  justify-content: center !important;
  gap: 40px 28px !important;
  padding: 30px 0 !important;
  margin: 0 auto !important;
  overflow: visible !important;
}

/* ================  Carte iOS  ================ */
/* IMPORTANT : on garde animation/opacity de style.css */
html[data-style="ios"] .app-card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 12px !important;
  overflow: visible !important;
  position: relative;
  /* transform et opacity gérés par l'animation existante */
}

html[data-style="ios"] .app-card:hover {
  transform: none !important;
}

/* ================  Icône = grosse tuile iOS  ================ */
html[data-style="ios"] .app-icon-container {
  width: 110px !important;
  height: 110px !important;
  margin: 0 !important;
  border-radius: 26px !important;
  /* Pas de fond impose ici : la couleur vient du catalogue (ou du choix
     d'Alexandre) et est posee en style inline par home.js. Un !important
     ici rendait TOUTES les icones bleues, quelle que soit l'app. */
  display: flex !important;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 8px 20px rgba(99, 102, 241, 0.35),
    inset 0 -3px 0 rgba(0, 0, 0, 0.12) !important;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease !important;
  cursor: pointer;
}

/* Couleur par app */

/* 5e carte (Notes) — orange grisé */

/* Hover icône — zoom léger iOS */
html[data-style="ios"] .app-card:hover .app-icon-container {
  transform: translateY(-6px) scale(1.05);
}

html[data-style="ios"] .app-card:active .app-icon-container {
  transform: scale(0.92);
  transition-duration: 0.1s !important;
}

/* Désactive le mousemove parallax de app.js — il pose des transforms inline */
html[data-style="ios"] .app-card:hover .app-icon {
  /* Note: app.js applique transform inline, on ne peut pas le neutraliser en CSS sans !important sur l'inline */
  /* La logique JS gère déjà le reset au mouseleave */
}

html[data-style="ios"] .app-icon {
  font-size: 50px !important;
  color: #ffffff !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  position: relative;
  z-index: 1;
}

html[data-style="ios"] .app-icon-vipro {
  font-size: 54px !important;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

/* ================  Nom de l'app sous l'icône  ================ */
html[data-style="ios"] .app-title {
  font-size: 14px !important;
  font-weight: 500 !important;
  color: #1d1d1f !important;
  margin: 0 !important;
  text-align: center;
  text-shadow: none;
  letter-spacing: -0.005em !important;
  line-height: 1.2 !important;
}

html[data-style="ios"][data-theme="dark"] .app-title {
  color: #ffffff !important;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* Masquer la description sur le style iOS (rend l'icône plus pure) */
html[data-style="ios"] .app-description {
  display: none !important;
}

/* ================  Bouton "Accéder" — devient l'icône cliquable  ================ */
html[data-style="ios"] .app-link {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 110px;
  opacity: 0 !important;
  z-index: 5;
  border-radius: 26px !important;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
}

/* "Bientôt disponible" (Notes = 5e carte) — icône grisée */

html[data-style="ios"] .app-link.disabled {
  cursor: not-allowed;
}

/* ================  Footer  ================ */
html[data-style="ios"] footer {
  margin-top: 60px !important;
  text-align: center;
  border-top: none !important;
}

html[data-style="ios"] footer p {
  color: rgba(0, 0, 0, 0.4) !important;
  font-size: 12px !important;
}

html[data-style="ios"][data-theme="dark"] footer p {
  color: rgba(255, 255, 255, 0.4) !important;
}

/* ================  Responsive  ================ */
@media (max-width: 640px) {
  html[data-style="ios"] .main-title { font-size: 38px !important; }
  html[data-style="ios"] .subtitle { font-size: 14px !important; }
  html[data-style="ios"] .app-icon-container {
    width: 90px !important;
    height: 90px !important;
    border-radius: 22px !important;
  }
  html[data-style="ios"] .app-link {
    width: 90px;
    height: 90px;
  }
  html[data-style="ios"] .app-icon { font-size: 40px !important; }
  html[data-style="ios"] .app-grid { gap: 28px 16px !important; }
}
