@import url("https://fonts.googleapis.com/css2?family=Caveat:wght@700&family=Fredoka:wght@400;600&family=Quicksand:wght@500;700&display=swap");

:root {
  --bg-pastel: #f2f5fa;
  --text-pastel-dark: #4a5568;
  --text-pastel-pink: #e26d8c;
  --accent-pink: #ff8da1;

  --card-pink: rgba(255, 229, 236, 0.75);
  --card-blue: rgba(232, 240, 254, 0.75);
  --card-green: rgba(230, 244, 234, 0.75);
  --card-yellow: rgba(254, 247, 224, 0.75);
  --card-purple: rgba(243, 232, 255, 0.75);

  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.08);

  --radius-ios: 22px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  font-family:
    "Quicksand",
    -apple-system,
    sans-serif;
}

body {
  background: linear-gradient(145deg, #ebf3fe 0%, #fdf2f5 100%);
  color: var(--text-pastel-dark);
  height: 100vh;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.glass-panel,
.glass-header,
.glass-tabbar,
.glass-modal {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.liquid-btn {
  transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}
.liquid-btn:active {
  transform: scale(0.93);
  opacity: 0.85;
}

/* MENU PRINCIPAL (MADAME CASSANDRA) */
.welcome-screen {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  padding: 20px;
}

.welcome-card {
  border-radius: 35px;
  padding: 40px 25px;
  text-align: center;
  width: 100%;
  max-width: 400px;
}

.welcome-stars {
  font-size: 28px;
  margin-bottom: 10px;
}

/* POLICE ENSEIGNANTE / BRICOLAGE */
.welcome-title {
  font-family: "Caveat", cursive;
  font-size: 36px;
  color: #4a4a4a;
  line-height: 1.1;
}
.welcome-title span {
  font-size: 30px;
  color: #777;
}
.welcome-title strong {
  font-family: "Fredoka", cursive;
  font-size: 38px;
  color: #ff6b8b;
  display: block;
  letter-spacing: 1px;
}

.main-menu-buttons {
  margin-top: 30px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 16px;
  border-radius: 20px;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}

.cartable-btn {
  background: #ff8da1;
  color: white;
}
.chatgpt-btn {
  background: #10a37f;
  color: white;
}
.dict-btn {
  background: #6c5ce7;
  color: white;
}

/* CONTAINER APP ET HEADER */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
}

.ios-header {
  padding: 45px 20px 15px;
  border-bottom-left-radius: 22px;
  border-bottom-right-radius: 22px;
  z-index: 10;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-top h1 {
  font-family: "Fredoka", cursive;
  font-size: 22px;
  color: var(--text-pastel-pink);
}

.back-to-menu-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.05);
  color: #5a6a85;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.9);
  color: #718096;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.add-btn {
  background: var(--accent-pink);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(255, 141, 161, 0.4);
  cursor: pointer;
}

.search-bar-container {
  width: 100%;
}
.search-input-wrapper {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 16px;
  gap: 8px;
  background: rgba(255, 255, 255, 0.8);
}
.search-icon {
  color: #a0aec0;
  width: 18px;
  height: 18px;
}
.search-input-wrapper input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 14px;
  color: #4a5568;
}
.clear-search-btn {
  background: #cbd5e0;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  color: white;
  font-size: 12px;
  cursor: pointer;
}

.ios-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: 90px;
}

/* CARTES */
.pastel-card {
  border-radius: var(--radius-ios);
  padding: 18px;
  margin-bottom: 15px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 20px rgba(147, 158, 190, 0.12);
  position: relative;
}

.card-pink {
  background: var(--card-pink);
}
.card-blue {
  background: var(--card-blue);
}
.card-green {
  background: var(--card-green);
}
.card-yellow {
  background: var(--card-yellow);
}
.card-purple {
  background: var(--card-purple);
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-pastel-dark);
  margin-bottom: 6px;
  padding-right: 25px;
}
.card-subtitle {
  font-size: 13.5px;
  color: #5a6a85;
  margin-top: 4px;
}

.delete-item-btn {
  background: rgba(255, 255, 255, 0.6);
  border: none;
  color: #a0aec0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* BOUTON FLOTTANT A-Z */
.az-float-btn {
  position: absolute;
  bottom: 85px;
  right: 20px;
  background: var(--accent-pink);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.8);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 25px;
  box-shadow: 0 8px 20px rgba(255, 141, 161, 0.4);
  z-index: 50;
  cursor: pointer;
}

.az-float-btn-inline {
  background: #6c5ce7;
  color: white;
  border: none;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 16px;
  cursor: pointer;
}

