/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background: #333;
  color: #EEE;
}

a {
  color: #BBB;
  text-decoration: none;
}

a:hover {
  color: #FFF;
}

img {
  max-width: 100%;
  height: auto;
}

/* Container */
.container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

/* ========================================
   HEADER
======================================== */
.header {
  background: #000;
  padding: 20px 0;
}

.header-content {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.header-title h1 {
  margin: 0;
  font-size: 24px;
}

.header-title h1 a {
  color: #EEE;
  text-decoration: none;
}

.header-title h2 {
  margin: 5px 0 0 0;
  font-size: 14px;
  text-align: left;
}

.header-title h2 a {
  color: #BBB;
  text-decoration: none;
  font-style: italic;
}

.header-images {
  display: flex;
  gap: 5px;
}

.header-images img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
}

.header-divider {
  height: 1px;
  background: #EEE;
  margin: 10px 0;
}

.header-nav {
  background: #444;
  padding: 12px 0;
  margin: 0 -20px;
}

.header-nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
  padding: 0 20px;
}

.nav-social img {
  height: 20px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.nav-links a {
  color: #EEE;
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}

.nav-links a:hover {
  color: #BBB;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #EEE;
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
}

/* ========================================
   CONTENT (Index page)
======================================== */
.content {
  padding: 30px 0;
}

.content p {
  margin-bottom: 20px;
  text-align: justify;
}

.content a {
  color: #BBB;
  text-decoration: none;
}

.content a:hover {
  color: #FFF;
  text-decoration: underline;
}

.kofi-container {
  margin-bottom: 20px;
}

.video-section {
  text-align: center;
  margin: 40px 0;
}

.video-section h3 {
  margin-bottom: 20px;
  font-size: 18px;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  max-width: 100%;
  background: #000;
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* ========================================
   PHOTO GALLERY
======================================== */
.breadcrumb {
  padding: 15px 0;
  margin-bottom: 20px;
  font-size: 14px;
  border-bottom: 1px solid #444;
}

.breadcrumb a {
  color: #BBB;
  margin: 0 5px;
}

.breadcrumb a:hover {
  color: #FFF;
}

.breadcrumb .separator {
  color: #666;
  margin: 0 5px;
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 15px;
}

.gallery-stats {
  color: #AAA;
  font-style: italic;
}

.gallery-controls {
  display: flex;
  align-items: center;
}

/* Toggle switch pour groupement */
.toggle-switch {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.toggle-switch input[type="checkbox"] {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 50px;
  height: 24px;
  background: #444;
  border-radius: 12px;
  margin-right: 10px;
  transition: background 0.3s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #888;
  border-radius: 50%;
  transition: all 0.3s;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
  background: #666;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider::before {
  left: 28px;
  background: #EEE;
}

.toggle-label {
  color: #EEE;
  font-size: 14px;
}

/* Date groups */
.date-group {
  margin-bottom: 50px;
}

.date-header {
  font-size: 20px;
  color: #FFF;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #555;
}

.date-count {
  font-size: 14px;
  color: #AAA;
  font-weight: normal;
  margin-left: 10px;
}

.lightbox-date {
  position: absolute;
  top: -40px;
  left: 0;
  color: #FFF;
  font-size: 16px;
  display: none;
}

.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.folder-card {
  background: #2a2a2a;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  display: block;
  overflow: hidden;
}

.folder-card.with-preview {
  padding: 0;
}

.folder-card:hover {
  background: #333;
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.folder-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
}

.folder-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.folder-card:hover .folder-preview img {
  transform: scale(1.1);
}

.folder-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.folder-card:hover .folder-overlay {
  opacity: 1;
}

.folder-overlay .folder-icon {
  font-size: 64px;
  color: #FFF;
  margin: 0;
}

.folder-card.with-preview .folder-name {
  padding: 15px;
  background: #2a2a2a;
}

.folder-icon {
  font-size: 48px;
  margin-bottom: 10px;
  color: #888;
}

.folder-name {
  font-size: 16px;
  color: #EEE;
  word-wrap: break-word;
}

.image-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #2a2a2a 25%, #333 50%, #2a2a2a 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.image-card {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  background: #1a1a1a;
}

.image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.image-card:hover img {
  transform: scale(1.1);
}

.image-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0);
  transition: background 0.3s ease;
}

.image-card:hover::after {
  background: rgba(0,0,0,0.3);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.95);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #FFF;
  font-size: 40px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: transform 0.2s;
}

.lightbox-close:hover {
  transform: scale(1.2);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  border: none;
  color: #FFF;
  font-size: 40px;
  cursor: pointer;
  padding: 20px;
  border-radius: 4px;
  transition: background 0.3s;
}

