/* ============================================================
   Portfolio — style.css  |  Thème Clean Violet
   Palette : Violet #7c3aed | Gris doux #f9fafb | Blanc #ffffff
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700&family=Inter:wght@400;500;600&display=swap');

/* ---------- Variables ---------- */
:root {
  --violet: #7c3aed;
  --violet-light: #a855f7;
  --violet-xlight: #f3e8ff;
  --violet-hover: #6d28d9;
  --violet-border: #e9d5ff;
  --blanc: #ffffff;
  --bg: #f9fafb;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  --transition: 0.2s ease;
}

/* ---------- Reset / Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 0.95rem;
  line-height: 1.6;
}

h1,
h2,
h3,
h4 {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  line-height: 1.3;
}

a {
  color: var(--violet);
  text-decoration: none;
}

a:hover {
  color: var(--violet-hover);
}

/* ---------- Navbar ---------- */
.cv-navbar {
  background: var(--blanc);
  border-bottom: 1px solid var(--border);
  height: 62px;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.cv-navbar .container-fluid {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 1rem;
}

.cv-navbar .navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  text-decoration: none;
}

.cv-navbar .brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--violet);
  flex-shrink: 0;
}

.cv-navbar .brand-name span {
  color: var(--violet);
}

.cv-navbar .navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.cv-navbar .nav-link {
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}

.cv-navbar .nav-link:hover,
.cv-navbar .nav-link.active-link {
  background: var(--violet-xlight);
  color: var(--violet);
}

.cv-navbar .nav-link.nav-logout {
  color: #ef4444;
  border: 1px solid #fee2e2;
  border-radius: var(--radius-sm);
}

.cv-navbar .nav-link.nav-logout:hover {
  background: #fee2e2;
  color: #dc2626;
}

.cv-navbar .badge-ae {
  font-size: 0.75rem;
  color: var(--text-light);
  padding-left: 1rem;
  border-left: 1px solid var(--border);
  white-space: nowrap;
}

/* Hamburger mobile */
.cv-navbar .navbar-toggler {
  border: 1px solid var(--border);
  background: none;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-left: auto;
  display: none;
}

.cv-navbar .navbar-toggler-icon {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  position: relative;
}

.cv-navbar .navbar-toggler-icon::before,
.cv-navbar .navbar-toggler-icon::after {
  content: '';
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  position: absolute;
}

.cv-navbar .navbar-toggler-icon::before {
  top: -6px;
}

.cv-navbar .navbar-toggler-icon::after {
  top: 6px;
}

/* ---------- Hero ---------- */
.cv-hero {
  background: var(--blanc);
  border-bottom: 1px solid var(--border);
  padding: 3rem 2rem;
}

.cv-hero .hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--violet);
  background: var(--violet-xlight);
  border-radius: 20px;
  padding: 4px 12px;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cv-hero h1 {
  font-size: 2rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.cv-hero h1 span {
  color: var(--violet);
}

.cv-hero p {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 560px;
  margin-bottom: 1.5rem;
}

.cv-hero .hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ---------- Boutons ---------- */
.btn-violet {
  background: var(--violet);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.6rem 1.4rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--transition), transform var(--transition);
  text-decoration: none;
}

.btn-violet:hover {
  background: var(--violet-hover);
  transform: translateY(-1px);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--violet);
  border: 1.5px solid var(--violet-border);
  border-radius: var(--radius);
  padding: 0.6rem 1.4rem;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-outline:hover {
  background: var(--violet-xlight);
  border-color: var(--violet);
  transform: translateY(-1px);
  color: var(--violet);
}

.btn-danger {
  background: #fee2e2;
  color: #dc2626;
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-danger:hover {
  background: #fecaca;
  color: #b91c1c;
}

/* ---------- Cards ---------- */
.cv-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  transition: box-shadow var(--transition), transform var(--transition);
}

.cv-card:hover {
  box-shadow: var(--shadow);
}

.cv-card-accent {
  border-top: 3px solid var(--violet);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ---------- Formulaires ---------- */
.cv-form .form-group {
  margin-bottom: 1.1rem;
}

.cv-form label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
  font-family: 'Sora', sans-serif;
}

.cv-form input,
.cv-form select,
.cv-form textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--blanc);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.cv-form input:focus,
.cv-form select:focus,
.cv-form textarea:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.cv-form textarea {
  resize: vertical;
  min-height: 90px;
}

/* ---------- Tableaux ---------- */
.cv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.cv-table thead tr {
  background: var(--bg);
  border-bottom: 2px solid var(--border);
}

.cv-table thead th {
  padding: 0.75rem 1rem;
  font-family: 'Sora', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: left;
}

.cv-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.cv-table tbody tr:hover {
  background: #faf5ff;
}

.cv-table tbody td {
  padding: 0.85rem 1rem;
  color: var(--text);
  vertical-align: middle;
}

