/* MatchCut - CSS avec couleurs du logo violet */

:root{ 
  /* Couleurs du logo MatchCut */
  --primary: #8B5CF6;           /* Violet principal du logo */
  --primary-dark: #7C3AED;      /* Violet foncé */
  --primary-darker: #6D28D9;    /* Violet très foncé */
  --primary-light: #A78BFA;     /* Violet clair */
  --primary-lighter: #C4B5FD;   /* Violet très clair */
  
  --bg1: #F3E8FF;               /* Fond violet très clair */
  --bg2: #E9D5FF;               /* Fond violet clair */
  
  --text: #1F2937;              /* Texte foncé */
  --text-light: #6B7280;        /* Texte gris */
  
  --white: #FFFFFF;
  --cream: #FEFCE8;             /* Crème du logo */
  
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  
  --border: #E5E7EB;
  --shadow: rgba(139, 92, 246, 0.15);
}

/* Reset de base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

html, body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
}

body { 
  margin: 0; 
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 
               'Helvetica Neue', Arial, sans-serif;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
  color: var(--text);
  line-height: 1.6;
}

/* ===========================================
   CONTAINER PRINCIPAL - RESPONSIVE
   =========================================== */

.phone-frame { 
  width: 100%;
  min-height: 100vh;
  background: transparent;
  margin: 0;
  padding: 0;
}

.phone-frame::before { 
  display: none;
}

.app-shell { 
  width: 100%;
  min-height: 100vh;
  background: var(--white);
  padding: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Tablette (768px - 1024px) */
@media (min-width: 768px) {
  .app-shell {
    max-width: 768px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 40px);
    margin-top: 20px;
    margin-bottom: 20px;
    border-radius: 16px;
    box-shadow: 0 10px 40px var(--shadow);
  }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
  .app-shell {
    max-width: 900px;
    padding: 32px;
  }
}

/* Large Desktop (> 1440px) */
@media (min-width: 1440px) {
  .app-shell {
    max-width: 1000px;
    padding: 40px;
  }
}

/* ===========================================
   TYPOGRAPHIE
   =========================================== */

h1 { 
  font-size: clamp(20px, 5vw, 28px);
  margin: 8px 0 12px; 
  text-align: center; 
  color: var(--text);
  font-weight: 700;
  line-height: 1.3;
}

h2 {
  font-size: clamp(18px, 4vw, 24px);
  margin: 8px 0;
  color: var(--text);
}

h3 {
  font-size: clamp(16px, 3.5vw, 20px);
  margin: 6px 0;
  color: var(--text);
}

p {
  font-size: clamp(14px, 2.5vw, 16px);
  line-height: 1.6;
  color: var(--text-light);
}

/* Texte avec couleur du logo */
.text-primary {
  color: var(--primary) !important;
}

/* ===========================================
   LOGO
   =========================================== */

.logo { 
  display: block; 
  margin: 0 auto 12px; 
  width: clamp(64px, 15vw, 96px);
  height: clamp(64px, 15vw, 96px);
  object-fit: cover; 
  border-radius: 18px; 
  border: 2px solid var(--primary-lighter);
  box-shadow: 0 4px 12px var(--shadow);
}

/* ===========================================
   BOUTONS - Couleur violet du logo
   =========================================== */

button { 
  width: 100%; 
  padding: clamp(10px, 2vw, 14px) clamp(12px, 3vw, 18px);
  border: none; 
  border-radius: 14px; 
  background: var(--primary);
  color: var(--white);
  font-weight: 700; 
  cursor: pointer; 
  box-shadow: 0 6px 16px var(--shadow);
  transition: all .2s ease;
  font-size: clamp(14px, 2.5vw, 16px);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:hover { 
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--shadow);
}

button:active { 
  transform: translateY(0);
}

/* Bouton secondaire (outline) */
button.secondary,
button[style*="border: 2px solid"] {
  background: var(--white) !important;
  color: var(--primary) !important;
  border: 2px solid var(--primary) !important;
}

button.secondary:hover {
  background: var(--primary-lighter) !important;
  border-color: var(--primary-dark) !important;
}

