@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

/* =====================================================================
   VARIABLES — Thème Sombre (défaut)
   ===================================================================== */
:root {
  --bg-color: #0b0f19;
  --card-bg: #111827;
  --card-border: #1f2937;
  --text-main: #ffffff;
  --text-color: #f0f0f0;
  --text-muted: #9ca3af;
  --badge-bg: #1e293b;
  --badge-border: #334155;
  --badge-text: #94a3b8;
  --link-hover: #38bdf8;
  --input-bg: #0b0f19;
  --input-border: #1f2937;
  --label-color: #e5e7eb;
  --file-btn-bg: #374151;
  --file-btn-hover: #4b5563;
}

/* =====================================================================
   VARIABLES — Thème Clair
   ===================================================================== */
body.light-mode {
  --bg-color: #ffffff;
  --card-bg: #f9fafb;
  --card-border: #e5e7eb;
  --text-main: #111827;
  --text-color: #333333;
  --text-muted: #6b7280;
  --badge-bg: #e2e8f0;
  --badge-border: #cbd5e1;
  --badge-text: #475569;
  --link-hover: #0284c7;
  --input-bg: #f3f4f6;
  --input-border: #d1d5db;
  --label-color: #374151;
  --file-btn-bg: #e5e7eb;
  --file-btn-hover: #d1d5db;
}

/* =====================================================================
   BASE
   ===================================================================== */
body {
  font-family: "Inter", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition:
    background 0.3s ease,
    color 0.3s ease;
  margin: 0;
  padding: 20px;
}

/* =====================================================================
   HEADER & NAVBAR
   ===================================================================== */
header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1e293b;
}

header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.03em;
  background: linear-gradient(to right, #a4bad8, #1f2937);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

nav {
  display: flex;
  gap: 32px;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  padding: 6px 0;
  transition: color 0.2s ease;
}

nav a:hover {
  color: #38bdf8;
}

nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #38bdf8;
  transition: width 0.2s ease;
}

nav a:hover::after {
  width: 100%;
}

@media (max-width: 600px) {
  header {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
  nav {
    gap: 20px;
  }
}

/* =====================================================================
   TOGGLE DARK / LIGHT MODE
   ===================================================================== */
.switch {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #1e293b;
  border: 1px solid #334155;
  border-radius: 999px;
  transition:
    background-color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.35s ease,
    box-shadow 0.35s ease;
}

.slider-thumb {
  position: absolute;
  width: 22px;
  height: 22px;
  top: 2px;
  left: 3px;
  background-color: #ffffff;
  border-radius: 50%;
  transition:
    left 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.35s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.slider-thumb svg {
  width: 14px;
  height: 14px;
  position: absolute;
  transition: opacity 0.25s ease;
}

.slider-thumb .icon-moon {
  opacity: 1;
}
.slider-thumb .icon-sun {
  opacity: 0;
}

input:checked ~ .slider {
  background-color: #0284c7;
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

input:checked ~ .slider .slider-thumb {
  left: 31px;
  box-shadow: 0 1px 6px rgba(56, 189, 248, 0.35);
}

input:checked ~ .slider .icon-moon {
  opacity: 0;
}
input:checked ~ .slider .icon-sun {
  opacity: 1;
}

/* =====================================================================
   SECTION PROJETS
   ===================================================================== */
#projects h2 {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  margin: 60px 0 40px 0;
  letter-spacing: -0.03em;
  background: linear-gradient(to right, #a4bad8, #1f2937);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 40px auto;
}

.project-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease;
}

.project-card:hover {
  border-color: #3b82f6;
}

.project-img-wrapper {
  width: 100%;
  height: 240px;
  overflow: hidden;
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-info {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 16px 0;
  color: var(--text-main);
}

.project-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0 0 20px 0;
}

.project-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.lang-badge {
  background-color: var(--badge-bg);
  border: 1px solid var(--badge-border);
  color: var(--badge-text);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.project-links {
  margin-top: auto;
  display: flex;
  gap: 20px;
}

.project-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s ease;
}

.project-link:hover {
  color: var(--link-hover);
}

.icon {
  transition: transform 0.2s ease;
}

.project-link:hover .icon {
  transform: translateY(-2px);
}

.project-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-details {
  background-color: #38bdf8;
  color: #0b0f19;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  transition:
    background-color 0.2s,
    transform 0.1s;
}

.btn-details:hover {
  background-color: #0ea5e9;
}

.btn-details:active {
  transform: scale(0.96);
}

/* =====================================================================
   MODALE PROJET
   ===================================================================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(11, 15, 25, 0.8);
  backdrop-filter: blur(8px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.modal-content {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  max-width: 800px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 40px;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 25px;
  color: var(--text-muted);
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.2s;
}

.close-modal:hover {
  color: #ef4444;
}

.modal-content h2 {
  font-size: 2rem;
  margin-top: 0;
  color: var(--text-main);
}

.modal-content p {
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 1.05rem;
  margin-bottom: 30px;
}

.modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.modal-gallery-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  transition: transform 0.2s;
  cursor: zoom-in;
}

.modal-gallery-img:hover {
  transform: scale(1.02);
}

/* =====================================================================
   LIGHTBOX
   ===================================================================== */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(5, 8, 15, 0.95);
  z-index: 2000;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.2s ease;
}

#lightbox-img {
  max-width: 90%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  border: 1px solid #334155;
}

