/* Variables - Thème inspiré de l'architecture sacrée */
:root {
  --color-primary: #8b6914;
  --color-primary-dark: #6b5010;
  --color-primary-light: #c9a227;
  --color-success: #c9a22769;
  --color-error: #9d0208;
  --color-bg: #1a1a1a;
  --color-card: rgba(255, 255, 255, 0.95);
  --color-card-glass: rgba(255, 255, 255, 0.12);
  --color-card-glass-border: rgba(255, 255, 255, 0.2);
  --color-text: #2d2d2d;
  --color-text-light: #f8f6f0;
  --color-text-muted: #6b6b6b;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 15px 40px rgba(0, 0, 0, 0.25);
  --radius: 10px;
  --radius-lg: 16px;
}

/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=Source+Sans+3:wght@400;500;600&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Source Sans 3', system-ui, sans-serif;
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Image de fond - intérieur d'église */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('/images/bg-church.png') center center / cover no-repeat fixed;
  z-index: -2;
}

/* Overlay sombre pour lisibilité */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(26, 26, 26, 0.85) 0%, rgba(45, 45, 45, 0.75) 100%);
  z-index: -1;
}

/* Header - verre dépoli */
.header {
  background: var(--color-card-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-card-glass-border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  min-height: 56px;
}

.header-spacer {
  display: none;
}

/* Hamburger : caché sur desktop */
.hamburger {
  display: none;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-img {
  height: 70px;
  width: auto;
  display: block;
}

/* Hamburger menu - base */
.hamburger {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 110;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text-light);
  transition: transform 0.3s, opacity 0.3s;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.logo:hover .logo-img {
  opacity: 0.9;
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 104;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.nav-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* ========== RESPONSIVE MOBILE ========== */
@media (max-width: 768px) {
  .header-container {
    padding: 0 1rem;
    justify-content: space-between;
  }

  .hamburger {
    display: flex;
    order: 1;
  }

  .logo {
    order: 2;
    flex: 1;
    justify-content: center;
    min-width: 0;
  }

  .header-spacer {
    display: block;
    width: 44px;
    min-width: 44px;
    order: 3;
    flex-shrink: 0;
  }

  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(300px, 85vw);
    height: 100vh;
    background: rgba(25, 30, 40, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 5rem 1.5rem 2rem;
    gap: 0;
    transition: right 0.3s ease;
    z-index: 105;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.4);
    order: unset;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .nav.open {
    right: 0;
  }

  /* Header au-dessus de l'overlay pour que le menu soit cliquable */
  body.nav-open .header {
    z-index: 106;
  }

  .nav .nav-link {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 1rem;
  }

  .nav .user-name {
    padding: 1rem 0;
    font-size: 0.95rem;
  }

  .nav .badge-admin,
  .nav .badge-contributor {
    margin: 0.5rem 0;
    display: inline-block;
  }

  .nav .btn-outline {
    margin-top: 1rem;
    text-align: center;
    padding: 0.75rem 1rem;
  }

  .auth-logo {
    height: 90px;
  }

  .auth-logo-section {
    padding: 1.5rem 1rem 1rem;
  }

  .auth-page {
    min-height: calc(100vh - 260px);
    padding: 1rem;
  }

  .auth-card {
    padding: 1.5rem;
  }

  .main {
    padding: 1rem;
  }

  .gallery-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    gap: 0.75rem;
  }

  .gallery-toolbar h1 {
    font-size: 1.35rem;
    text-align: center;
  }

  .upload-form {
    flex-wrap: wrap;
    justify-content: center;
  }

  .themes-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
  }

  .theme-card {
    min-height: 120px;
    padding: 1rem;
  }

  .theme-form .form-row {
    flex-direction: column;
  }

  .theme-form input[type="text"] {
    min-width: 100%;
  }

  .add-photos-card,
  .theme-create-card {
    padding: 1.25rem;
  }

  .add-photos-upload {
    flex-direction: column;
    align-items: stretch;
  }

  .add-photos-upload label {
    justify-content: center;
  }

  .gallery-breadcrumb {
    font-size: 0.85rem;
  }

  .gallery-item-actions {
    top: 0.25rem;
    right: 0.25rem;
    gap: 0.15rem;
  }

  .btn-delete,
  .btn-move {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }

  .lightbox-close {
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 44px;
    height: 44px;
    font-size: 2rem;
  }

  .lightbox-prev {
    left: 0.5rem;
  }

  .lightbox-next {
    right: 0.5rem;
  }

  .lightbox-counter {
    bottom: 1rem;
    font-size: 0.85rem;
    padding: 0.35rem 0.8rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
  }

  .empty-state {
    padding: 2rem 1rem;
    font-size: 1rem;
  }

  .error-page h1 {
    font-size: 2.5rem;
  }

  .footer {
    padding: 1rem;
    font-size: 0.8rem;
  }
}

/* Très petits écrans */
@media (max-width: 380px) {
  .header-container {
    padding: 0 0.75rem;
  }

  .logo-img {
    height: 48px;
  }

  .nav {
    width: min(280px, 90vw);
  }

  .themes-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
}

/* Desktop : hamburger caché, menu horizontal, overlay masqué */
@media (min-width: 769px) {
  .hamburger {
    display: none !important;
  }

  .header-spacer {
    display: none !important;
  }

  .nav-overlay {
    display: none !important;
  }

  .nav {
    position: static;
    width: auto;
    height: auto;
    flex-direction: row;
    padding: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  .nav.open {
    right: auto;
  }
}

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-link {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-link:hover {
  color: var(--color-primary-light);
}

.user-name {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
}

.badge-admin {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #1a1a1a;
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-weight: 600;
}

.badge-contributor {
  background: rgba(45, 106, 79, 0.9);
  color: var(--color-text-light);
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-weight: 600;
}

.badge-user {
  background: rgba(255, 255, 255, 0.25);
  color: var(--color-text-light);
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-weight: 600;
}

/* Page Administration */
.admin-header {
  text-align: center;
  margin-bottom: 2rem;
}

.admin-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.75rem;
  color: var(--color-text-light);
  margin-bottom: 0.25rem;
}

.admin-subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
}

.admin-card {
  background: var(--color-card-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-card-glass-border);
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-table th {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  font-size: 0.9rem;
}

.admin-table td {
  color: var(--color-text-light);
}

.admin-email {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.admin-role-form {
  margin: 0;
}

.admin-role-inline {
  flex: 1;
  min-width: 120px;
}

.admin-delete-form {
  margin: 0;
}

.admin-role-select {
  padding: 0.4rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  background: rgba(30, 35, 45, 0.95);
  color: var(--color-text-light);
  font-size: 0.9rem;
  cursor: pointer;
  accent-color: rgba(45, 106, 79, 0.9);
}

.admin-role-select:hover,
.admin-role-select:focus {
  border-color: rgba(45, 106, 79, 0.6);
  outline: none;
}

.admin-self {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .admin-table th,
  .admin-table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
  }

  .admin-table th:nth-child(4),
  .admin-table td:nth-child(4) {
    display: none;
  }
}

/* Main */
.main {
  flex: 1;
  padding: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Page d'accueil visiteurs (landing) */
.landing-hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.landing-hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.25rem;
  color: var(--color-text-light);
  margin-bottom: 0.5rem;
}

.landing-subtitle {
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.1rem;
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 1000px;
  margin: 0 auto 2.5rem;
}

.landing-item {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.landing-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

.landing-cta {
  text-align: center;
  padding: 2rem;
  background: var(--color-card-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-card-glass-border);
  max-width: 500px;
  margin: 0 auto;
}

.landing-cta p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.25rem;
}

.landing-cta .btn {
  margin: 0 0.5rem 0.5rem 0;
}

.landing-empty {
  text-align: center;
  padding: 4rem 2rem;
  color: rgba(255, 255, 255, 0.8);
}

.landing-empty p {
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .landing-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .landing-hero h1 {
    font-size: 1.75rem;
  }

  .landing-cta .btn {
    display: block;
    width: 100%;
    margin: 0 0 0.5rem 0;
  }
}

/* Alerts */
.alerts {
  margin-bottom: 1rem;
}

.alert {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.alert-success {
  background: #c9a22769;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.alert-error {
  background: rgba(157, 2, 8, 0.9);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.25s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-text-light);
  box-shadow: 0 4px 15px rgba(139, 105, 20, 0.4);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 105, 20, 0.5);
}

.btn-upload {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-upload .btn-icon {
  flex-shrink: 0;
  color: currentColor;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: var(--color-text-light);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.3);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  color: var(--color-text-light);
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--color-primary-light);
  color: var(--color-primary-light);
}