/* TABBAR AVEC PILULE LIQUID GLASS ANIMÉE */
.ios-tabbar {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 75px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  padding-bottom: 12px;
}

.liquid-indicator {
  position: absolute;
  top: 8px;
  bottom: 18px;
  left: 0;
  width: 20%;
  background: rgba(255, 255, 255, 0.65);
  border: 1.5px solid rgba(210, 215, 230, 0.9);
  border-radius: 18px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition:
    transform 0.3s cubic-bezier(0.25, 1, 0.5, 1),
    width 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.tab-item {
  background: none;
  border: none;
  color: #a0aec0;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  gap: 4px;
  flex: 1;
  z-index: 2;
  cursor: pointer;
  transition: color 0.25s ease;
}

.tab-item.active {
  color: var(--text-pastel-pink);
}

/* DICTIONNAIRE PAGE STYLE PAPER */
.dict-paper-page {
  background: #fffdf9;
  border-radius: 20px;
  margin: 15px;
  padding: 20px !important;
  box-shadow:
    inset 0 0 10px rgba(0, 0, 0, 0.02),
    0 5px 15px rgba(0, 0, 0, 0.04);
  border: 1px solid #f0eae1;
}

.dict-entry {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px dashed #e2d9cc;
}

.dict-word {
  font-family: "Fredoka", cursive;
  font-size: 20px;
  color: #6c5ce7;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.dict-type {
  font-family: "Quicksand", sans-serif;
  font-size: 12px;
  font-style: italic;
  color: #888;
}

.dict-def {
  font-size: 14.5px;
  color: #4a5568;
  margin-top: 6px;
  line-height: 1.4;
}

.dict-pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 65px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  padding: 0 20px;
}

.dict-page-nav-btn {
  background: rgba(108, 92, 231, 0.1);
  border: none;
  color: #6c5ce7;
  padding: 8px 14px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.dict-page-indicator {
  font-weight: 700;
  font-size: 13px;
  color: #718096;
}

/* MODALES */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 100;
}

.glass-modal {
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
  padding: 25px;
  width: 100%;
  max-width: 500px;
  animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.az-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 15px;
}
.az-range-btn {
  background: rgba(240, 244, 248, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.9);
  padding: 12px;
  border-radius: 14px;
  font-weight: 700;
  color: #4a5568;
  cursor: pointer;
  font-size: 14px;
}
.az-range-btn.active-range {
  background: var(--accent-pink);
  color: white;
}

.confirm-box {
  border-radius: 28px !important;
  margin: auto;
  text-align: center;
  padding: 25px 20px;
  width: 90%;
  max-width: 340px;
}
.confirm-box h3 {
  font-family: "Fredoka", cursive;
  margin-bottom: 10px;
  color: var(--text-pastel-dark);
}
.confirm-box p {
  font-size: 14px;
  color: #6c7a89;
  margin-bottom: 20px;
}
.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-secondary {
  flex: 1;
  background: #edf2f7;
  border: none;
  padding: 12px;
  border-radius: 14px;
  font-weight: 700;
  color: #4a5568;
}
.btn-danger {
  flex: 1;
  background: #ff6b6b;
  border: none;
  padding: 12px;
  border-radius: 14px;
  font-weight: 700;
  color: white;
}

.empty-trash-btn {
  background: #ff6b6b;
  color: white;
  border: none;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 700;
  margin-bottom: 15px;
  width: 100%;
  cursor: pointer;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-header h3 {
  font-family: "Fredoka", cursive;
  color: var(--text-pastel-dark);
}
.close-btn {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
}

.form-group {
  margin-bottom: 15px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-pastel-dark);
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  font-size: 14px;
  outline: none;
  background: rgba(255, 255, 255, 0.8);
}
.save-btn {
  width: 100%;
  background: var(--accent-pink);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 16px;
  margin-top: 10px;
  cursor: pointer;
}

/* AJOUTS POUR LE PIN LOCK ET STYLE */
.pin-section {
  margin-top: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pin-label {
  font-size: 14px;
  font-weight: 700;
  color: #718096;
  margin-bottom: 10px;
}

.pin-input-wrapper input {
  width: 140px;
  padding: 12px;
  text-align: center;
  font-size: 26px;
  letter-spacing: 8px;
  font-weight: 700;
  border-radius: 18px;
  border: 2px solid rgba(255, 141, 161, 0.5);
  background: rgba(255, 255, 255, 0.9);
  color: #ff6b8b;
  outline: none;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.pin-error {
  color: #e53e3e;
  font-size: 13px;
  font-weight: 700;
  margin-top: 8px;
}

/* ANIMATION APPARITION DU MENU */
.main-menu-buttons {
  animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
