﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Playfair+Display:ital,wght@0,600;0,700;1,600&display=swap');

:root {
  --primary: #0A192F; /* Bleu Nuit Profond / Luxe */
  --accent: #C5A059;  /* Or / Bronze Premium */
  --bg-gradient: linear-gradient(135deg, #f6f8f9 0%, #e5ebee 100%);
  --surface: #ffffff;
  --text-main: #1f2937;
  --text-muted: #6b7280;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* =========================================
   TYPOGRAPHIE HAUT DE GAMME
   ========================================= */
h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  color: var(--primary);
  margin: 0;
}

.text-gold-bold {
  color: var(--accent); /* Dor� pur */
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  letter-spacing: -1px;
}

/* =========================================
   PAGE DE CONNEXION (index.php)
   ========================================= */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.login-box {
  background: var(--surface);
  width: 100%;
  max-width: 440px;
  padding: 3.5rem 3rem;
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(10, 25, 47, 0.15), 0 0 0 1px rgba(0,0,0,0.02);
  position: relative;
  overflow: hidden;
}

/* Ligne dor�e en haut de la carte */
.login-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: var(--accent);
}

.login-box h2 {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 2.5rem;
  letter-spacing: -0.5px;
}

/* S�lecteur de r�le */
.role-selector {
  display: flex;
  background: #f3f4f6;
  border-radius: 12px;
  padding: 6px;
  margin-bottom: 2.5rem;
}

.role-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.8rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.role-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Formulaires */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.hidden {
  display: none !important;
}

.error-msg {
  color: #dc2626;
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  min-height: 20px;
  margin-bottom: 1.5rem;
}

/* Champs de saisie */
input, textarea {
  width: 100%;
  padding: 1.1rem 1.25rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  color: var(--text-main);
  transition: all 0.3s ease;
}

input:focus, textarea:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(197, 160, 89, 0.15);
}

/* Bouton principal */
button[type="submit"] {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 1.2rem;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
}

button[type="submit"]:hover {
  background: #142d55;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(10, 25, 47, 0.2);
}

/* =========================================
   DASHBOARDS (admin.php & client.php)
   ========================================= */
header {
  background: var(--surface);
  padding: 1.5rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  position: sticky;
  top: 0;
  z-index: 100;
}

header h1 {
  font-size: 1.8rem;
}

header button {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid #e5e7eb;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

header button:hover {
  background: #f3f4f6;
  color: var(--primary);
  border-color: var(--text-muted);
}

main {
  padding: 4rem 5%;
  max-width: 1400px;
  margin: 0 auto;
}

main h2 {
  font-size: 1.5rem;
  margin-bottom: 2rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 3rem;
}

/* Cartes (Cards) */
.card {
  background: var(--surface);
  padding: 3rem;
  border-radius: 24px;
  box-shadow: 0 10px 40px rgba(10, 25, 47, 0.04);
  border: 1px solid rgba(229, 231, 235, 0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(10, 25, 47, 0.08);
}

.card h2 {
  font-size: 1.6rem;
  margin-bottom: 2.5rem;
  border-bottom: 2px solid #f3f4f6;
  padding-bottom: 1.5rem;
}

.card h3 {
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.card .date {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 1.5rem;
}

.card p {
  line-height: 1.8;
  color: var(--text-muted);
}

#posts-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 2.5rem;
}

textarea {
  resize: vertical;
  min-height: 140px;
}

/* =========================================
   NOUVEAUT�S : DOCK, UPLOAD, CLIENTS
   ========================================= */

/* Dock Flottant */
.floating-dock {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.5rem;
  border-radius: 999px;
  display: flex;
  gap: 0.5rem;
  box-shadow: 0 10px 40px rgba(10, 25, 47, 0.15), 0 1px 3px rgba(0,0,0,0.05);
  border: 1px solid rgba(255, 255, 255, 0.5);
  z-index: 1000;
}

.dock-btn {
  background: transparent;
  border: none;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dock-icon {
  font-size: 1.5rem;
  opacity: 0.7;
  transition: all 0.3s;
}

.dock-btn:hover {
  background: rgba(10, 25, 47, 0.05);
}

.dock-btn.active {
  background: var(--primary);
  box-shadow: 0 4px 12px rgba(10, 25, 47, 0.2);
}

.dock-btn.active .dock-icon {
  opacity: 1;
  filter: brightness(0) invert(1);
}

/* Bouton Central (Home) */
.dock-btn-main {
  width: 68px;
  height: 68px;
  margin-top: -20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(10, 25, 47, 0.1);
  margin-left: 0.5rem;
  margin-right: 0.5rem;
}

.dock-btn-main .dock-icon {
  opacity: 0.9;
  color: var(--primary);
}

.dock-btn-main:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(10, 25, 47, 0.15);
  background: var(--surface);
}

.dock-btn-main.active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(197, 160, 89, 0.3);
}

.dock-btn-main.active .dock-icon {
  filter: brightness(0) invert(1);
}

.dock-btn.active {
  background: var(--primary);
  box-shadow: 0 4px 12px rgba(10, 25, 47, 0.2);
}

.dock-btn.active .dock-icon {
  opacity: 1;
  filter: brightness(0) invert(1);
}

/* Upload Fichier */
.file-upload-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
}

.hidden-input {
  display: none;
}

