/* ------------------------------------
   Google Font (moderne & fun)
------------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --color-bg: #f5f7fc;
  --color-text: #0f172a;
  --color-primary: #1e88e5;
  --color-primary-soft: rgba(30, 136, 229, 0.08);
  --color-accent: #f97316; /* accent issu du logo */
  --color-muted: #eef2f7;
  --color-panel: #ffffff;

  --header-height: 56px;
  --bottom-nav-height: 60px;

  /* largeur cohérente PARTOUT pour la sidebar */
  --sidebar-width: 280px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-soft: 0 8px 20px rgba(15, 23, 42, 0.06);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 20% 15%, rgba(30, 136, 229, 0.08), transparent 35%),
              radial-gradient(circle at 80% 0%, rgba(249, 115, 22, 0.08), transparent 30%),
              #fdfefe;
  color: var(--color-text);
}

/* ------------------------------------
   HEADER + LOGO
------------------------------------ */

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: linear-gradient(120deg, rgba(30, 136, 229, 0.12), rgba(249, 115, 22, 0.1), rgba(30, 136, 229, 0.12));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  z-index: 10;
}

/* Conteneur logo + titre */
.app-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Logo image : tu pourras juste changer le src dans le HTML */
.app-logo {
  height: 48px;
  width: auto;
  border-radius: var(--radius-md);
  object-fit: contain;
}

/* Titre à côté du logo */
.app-title {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
}

/* Placeholder si tu n'as pas encore mis le logo */
.logo-placeholder {
  font-weight: 700;
  font-size: 16px;
}

.header-right {
  display: flex;
  gap: 8px;
}

.icon-button {
  border: none;
  background: linear-gradient(145deg, rgba(30, 136, 229, 0.12), rgba(249, 115, 22, 0.12));
  font-size: 20px;
  cursor: pointer;
  padding: 6px;
  border-radius: 999px;
  color: #0f172a;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(30, 136, 229, 0.18);
  filter: brightness(1.05);
}

.icon-button:active {
  transform: translateY(1px);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.1);
}

/* ------------------------------------
   SIDE MENU (mobile d'abord)
------------------------------------ */

.side-menu {
  position: fixed;
  top: 0;
  bottom: 0;
  right: calc(-1 * var(--sidebar-width));
  width: var(--sidebar-width);
  background-color: #ffffff;
  box-shadow: -2px 0 12px rgba(15, 23, 42, 0.18);
  z-index: 20;
  transition: right 0.25s ease;
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
}

.side-menu.open {
  right: 0;
}

.side-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.side-menu-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
}

.side-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.side-menu li {
  margin-bottom: 6px;
}

.side-menu button {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 8px 10px;
  font-size: 14px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  transition: background-color 0.15s ease, transform 0.08s ease, color 0.15s ease;
}

.side-menu button:hover {
  background-color: var(--color-primary-soft);
  color: var(--color-primary);
  transform: translateX(2px);
}

.side-menu button.active {
  background: linear-gradient(135deg, rgba(30, 136, 229, 0.18), rgba(249, 115, 22, 0.14));
  color: #0f172a;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

/* ------------------------------------
   MAIN
------------------------------------ */

.app-main {
  padding: calc(var(--header-height) + 12px) 10px calc(var(--bottom-nav-height) + 12px);
}

/* Gestion des vues */
.app-view {
  display: none;
}

.app-view.active {
  display: block;
}

/* ------------------------------------
   CARDS
------------------------------------ */

.card {
  background-color: var(--color-panel);
  border-radius: var(--radius-lg);
  padding: 14px 14px 12px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
}

.card-subtitle {
  font-size: 12px;
  color: #6b7280;
}

/* ------------------------------------
   TABLES
------------------------------------ */

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 6px 4px;
  border-bottom: 1px solid #e0e0e0;
}

th {
  text-align: left;
  font-weight: 600;
}

/* ------------------------------------
   FORMULAIRES
------------------------------------ */

form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid #d1d5db;
  background: #f9fafb;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
}

textarea {
  min-height: 60px;
}

.set-row {
  display: flex;
  gap: 8px;
}

button {
  font-family: inherit;
}

/* ------------------------------------
   BOUTONS
------------------------------------ */

.btn-primary {
  background-image: linear-gradient(135deg, #1e88e5, #42a5f5);
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 10px 24px rgba(30, 136, 229, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 14px 34px rgba(30, 136, 229, 0.45);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 6px 16px rgba(30, 136, 229, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

.btn-login-top {
  padding: 7px 12px;
  font-size: 13px;
  box-shadow: 0 8px 18px rgba(30, 136, 229, 0.25);
}

.btn-secondary {
  background-color: #f3f4f6;
  color: #4b5563;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.btn-secondary:hover {
  background-color: #e5e7eb;
  border-color: #d1d5db;
  transform: translateY(-1px);
}

.form-message {
  font-size: 13px;
  margin-top: 6px;
}

.profile-level-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

/* ------------------------------------
   NAVIGATION BAS (mobile)
------------------------------------ */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: linear-gradient(135deg, rgba(30, 136, 229, 0.12), rgba(249, 115, 22, 0.1), rgba(30, 136, 229, 0.12));
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  display: flex;
  z-index: 10;
  box-shadow: 0 -8px 18px rgba(15, 23, 42, 0.12);
}

.bottom-nav-item {
  flex: 1;
  border: none;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  cursor: pointer;
  color: #475569;
  transition: color 0.15s ease, transform 0.1s ease, background-color 0.15s ease;
  padding: 4px 0;
}

.bottom-nav-item span {
  font-weight: 500;
}

.bottom-nav-item.active {
  color: #0f172a;
  background-color: rgba(30, 136, 229, 0.12);
  border-radius: 12px;
  margin: 4px;
  transform: translateY(-1px);
}

/* ------------------------------------
   FAB
------------------------------------ */

.fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 12px);
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background-image: linear-gradient(135deg, #1e88e5, #42a5f5);
  color: #ffffff;
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 30px rgba(30, 136, 229, 0.4);
  cursor: pointer;
  z-index: 11;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.fab:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 18px 40px rgba(30, 136, 229, 0.5);
}

.fab:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 8px 20px rgba(30, 136, 229, 0.35);
}

.site-footer {
  text-align: center;
  padding: 10px 8px 14px;
  font-size: 12px;
  color: #6b7280;
}

.install-banner {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + 10px);
  left: 12px;
  right: 12px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.15);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 50;
}