.close-lightbox {
  position: absolute;
  top: 30px;
  right: 40px;
  color: #ffffff;
  font-size: 45px;
  font-weight: 300;
  cursor: pointer;
  transition:
    color 0.2s,
    transform 0.2s;
}

.close-lightbox:hover {
  color: #ef4444;
  transform: scale(1.1);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* =====================================================================
   SECTION CONTACT
   ===================================================================== */
#contact {
  max-width: 600px;
  margin: 100px auto 60px auto;
  padding: 0 20px;
}

#contact h2 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-align: center;
  letter-spacing: -0.05em;
  color: var(--text-main);
}

.contact-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 40px;
}

.contact-container {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 24px;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--label-color);
}

.form-group input,
.form-group textarea {
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text-color);
  font-family: inherit;
  font-size: 0.95rem;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

#btn-submit {
  width: 100%;
  background-color: #38bdf8;
  color: #0b0f19;
  border: none;
  padding: 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition:
    background-color 0.2s,
    transform 0.1s;
}

#btn-submit:hover {
  background-color: #0ea5e9;
}

#btn-submit:disabled {
  background-color: #4b5563;
  cursor: not-allowed;
}

.form-response {
  margin-top: 20px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 500;
}

.form-response.success {
  color: #10b981;
}
.form-response.error {
  color: #ef4444;
}

/* =====================================================================
   VUE ADMIN
   ===================================================================== */
.admin-body {
  display: flex;
  min-height: 100vh;
  background-color: #0b0f19;
  margin: 0;
  font-family: "Inter", sans-serif;
}

.admin-sidebar {
  width: 260px;
  background-color: #111827;
  border-right: 1px solid #1f2937;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
}

.admin-sidebar h2 {
  font-size: 1.4rem;
  color: #ffffff;
  margin-bottom: 40px;
  padding-left: 10px;
  border-left: 4px solid #38bdf8;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-nav a {
  color: #9ca3af;
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
}

.admin-nav a:hover,
.admin-nav a.active {
  background-color: #1e293b;
  color: #38bdf8;
}

.admin-nav a.back-site {
  margin-top: 50px;
  border-top: 1px solid #1f2937;
  padding-top: 20px;
  color: #e5e7eb;
}

.admin-content {
  flex-grow: 1;
  padding: 40px;
  max-height: 100vh;
  overflow-y: auto;
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
}

.admin-content h2 {
  font-size: 2rem;
  margin-top: 0;
  margin-bottom: 30px;
}

.admin-form {
  background-color: #111827;
  border: 1px solid #1f2937;
  padding: 32px;
  border-radius: 16px;
  max-width: 800px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group textarea,
.form-group input[type="file"] {
  width: 100%;
  padding: 12px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--text-color);
  font-family: inherit;
  box-sizing: border-box;
}