.btn-block {
  width: 100%;
  text-align: center;
}

/* Auth - Logo grand format entre header et card */
.auth-logo-section {
  display: flex;
  justify-content: center;
  padding: 2rem 1rem 1rem;
}

.auth-logo {
  height: 140px;
  width: auto;
}

/* Auth */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 320px);
  padding: 2rem;
}

.auth-card {
  background: var(--color-card-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-card-glass-border);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
}

.auth-card h1 {
  font-family: 'Cormorant Garamond', serif;
  margin-bottom: 1.5rem;
  font-size: 1.75rem;
  color: var(--color-text-light);
  text-align: center;
}

.auth-subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  text-align: center;
  margin-bottom: 1.25rem;
}

.auth-form .form-group {
  margin-bottom: 1.25rem;
}

.auth-form label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.auth-form input {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text-light);
}

.auth-form input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--color-primary-light);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.2);
}

.auth-form .btn {
  margin-top: 0.5rem;
}

.auth-divider {
  text-align: center;
  margin: 1rem 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

.btn-google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #fff;
  color: #333;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-google:hover {
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  border-color: rgba(255, 255, 255, 0.5);
}

.auth-link {
  margin-top: 1.25rem;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
}

.auth-link a {
  color: var(--color-primary-light);
  text-decoration: none;
  font-weight: 500;
}