/* Desktop - Boutons moins larges */
@media (min-width: 768px) {
  button {
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* ===========================================
   LIENS
   =========================================== */

a { 
  color: var(--primary);
  text-decoration: none; 
  font-weight: 600;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ===========================================
   CONTAINER / CARDS
   =========================================== */

.container { 
  background: rgba(255,255,255,.98); 
  border: 1px solid var(--primary-lighter); 
  border-radius: 16px; 
  padding: clamp(14px, 3vw, 20px);
  max-width: 100%;
  margin: 0 auto;
  box-shadow: 0 2px 8px var(--shadow);
}

@media (min-width: 768px) {
  .container {
    padding: 24px;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 32px;
  }
}

/* ===========================================
   FORMULAIRES
   =========================================== */

label { 
  display: block; 
  font-weight: 600; 
  font-size: clamp(13px, 2vw, 15px);
  margin-top: 12px;
  margin-bottom: 4px;
  color: var(--text);
}

input, select, textarea { 
  width: 100%; 
  padding: clamp(10px, 2vw, 14px);
  border: 2px solid var(--primary-lighter);
  border-radius: 12px; 
  margin-top: 4px;
  font-size: clamp(14px, 2.5vw, 16px);
  background: var(--white);
  color: var(--text);
  transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus { 
  outline: none; 
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--shadow);
}

@media (min-width: 768px) {
  input, select, textarea {
    max-width: 500px;
  }
}

/* ===========================================
   NAVBAR - Thème violet
   =========================================== */

.navbar { 
  position: sticky; 
  top: 0; 
  margin: -12px -12px 12px;
  padding: 10px 12px;
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  gap: 6px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  backdrop-filter: saturate(140%) blur(8px); 
  border-bottom: 2px solid var(--primary-darker);
  z-index: 100;
  flex-wrap: wrap;
  font-size: clamp(12px, 2vw, 14px);
  box-shadow: 0 2px 8px var(--shadow);
}

@media (min-width: 768px) {
  .navbar {
    margin: -20px -20px 20px;
    padding: 12px 20px;
    gap: 12px;
    flex-wrap: nowrap;
  }
}

@media (min-width: 1024px) {
  .navbar {
    margin: -32px -32px 24px;
    padding: 14px 32px;
    gap: 16px;
  }
}

.navbar a, .navbar button { 
  background: none; 
  border: none; 
  color: var(--white);
  font-weight: 700;
  font-size: clamp(11px, 2vw, 14px);
  padding: 6px 8px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 8px;
}

.navbar a:hover, .navbar button:hover {
  background: rgba(255,255,255,0.15);
  text-decoration: none;
}

@media (min-width: 768px) {
  .navbar a, .navbar button {
    padding: 8px 12px;
    font-size: 14px;
  }
}

.navbar a.active { 
  background: rgba(255,255,255,0.25);
  color: var(--white);
}

.navbar .logout { 
  color: var(--cream);
  background: rgba(239, 68, 68, 0.2);
}

.navbar .logout:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* ===========================================
   CHIPS / FILTRES
   =========================================== */

.chips { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 6px;
  margin-top: 8px;
}

@media (min-width: 768px) {
  .chips {
    gap: 10px;
  }
}

.chip { 
  padding: clamp(5px, 1vw, 8px) clamp(8px, 2vw, 12px);
  background: var(--primary-lighter);
  border: 2px solid var(--primary-light);
  color: var(--primary-darker);
  border-radius: 999px; 
  font-size: clamp(11px, 2vw, 13px);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-weight: 600;
}

.chip:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px var(--shadow);
}

.chip:active,
.chip.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary-dark);
  transform: translateY(0);
}

/* ===========================================
   FILTRES
   =========================================== */

.filters { 
  display: grid; 
  grid-template-columns: 1fr;
  gap: 10px; 
  margin-bottom: 14px;
}