.helper-text {
  color: var(--text-muted);
  margin-top: 5px;
  font-size: 0.8rem;
}

.info-helper {
  color: #38bdf8;
  margin-top: 5px;
  font-size: 0.8rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.btn-submit {
  background: #38bdf8;
  color: #0b0f19;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-submit:hover {
  background: #0ea5e9;
}

.btn-cancel {
  background: #4b5563;
  color: #ffffff;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.btn-admin-submit {
  background-color: #38bdf8;
  color: #0b0f19;
  border: none;
  padding: 14px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn-admin-submit:hover {
  background-color: #0ea5e9;
}

.message-admin-card {
  background-color: #111827;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.msg-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.msg-email {
  color: #38bdf8;
  font-size: 0.9rem;
}

.msg-subject {
  font-weight: 600;
  color: #e5e7eb;
  margin-bottom: 12px;
}

.msg-content {
  color: #9ca3af;
  margin: 0;
  line-height: 1.5;
}

.calendar-placeholder {
  background-color: #111827;
  border: 2px dashed #1f2937;
  border-radius: 16px;
  padding: 8px;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #9ca3af;
}

/* --- Project manager --- */
.project-manager-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
  margin-top: 20px;
}

.form-container-box {
  background: #111827;
  border: 1px solid #1f2937;
  padding: 24px;
  border-radius: 12px;
}

.form-container-box h2 {
  margin-top: 0;
  margin-bottom: 25px;
  color: #ffffff;
}

.admin-projects-sidebar {
  background: #111827;
  border: 1px solid #1f2937;
  padding: 24px;
  border-radius: 12px;
  height: fit-content;
}

.admin-projects-sidebar h3 {
  color: #ffffff;
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 1.2rem;
}

/* --- Input file --- */
.form-group input[type="file"] {
  padding: 8px;
  color: var(--text-muted);
  cursor: pointer;
}

.form-group input[type="file"]:hover {
  border-color: var(--text-muted);
}

.form-group input[type="file"]::file-selector-button {
  background: var(--file-btn-bg);
  color: var(--text-main);
  border: none;
  padding: 8px 16px;
  margin-right: 15px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.1s;
}

.form-group input[type="file"]::file-selector-button:hover {
  background: var(--file-btn-hover);
}

.form-group input[type="file"]::file-selector-button:active {
  transform: scale(0.98);
}

/* --- Media queries admin --- */
@media (min-width: 768px) {
  .form-row {
    flex-direction: row;
  }

  .project-manager-container {
    flex-direction: row;
    align-items: flex-start;
  }

  .form-container-box {
    flex: 2;
  }

  .admin-projects-sidebar {
    flex: 1;
    position: sticky;
    top: 20px;
  }
}

/* =====================================================================
   VUE LOGIN
   ===================================================================== */
.login-body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #0b0f19;
  margin: 0;
  font-family: "Inter", sans-serif;
}

.login-container {
  background-color: #111827;
  border: 1px solid #1f2937;
  padding: 40px;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.login-container h2 {
  color: #ffffff;
  text-align: center;
  margin-top: 0;
  margin-bottom: 30px;
  font-size: 1.5rem;
  font-weight: 700;
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrapper input {
  width: 100%;
  padding-right: 45px;
  box-sizing: border-box;
}

.toggle-password-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  transition: color 0.2s;
}

.toggle-password-btn:hover {
  color: #38bdf8;
}

#btn-login {
  width: 100%;
  background-color: #38bdf8;
  color: #0b0f19;
  border: none;
  padding: 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 10px;
  transition:
    background-color 0.2s,
    transform 0.1s;
}

#btn-login:hover {
  background-color: #0ea5e9;
}

#btn-login:active {
  transform: scale(0.98);
}

#btn-login:disabled {
  background-color: #4b5563;
  cursor: not-allowed;
}

.error-msg {
  color: #ef4444;
  text-align: center;
  margin-top: 15px;
  font-size: 0.9rem;
  font-weight: 500;
}