/* ---------- Badges / Tags ---------- */
.badge-violet {
  display: inline-block;
  background: var(--violet-xlight);
  color: #6d28d9;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.badge-green {
  display: inline-block;
  background: #d1fae5;
  color: #065f46;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.badge-gray {
  display: inline-block;
  background: #f3f4f6;
  color: #374151;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

/* ---------- Alertes ---------- */
.cv-alert-error {
  background: #fef2f2;
  border-left: 3px solid #ef4444;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.75rem 1rem;
  color: #991b1b;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.cv-alert-success {
  background: #f0fdf4;
  border-left: 3px solid #22c55e;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.75rem 1rem;
  color: #14532d;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* ---------- Skill bar ---------- */
.skill-bar-wrap {
  margin-bottom: 0.9rem;
}

.skill-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 5px;
  color: var(--text);
}

.skill-bar-track {
  height: 7px;
  background: var(--violet-xlight);
  border-radius: 10px;
  overflow: hidden;
}

.skill-bar-fill {
  height: 100%;
  background: var(--violet);
  border-radius: 10px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- Timeline (CV) ---------- */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--violet-border);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.75rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--violet);
  border: 2px solid var(--blanc);
  box-shadow: 0 0 0 2px var(--violet-border);
}

.timeline-date {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--violet);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 3px;
}

.timeline-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.timeline-org {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.timeline-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---------- Projet card (grille) ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}

.project-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.project-card-img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--violet-xlight);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--violet);
  font-size: 2.5rem;
}

.project-card-body {
  padding: 1.1rem 1.25rem;
}

.project-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}

.project-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.55;
}

.project-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* ---------- Page login ---------- */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 1rem;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}

.login-card .login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.login-card .login-logo .logo-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--violet-xlight);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.login-card .login-logo h2 {
  font-size: 1.25rem;
  color: var(--text);
}

.login-card .login-logo h2 span {
  color: var(--violet);
}

.login-card .login-logo p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ---------- Section profil ---------- */
.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--violet-xlight);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Sora', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--violet);
  flex-shrink: 0;
}

/* ---------- Footer ---------- */
.cv-footer {
  background: var(--blanc);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  text-align: center;
  padding: 1.25rem;
  font-size: 0.8rem;
  margin-top: auto;
}

.cv-footer span {
  color: var(--violet);
  font-weight: 600;
}

/* ---------- Utilitaires layout ---------- */
.page-content {
  flex: 1;
  padding: 2rem 1rem;
}

.container-md {
  max-width: 900px;
  margin: 0 auto;
}

.container-lg {
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ---------- Grid helpers ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

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

/* ---------- Stat card ---------- */
.stat-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--violet);
  font-family: 'Sora', sans-serif;
}

.stat-card .stat-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ---------- Contact card ---------- */
.contact-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.contact-item:last-child {
  border-bottom: none;
}

.contact-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--violet-xlight);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--violet);
  flex-shrink: 0;
  font-size: 1rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .cv-navbar {
    padding: 0 1rem;
  }

  .cv-navbar .navbar-toggler {
    display: block;
  }

  .cv-navbar .navbar-collapse {
    display: none;
  }

  .cv-navbar .navbar-collapse.show {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    background: var(--blanc);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
    gap: 4px;
    z-index: 99;
  }

  .cv-navbar .navbar-nav {
    flex-direction: column;
    width: 100%;
    margin-left: 0;
  }

  .cv-navbar .badge-ae {
    display: none;
  }

  .cv-hero h1 {
    font-size: 1.5rem;
  }

  .login-card {
    padding: 1.75rem 1.25rem;
  }
}

/* ---------- Carrousel projet ---------- */
.projet-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  transition: transform 0.35s ease;
}

.carousel-slide {
  flex: 0 0 100%;
  min-width: 100%;
  max-height: 460px;
}

.carousel-slide img {
  width: 100%;
  height: 460px;
  object-fit: cover;
  display: block;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  color: var(--violet);
  border: 1px solid var(--violet-border);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  z-index: 5;
}

.carousel-btn:hover {
  background: var(--violet-xlight);
}

.carousel-prev {
  left: 12px;
}

.carousel-next {
  right: 12px;
}

.carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 5;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(124, 58, 237, 0.4);
  padding: 0;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.carousel-dot.active {
  background: var(--violet);
  transform: scale(1.2);
}

@media (max-width: 768px) {
  .carousel-slide img {
    height: 260px;
  }
}

/* ---------- Galerie d'upload (aperçu avant envoi) ---------- */
.galerie-preview-item {
  position: relative;
}

.galerie-preview-item img {
  width: 100px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

.galerie-preview-remove {
  position: absolute;
  top: -8px;
  right: -8px;
  padding: 2px 7px;
  font-size: 0.7rem;
  border-radius: 50%;
}

/* ---------- Chip de fichier sélectionné (PDF, documents) ---------- */
.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--violet-xlight);
  color: #6d28d9;
  border: 1px solid var(--violet-border);
  border-radius: var(--radius);
  padding: 7px 10px 7px 12px;
  font-size: 0.82rem;
  font-weight: 500;
  max-width: 100%;
}

.file-chip .file-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 260px;
}

.file-chip .file-chip-remove {
  background: none;
  border: none;
  color: #6d28d9;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
}

.file-chip .file-chip-remove:hover {
  color: #4c1d95;
}