.auth-link a:hover {
  text-decoration: underline;
}

/* Gallery */
.gallery-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: var(--color-card-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-card-glass-border);
}

.gallery-toolbar h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.75rem;
  color: var(--color-text-light);
}

.gallery-toolbar-view-only {
  justify-content: center;
  gap: 1rem;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.upload-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.file-input {
  display: none;
}

.file-count {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.8);
  min-width: 120px;
}

.upload-hint {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: -0.5rem;
  margin-bottom: 1rem;
  text-align: center;
}

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

@media (min-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

.gallery-item {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.gallery-item-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.25rem;
  margin: 0;
}

.action-form {
  margin: 0;
}

.delete-form {
  margin: 0;
}

.btn-move {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-move:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.8);
}

.btn-move:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-delete {
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-delete:hover {
  background: var(--color-error);
  transform: scale(1.05);
}

.gallery-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto;
}

.lightbox-link {
  display: block;
  width: 100%;
  height: 100%;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  padding: 4rem 2rem;
  font-size: 1.1rem;
}

.empty-state-link {
  color: var(--color-primary-light);
  text-decoration: none;
}

.empty-state-link:hover {
  text-decoration: underline;
}

/* Thèmes - Page Home */
.themes-header {
  margin-bottom: 1.5rem;
  text-align: center;
}

.themes-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.75rem;
  color: var(--color-text-light);
  margin-bottom: 0.25rem;
}

.themes-subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
}

.theme-create-card {
  background: var(--color-card-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-card-glass-border);
  margin-bottom: 1.5rem;
  accent-color: rgba(45, 106, 79, 0.9);
}

.add-photos-section {
  accent-color: rgba(45, 106, 79, 0.9);
}

.theme-create-card h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  color: var(--color-text-light);
  margin-bottom: 1rem;
}

.theme-form .form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.theme-form input[type="text"] {
  flex: 1;
  min-width: 180px;
  padding: 0.6rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text-light);
}

.theme-form input[type="text"]:hover {
  border-color: rgba(45, 106, 79, 0.5);
}

.theme-form input[type="text"]:focus {
  outline: none;
  border-color: rgba(45, 106, 79, 0.9);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.25);
}

.theme-form input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.theme-card-wrapper {
  position: relative;
}

.theme-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--color-card-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-card-glass-border);
  text-decoration: none;
  color: var(--color-text-light);
  transition: all 0.3s ease;
  min-height: 140px;
}

.theme-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-primary-light);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.theme-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: #ffffff;
}

.theme-name {
  font-weight: 600;
  font-size: 1.1rem;
  text-align: center;
}

.theme-count {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 0.25rem;
}

.theme-badge-root {
  margin-top: 0.45rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #d8f3dc;
  background: rgba(45, 106, 79, 0.28);
  border: 1px solid rgba(149, 213, 178, 0.55);
  text-align: center;
}

.theme-card-actions {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  gap: 0.25rem;
}

.theme-delete-form {
  margin: 0;
}