.file-upload-label {
  background: #f3f4f6;
  color: var(--primary);
  padding: 0.8rem 1.2rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px dashed var(--border);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.file-upload-label:hover {
  background: #e5e7eb;
  border-color: var(--text-muted);
}

.file-name {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Images dans les Posts */
.post-card {
  padding: 0 !important;
  overflow: hidden;
}

.post-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.post-content {
  padding: 2.5rem;
}

/* Vues avec fondue */
.admin-view, .client-view {
  animation: fadeIn 0.4s ease-out forwards;
}

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

/* Boutons R�seaux Sociaux */
.social-toggles {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}
.social-buttons {
  display: flex;
  gap: 1.2rem;
}
.social-btn {
  background: transparent;
  border: 2px solid #d1d5db; /* Contour gris par d�faut */
  color: #9ca3af; /* Logo gris par d�faut */
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Couleurs sp�cifiques FB et IG */
.social-btn.fb::before { background: #1877F2; }
.social-btn.fb.active { border-color: #1877F2; }

.social-btn.ig::before { background: #E1306C; }
.social-btn.ig.active { border-color: #E1306C; }

.social-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.35s ease, height 0.35s ease;
  z-index: 0;
}
.social-btn.active::before {
  width: 120%;
  height: 120%;
}
.social-btn.active {
  color: #fff;
  transform: scale(1.05); /* Effet d'agrandissement */
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.social-btn svg {
  position: relative;
  z-index: 1;
  width: 24px;
  height: 24px;
}

/* =========================================
   TIMELINE (Activit� R�cente)
   ========================================= */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-top: 1rem;
  padding-left: 0.5rem;
}
.timeline-item {
  position: relative;
  padding-left: 28px;
  font-size: 0.95rem;
  color: var(--text-main);
  font-weight: 500;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
}
.timeline-item.success::before { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }
.timeline-item.info::before { background: #3b82f6; box-shadow: 0 0 8px rgba(59, 130, 246, 0.4); }
.timeline-item.warning::before { background: #f59e0b; box-shadow: 0 0 8px rgba(245, 158, 11, 0.4); }

.timeline-item::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 20px;
  bottom: -16px;
  width: 2px;
  background: var(--border);
}
.timeline-item:last-child::after { display: none; }
.timeline-time {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 400;
}
/ *   t e s t   * /  
 
/* =========================================
   MODALE PLEIN ECRAN (Client Post View)
   ========================================= */
.post-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--surface);
  z-index: 10000;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.post-modal.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(10, 25, 47, 0.6);
  color: #fff;
  border: none;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, transform 0.2s;
  backdrop-filter: blur(5px);
}
.modal-close:hover {
  background: rgba(10, 25, 47, 0.9);
  transform: scale(1.1);
}
.modal-content {
  max-width: 900px;
  margin: 0 auto;
  background: var(--surface);
  min-height: 100vh;
  box-shadow: 0 0 50px rgba(0,0,0,0.1);
}
.modal-header-img {
  width: 100%;
  height: 55vh;
  object-fit: cover;
  display: block;
  border-bottom: 5px solid var(--accent);
}
.modal-body {
  padding: 3rem 4rem;
}
.modal-body h2 {
  font-size: 3rem;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

/* Am�lioration carte cliquable */
.clickable-card {
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.clickable-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px -12px rgba(10, 25, 47, 0.2);
}
.clickable-card .read-more {
  display: inline-block;
  margin-top: 1rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
}
.clickable-card .excerpt {
  color: var(--text-muted);
}

/* =========================================
   ADMIN MULTI-IMAGES PREVIEW
   ========================================= */
.preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}
.preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9); /* Red */
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: transform 0.2s, background 0.2s;
}
.preview-remove:hover {
    transform: scale(1.1);
    background: rgba(220, 38, 38, 1);
}



/* =========================================
   MODALE PLEIN ECRAN (Client Post View)
   ========================================= */
.post-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--surface);
  z-index: 10000;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.post-modal.active {
  opacity: 1;
  pointer-events: auto;
}
.modal-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(10, 25, 47, 0.6);
  color: #fff;
  border: none;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s, transform 0.2s;
  backdrop-filter: blur(5px);
}
.modal-close:hover {
  background: rgba(10, 25, 47, 0.9);
  transform: scale(1.1);
}
.modal-content {
  max-width: 900px;
  margin: 0 auto;
  background: var(--surface);
  min-height: 100vh;
  box-shadow: 0 0 50px rgba(0,0,0,0.1);
}
.modal-header-img {
  width: 100%;
  height: 55vh;
  object-fit: cover;
  display: block;
  border-bottom: 5px solid var(--accent);
}
.modal-body {
  padding: 3rem 4rem;
}
.modal-body h2 {
  font-size: 3rem;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

/* Amélioration carte cliquable */
.clickable-card {
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.clickable-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px -12px rgba(10, 25, 47, 0.2);
}
.clickable-card .read-more {
  display: inline-block;
  margin-top: 1rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
}
.clickable-card .excerpt {
  color: var(--text-muted);
}


/* =========================================
   CAROUSEL BUTTONS
   ========================================= */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(10, 25, 47, 0.4);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.2s;
    backdrop-filter: blur(4px);
    z-index: 100;
}
.carousel-btn:hover {
    background: rgba(10, 25, 47, 0.8);
    transform: translateY(-50%) scale(1.1);
}
.carousel-btn.prev {
    left: 20px;
}
.carousel-btn.next {
    right: 20px;
}