.lightbox-nav:hover {
  background: rgba(0,0,0,0.8);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-counter {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  color: #FFF;
  font-size: 16px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #888;
  font-size: 18px;
}

/* ========================================
   VIDEO PORTFOLIO
======================================== */
.main-container {
  max-width: 1400px;
  margin: 0 auto;
  background: #333;
  min-height: 100vh;
}

.content-wrapper {
  padding: 20px;
  padding-top: 40px;
}

h1 {
  text-align: center;
  margin-bottom: 30px;
  color: #FFF;
  font-size: 28px;
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
  padding: 20px;
  background: #2a2a2a;
  border-radius: 8px;
}

.control-group {
  display: flex;
  flex-direction: column;
}

label {
  font-weight: bold;
  margin-bottom: 5px;
  color: #BBB;
  font-size: 12px;
  text-transform: uppercase;
}

select, button {
  padding: 10px 12px;
  background: #444;
  color: #EEE;
  border: 1px solid #555;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

select:hover, button:hover {
  background: #555;
  border-color: #666;
}

button {
  background: #666;
  font-weight: bold;
}

button:hover {
  background: #777;
}

.multi-select-container {
  position: relative;
}

.multi-select-display {
  padding: 10px 12px;
  background: #444;
  color: #EEE;
  border: 1px solid #555;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  min-height: 42px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.multi-select-display:hover {
  background: #555;
  border-color: #666;
}

.selected-tag {
  background: #666;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.selected-tag .remove {
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
}

.multi-select-placeholder {
  color: #999;
}

.multi-select-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #444;
  border: 1px solid #555;
  border-radius: 4px;
  margin-top: 5px;
  max-height: 250px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}

.multi-select-dropdown.active {
  display: block;
}

.multi-select-option {
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.multi-select-option:hover {
  background: #555;
}

.multi-select-option input[type="checkbox"] {
  cursor: pointer;
}

.stats {
  text-align: center;
  margin-bottom: 25px;
  color: #BBB;
  font-style: italic;
  font-size: 15px;
}

.projects-grid {
  display: grid;
  gap: 20px;
}

.project-card {
  background: #2a2a2a;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}

.project-image {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  cursor: pointer;
  background: #000;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.project-card:hover .project-image img {
  transform: scale(1.05);
}

.play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  background: rgba(0,0,0,0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.play-overlay::after {
  content: '';
  width: 0;
  height: 0;
  border-left: 24px solid #FFF;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  margin-left: 5px;
}

.project-image:hover .play-overlay {
  background: rgba(255,255,255,0.25);
  transform: translate(-50%, -50%) scale(1.15);
}

.project-date {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0,0,0,0.85);
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 13px;
  color: #FFF;
}

.project-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.project-title {
  font-size: 20px;
  font-weight: bold;
  color: #FFF;
  cursor: pointer;
  line-height: 1.3;
}

.project-title:hover {
  color: #BBB;
}

.project-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.role-tag {
  background: #444;
  padding: 5px 12px;
  border-radius: 12px;
  font-size: 12px;
  color: #BBB;
  white-space: nowrap;
}

.project-description {
  color: #CCC;
  line-height: 1.7;
  font-size: 14px;
}

.no-results {
  text-align: center;
  padding: 80px 20px;
  color: #888;
  font-size: 18px;
}

.video-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.95);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.video-overlay.active {
  display: flex;
}

.video-container {
  position: relative;
  width: 100%;
  max-width: 1200px;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.close-video {
  position: absolute;
  top: -50px;
  right: 0;
  background: none;
  border: none;
  color: #FFF;
  font-size: 40px;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.close-video:hover {
  transform: scale(1.2);
}

/* ========================================
   FOOTER
======================================== */
.footer {
  background: #444;
  padding: 20px 0;
  text-align: center;
  font-size: 14px;
  color: #BBB;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (min-width: 1200px) {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  .container {
    padding: 0 15px;
  }

  .header {
    padding: 15px 0;
  }

  .header-title h1 {
    font-size: 20px;
  }

  .header-images {
    flex-wrap: wrap;
  }

  .header-images img {
    width: 60px;
    height: 60px;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 10px;
  }

  .nav-links.active {
    display: flex;
  }

  .header-nav-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .video-section {
    margin: 30px 0;
  }

  .content {
    padding: 20px 0;
  }

  .content p {
    text-align: left;
  }

  .gallery-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .date-header {
    font-size: 18px;
  }

  .folders-grid,
  .images-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }

  .folder-card {
    padding: 15px;
  }

  .folder-icon {
    font-size: 36px;
  }

  .folder-name {
    font-size: 14px;
  }

  .lightbox-nav {
    padding: 15px;
    font-size: 30px;
  }

  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }

  .content-wrapper {
    padding: 15px;
  }

  h1 {
    font-size: 24px;
    margin-bottom: 20px;
  }

  .controls {
    grid-template-columns: 1fr;
    padding: 15px;
    gap: 12px;
  }

  .project-info {
    padding: 15px;
  }

  .project-title {
    font-size: 18px;
  }

  .play-overlay {
    width: 60px;
    height: 60px;
  }

  .play-overlay::after {
    border-left: 20px solid #FFF;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
  }
}

@media (max-width: 480px) {
  .header-title h1 {
    font-size: 18px;
  }

  .header-images img {
    width: 50px;
    height: 50px;
  }

  .nav-links a {
    font-size: 16px;
    padding: 8px 0;
  }

  .folders-grid,
  .images-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
  }

  .lightbox-nav {
    padding: 10px;
    font-size: 24px;
  }

  h1 {
    font-size: 20px;
  }

  .project-title {
    font-size: 16px;
  }

  .project-description {
    font-size: 13px;
  }

  .close-video {
    top: -40px;
    font-size: 32px;
  }
}