.btn-edit-small,
.btn-delete-small {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.btn-edit-small {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.btn-edit-small:hover {
  background: var(--color-primary-light);
  color: var(--color-text-light);
}

.btn-delete-small:hover {
  background: var(--color-error);
}

.theme-edit-page {
  max-width: 500px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.theme-edit-card {
  background: var(--color-card-glass);
  backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1px solid var(--color-card-glass-border);
}

.theme-edit-card h1 {
  font-family: 'Cormorant Garamond', serif;
  margin-bottom: 1.5rem;
  color: var(--color-text-light);
}

.theme-edit-card .form-group {
  margin-bottom: 1.25rem;
}

.theme-edit-card label {
  display: block;
  margin-bottom: 0.35rem;
  color: rgba(255, 255, 255, 0.9);
}

.theme-edit-card input,
.theme-edit-card textarea {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-text-light);
}

.theme-edit-card textarea {
  resize: vertical;
  min-height: 80px;
}

.theme-edit-card .form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.gallery-breadcrumb {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.gallery-breadcrumb a {
  color: var(--color-primary-light);
  text-decoration: none;
}

.gallery-breadcrumb a:hover {
  text-decoration: underline;
}

.gallery-breadcrumb .separator {
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0.5rem;
}

.gallery-breadcrumb span:last-child {
  color: rgba(255, 255, 255, 0.9);
}

.theme-description {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  margin-top: -0.5rem;
  margin-bottom: 0.5rem;
}

/* Page Ajouter des photos */
.add-photos-header {
  margin-bottom: 1.5rem;
  text-align: center;
}

.add-photos-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.75rem;
  color: var(--color-text-light);
  margin-bottom: 0.25rem;
}

.add-photos-subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
}

.theme-create-card.add-photos-section {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.add-photos-card {
  background: var(--color-card-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-card-glass-border);
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 1rem;
  accent-color: rgba(45, 106, 79, 0.9);
}

.add-photos-card .form-group {
  margin-bottom: 1.25rem;
}

.add-photos-card label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.add-photos-card select {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  font-size: 1rem;
  background: #1a241e;
  color: var(--color-text-light);
  accent-color: var(--color-success);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23f8f6f0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.add-photos-card select:hover {
  border-color: rgba(45, 106, 79, 0.6);
}

.add-photos-card select:focus {
  outline: none;
  border-color: rgba(45, 106, 79, 0.9);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.25);
}

.add-photos-card select option {
  background: #1a241e;
  color: var(--color-text-light);
}

.add-photos-card select option:checked,
.add-photos-card select option:hover,
.add-photos-card select option:focus {
  background: var(--color-success) !important;
  color: var(--color-text-light);
}

.add-photos-upload {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.add-photos-upload label:focus-within,
.add-photos-upload label:hover {
  outline: none;
}

.add-photos-card .btn-primary:hover,
.add-photos-card .btn-primary:focus-visible {
  box-shadow: 0 6px 20px rgba(45, 106, 79, 0.5);
}

.add-photos-card .btn:focus-visible,
.add-photos-card label[for]:focus-visible {
  outline: 2px solid rgba(45, 106, 79, 0.9);
  outline-offset: 2px;
}

.add-photos-card .btn-block {
  margin-top: 0.5rem;
}

.add-photos-section {
  margin-bottom: 1.5rem;
}

.add-photos-card h2,
.add-photos-section h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  color: var(--color-text-light);
  margin-bottom: 1rem;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 95%;
  max-height: 95%;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  border-radius: 4px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  font-size: 2.5rem;
  color: white;
  cursor: pointer;
  z-index: 1001;
  opacity: 0.9;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 1001;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  line-height: 1;
  padding: 0;
}

.lightbox.has-nav .lightbox-prev,
.lightbox.has-nav .lightbox-next {
  display: flex;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(0, 0, 0, 0.8);
}

.lightbox-prev {
  left: 1.5rem;
}

.lightbox-next {
  right: 1.5rem;
}

.lightbox-counter {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  z-index: 1001;
}

/* Error page */
.error-page {
  text-align: center;
  padding: 4rem 2rem;
}

.error-page h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0.5rem;
}

.error-page p {
  margin-bottom: 1.5rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Footer */
.footer {
  text-align: center;
  padding: 1.25rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  margin-top: auto;
}

/* Bouton retour vers le haut */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(1rem);
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s, background 0.2s;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--color-primary-light);
}

.back-to-top:focus {
  outline: 2px solid var(--color-primary-light);
  outline-offset: 2px;
}