@media (min-width: 480px) {
  .filters {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .filters {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
}

@media (min-width: 1440px) {
  .filters {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ===========================================
   CARTES
   =========================================== */

.list { 
  display: flex; 
  flex-direction: column; 
  gap: 12px;
}

@media (min-width: 768px) {
  .list {
    gap: 16px;
  }
}

.card { 
  background: var(--white);
  border: 2px solid var(--primary-lighter);
  border-radius: 16px; 
  padding: clamp(12px, 2vw, 16px);
  display: grid; 
  grid-template-columns: clamp(60px, 15vw, 80px) 1fr;
  gap: clamp(10px, 2vw, 14px);
  align-items: center;
  transition: all 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--shadow);
  border-color: var(--primary);
}

@media (min-width: 768px) {
  .card {
    padding: 18px;
  }
}

.card img { 
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px; 
  object-fit: cover;
  border: 2px solid var(--primary-lighter);
}

.meta { 
  display: flex; 
  gap: 8px;
  flex-wrap: wrap; 
  color: var(--text-light);
  font-size: clamp(12px, 2vw, 14px);
}

.actions { 
  display: flex; 
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .actions {
    flex-wrap: nowrap;
  }
}

/* ===========================================
   STATISTIQUES / BADGES
   =========================================== */

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 480px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
}

.stat-card {
  background: linear-gradient(135deg, var(--primary-lighter), var(--primary-light));
  padding: 16px;
  border-radius: 12px;
  border: 2px solid var(--primary);
  text-align: center;
}

/* ===========================================
   BADGES / NOTES
   =========================================== */

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

.badge-primary {
  background: var(--primary-lighter);
  color: var(--primary-darker);
  border: 1px solid var(--primary);
}

.badge-success {
  background: #D1FAE5;
  color: #065F46;
}

.badge-warning {
  background: #FEF3C7;
  color: #92400E;
}

.badge-danger {
  background: #FEE2E2;
  color: #991B1B;
}

/* ===========================================
   UTILITAIRES
   =========================================== */

.mt-sm { margin-top: clamp(8px, 2vw, 16px); }
.mt-md { margin-top: clamp(16px, 3vw, 24px); }
.mt-lg { margin-top: clamp(24px, 4vw, 32px); }

.mb-sm { margin-bottom: clamp(8px, 2vw, 16px); }
.mb-md { margin-bottom: clamp(16px, 3vw, 24px); }
.mb-lg { margin-bottom: clamp(24px, 4vw, 32px); }

.p-sm { padding: clamp(8px, 2vw, 16px); }
.p-md { padding: clamp(16px, 3vw, 24px); }
.p-lg { padding: clamp(24px, 4vw, 32px); }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mobile-only { display: block; }
.desktop-only { display: none; }

@media (min-width: 768px) {
  .mobile-only { display: none; }
  .desktop-only { display: block; }
}

/* ===========================================
   BACKGROUNDS ALTERNATIFS
   =========================================== */

.bg-primary {
  background: var(--primary) !important;
  color: var(--white) !important;
}

.bg-light {
  background: var(--bg1) !important;
}

/* ===========================================
   OPTIMISATIONS TACTILES
   =========================================== */

@media (hover: none) and (pointer: coarse) {
  button, a, .chip, .card {
    min-height: 44px;
  }
  
  input, select, textarea {
    font-size: 16px;
  }
}

/* ===========================================
   ANIMATIONS
   =========================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===========================================
   IMPRESSION
   =========================================== */

@media print {
  body {
    background: white;
  }
  
  .navbar,
  button,
  .actions {
    display: none;
  }
  
  .app-shell {
    box-shadow: none;
    border: 1px solid #000;
  }
}

/* ==================================================
   ✅ RESPONSIVE / MOBILE FIRST (OVERRIDES)
   ================================================== */

/* Boîte : tout compte en "border-box" pour éviter les débordements */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Images responsive */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Base mobile first */
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, var(--bg2), var(--bg1) 40%, #fdfcff 100%);
  color: var(--text);
}

/* Conteneur général façon app */
body {
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.phone-frame {
  width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0;
  display: flex;
}

/* Coeur de l'app */
.app-shell {
  flex: 1;
  background: var(--white);
  min-height: 100vh;
  padding: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 10px 30px var(--shadow);
  border-radius: 0;
}

/* Contenu principal (pages) */
.container {
  max-width: 100%;
  margin: 0;
  padding: 14px 10px;
}

/* Titres plus adaptés au mobile */
h1 {
  font-size: 20px;
  margin: 0 0 8px;
}

h2 {
  font-size: 17px;
  margin: 0 0 6px;
}

/* Formulaires full width */
form {
  width: 100%;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
textarea,
select {
  width: 100%;
  max-width: 100%;
}

/* Boutons = largeur 100% sur mobile */
button,
a.button,
.actions a {
  width: 100%;
  max-width: 100%;
}

/* Cartes (coiffeurs, rendez-vous, etc.) */
.card {
  width: 100%;
  max-width: 100%;
}

/* =========================
   📱 → 📱📱 Tablettes
   ========================= */
@media (min-width: 640px) {
  body {
    align-items: center;
  }

  .phone-frame {
    max-width: 480px;
    padding: 16px 0;
  }

  .app-shell {
    border-radius: 24px;
  }
}

/* =========================
   💻 Desktop
   ========================= */
@media (min-width: 1024px) {
  .phone-frame {
    max-width: 520px;
  }

  .app-shell {
    min-height: 640px;
  }

  .container {
    padding: 20px 16px;
  }
}
