/**
 * Styles cosmiques pour l'interface étudiants My Study Space
 * (alignés sur l'app React d'origine)
 */

.mystudyspace-students-wrapper {
  font-family: 'Inter', sans-serif;
  background-color: #020617;
  color: #f8fafc;
  overflow-x: clip;
  min-height: 100vh;
  position: relative;
}

/* Starfield - conteneur dans la page shortcode */
.mystudyspace-students-wrapper .stars-container.mystudyspace-stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
  overflow: hidden;
  pointer-events: none;
}

.mystudyspace-students-wrapper .star {
  position: absolute;
  background: white;
  border-radius: 50%;
  opacity: 0.5;
  animation: mystudyspace-twinkle var(--duration, 2s) infinite ease-in-out;
}

@keyframes mystudyspace-twinkle {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Glassmorphism (utilisés par les composants React) */
.mystudyspace-students-wrapper .glass-panel {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mystudyspace-students-wrapper .glass-card {
  background: rgba(30, 41, 59, 0.4);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mystudyspace-students-wrapper .glass-card:hover {
  border-color: rgba(129, 140, 248, 0.4);
  background: rgba(30, 41, 59, 0.6);
  box-shadow: 0 0 20px rgba(79, 70, 229, 0.2);
}

.mystudyspace-students-wrapper .btn-cosmic {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
  transition: all 0.3s ease;
}

.mystudyspace-students-wrapper .btn-cosmic:hover {
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.6);
  transform: translateY(-2px);
}

@keyframes mystudyspace-badge-pop {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.mystudyspace-students-wrapper .animate-badge-pop {
  animation: mystudyspace-badge-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Root doit être au-dessus du starfield */
.mystudyspace-students-wrapper #root {
  position: relative;
  z-index: 1;
  min-height: 300px;
}

/* Override theme rules (e.g. .tutor-space label { color: #000 }) so labels and form text stay white */
body.tutor-space .mystudyspace-students-wrapper label,
body.page-tutor-space .mystudyspace-students-wrapper label,
.mystudyspace-students-wrapper label,
.mystudyspace-students-wrapper input,
.mystudyspace-students-wrapper textarea,
.mystudyspace-students-wrapper select {
  color: #ffffff !important;
}
.mystudyspace-students-wrapper input::placeholder,
.mystudyspace-students-wrapper textarea::placeholder {
  color: rgba(148, 163, 184, 0.9) !important;
}

/*
 * Stripe Connect (Intégrations) : champs sur fond clair — la règle ci-dessus mettait le texte en blanc
 * (invisible). Fond blanc + texte lisible hérité / revert (WordPress ne charge pas index.html du build Vite).
 */
.mystudyspace-students-wrapper .stripe-embedded-container {
  background-color: #ffffff;
  color: #1e293b;
}
.mystudyspace-students-wrapper .stripe-embedded-container label {
  color: inherit !important;
}
.mystudyspace-students-wrapper .stripe-embedded-container input,
.mystudyspace-students-wrapper .stripe-embedded-container textarea,
.mystudyspace-students-wrapper .stripe-embedded-container select {
  color: revert !important;
  -webkit-text-fill-color: revert !important;
}
.mystudyspace-students-wrapper .stripe-embedded-container input::placeholder,
.mystudyspace-students-wrapper .stripe-embedded-container textarea::placeholder {
  color: revert !important;
}
.mystudyspace-students-wrapper .stripe-embedded-container input:-webkit-autofill,
.mystudyspace-students-wrapper .stripe-embedded-container input:-webkit-autofill:hover,
.mystudyspace-students-wrapper .stripe-embedded-container input:-webkit-autofill:focus,
.mystudyspace-students-wrapper .stripe-embedded-container textarea:-webkit-autofill,
.mystudyspace-students-wrapper .stripe-embedded-container select:-webkit-autofill {
  -webkit-text-fill-color: revert !important;
}

/* Recharts : ResponsiveContainer a besoin d'un parent avec hauteur */
.mystudyspace-students-wrapper .recharts-responsive-container {
  min-width: 0;
  min-height: 200px;
}
.mystudyspace-students-wrapper .recharts-wrapper {
  min-width: 0;
  min-height: 200px;
}

/* Scrollbar */
.mystudyspace-students-wrapper ::-webkit-scrollbar { width: 6px; }
.mystudyspace-students-wrapper ::-webkit-scrollbar-track { background: transparent; }
.mystudyspace-students-wrapper ::-webkit-scrollbar-thumb {
  background: rgba(129, 140, 248, 0.2);
  border-radius: 10px;
}
.mystudyspace-students-wrapper ::-webkit-scrollbar-thumb:hover { background: rgba(129, 140, 248, 0.5); }