.install-actions {
  display: flex;
  gap: 8px;
}
/* ------------------------------------
   MODALES
------------------------------------ */

.modal {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 30;
}

.modal.open {
  display: flex;
}

.modal-content {
  background-color: #ffffff;
  border-radius: 16px;
  padding: 14px 14px 12px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-soft);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

/* ------------------------------------
   DIVERS
------------------------------------ */

.ranking-filters {
  margin-bottom: 8px;
  font-size: 13px;
}

.card-admin {
  border: 1px solid #e5e7eb;
}

.set-badge {
  display: inline-block;
  padding: 4px 6px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 12px;
}

.set-win {
  background-color: #e6f4ea;
  color: #1b5e20;
}

.set-lose {
  background-color: #fdecea;
  color: #b71c1c;
}

.profile-level-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

/* ------------------------------------
   CALENDRIER
------------------------------------ */

.calendar-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.calendar-view-toggle {
  display: flex;
  gap: 12px;
  font-size: 13px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  max-height: 520px;
  overflow-y: auto;
  padding: 8px;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.calendar-day {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 8px;
  min-height: 110px;
  background: linear-gradient(180deg, rgba(30, 136, 229, 0.04), rgba(255, 255, 255, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: transform 0.08s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.calendar-day-header {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 13px;
  color: #0f172a;
}

.calendar-day-events {
  max-height: 140px;
  overflow-y: auto;
}

.calendar-day.today {
  border-color: var(--color-primary);
  box-shadow: 0 8px 16px rgba(30, 136, 229, 0.12);
}

.calendar-day:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
  border-color: rgba(30, 136, 229, 0.2);
}

.calendar-event {
  background: rgba(30, 136, 229, 0.08);
  border-radius: 6px;
  padding: 4px 6px;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.3;
  border: 1px solid rgba(30, 136, 229, 0.15);
}

.calendar-event .time {
  font-weight: 700;
}

.calendar-event.more {
  background: rgba(15, 23, 42, 0.06);
  border: 1px dashed rgba(30, 41, 59, 0.2);
  text-align: center;
  cursor: default;
}

.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
}

/* ------------------------------------
   Tips padel
------------------------------------ */
.padel-tips-card {
  background: linear-gradient(135deg, rgba(30, 136, 229, 0.12), rgba(249, 115, 22, 0.1), rgba(30, 136, 229, 0.12));
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.12);
}

.padel-tips-card h3 {
  margin-top: 0;
  color: #0f172a;
  letter-spacing: 0.01em;
}

.padel-tips-list {
  list-style: none;
  padding-left: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 6px;
}

.padel-tips-list li {
  font-weight: 600;
  color: #0f172a;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.ideas-card {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(30, 136, 229, 0.12));
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.12);
}

.ideas-card h3 {
  margin-top: 0;
  color: #0f172a;
}

.ideas-card ul {
  padding-left: 16px;
  margin: 8px 0 0;
  color: #0f172a;
  line-height: 1.4;
}

/* ------------------------------------
   TABLETTE
------------------------------------ */

@media (min-width: 768px) {
  .app-main {
    max-width: 800px;
    margin: 0 auto;
  }

  /* Utilise la même variable que le desktop pour éviter tout débordement */
  .side-menu {
    width: var(--sidebar-width);
  }
}

/* ------------------------------------
   DESKTOP : sidebar fixe, nav bas masquée
------------------------------------ */

@media (min-width: 1024px) {
  .app-header {
    position: fixed;
    left: var(--sidebar-width);
    right: 0;
    z-index: 15;
    width: calc(100% - var(--sidebar-width));
  }

  .side-menu {
    left: 0;
    right: auto;
    transform: none;
    box-shadow: 1px 0 6px rgba(0, 0, 0, 0.06);
    border-right: 1px solid #e5e7eb;
    transition: none;
    top: 0;
    height: 100vh;
    padding-top: var(--header-height);
    overflow-y: auto;
    z-index: 14;
  }

  .side-menu.open {
    left: 0;
    right: auto;
    transform: none;
    transition: none;
  }

  .app-main {
    max-width: 1200px;
    padding: calc(var(--header-height) + 20px) 28px 36px;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
  }

  .bottom-nav {
    display: none;
  }

  .fab {
    right: 28px;
    bottom: 28px;
  }

  /* Cache le burger en desktop et le bouton de fermeture du menu */
  #btn-menu,
  #btn-menu-close {
    display: none;
  }
}
