* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #1a1a2e;
  color: #eee;
  line-height: 1.5;
  min-height: 100vh;
}
header {
  background: linear-gradient(135deg, #16213e 0%, #0f3460 100%);
  padding: 2rem;
  text-align: center;
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.btn-lang {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  background: #0f3460;
  color: #cbd5e1;
  border: 1px solid #334155;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-lang:hover {
  background: #1e3a5f;
  color: #fff;
}
.btn-login,
.btn-stats {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  background: #0f3460;
  color: #cbd5e1;
  border: 1px solid #334155;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-login:hover,
.btn-stats:hover {
  background: #1e3a5f;
  color: #fff;
}
header h1 {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
}
header p {
  color: #94a3b8;
  font-size: 0.95rem;
}
main {
  max-width: 100%;
  margin: 0 auto;
  padding: 1rem;
}
.main-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}
.nav-cards {
  flex-shrink: 0;
  width: 200px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.nav-group-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin: 0.75rem 0 0.25rem;
  padding: 0 0.25rem;
}
.nav-group-label:first-child {
  margin-top: 0;
}
.nav-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 12px;
  text-decoration: none;
  color: #eee;
  font-size: 0.95rem;
  transition: all 0.2s;
}
.nav-card-transparent {
  background: rgba(22, 33, 62, 0.6);
  border: 1px solid rgba(15, 52, 96, 0.8);
  backdrop-filter: blur(8px);
}
.nav-card-transparent:hover {
  background: rgba(30, 58, 95, 0.8);
  border-color: #334155;
}
.nav-card-icon {
  font-size: 1.25rem;
}
.content-area {
  flex: 1;
  min-width: 0;
}

/* Grille cartes carrées — 3 par ligne */
.event-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.event-card-square {
  aspect-ratio: 1;
  background: rgba(22, 33, 62, 0.9);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #0f3460;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s;
}
.event-card-square:hover {
  border-color: #334155;
}
.event-card-img {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f3460;
  padding: 0.5rem;
}
.event-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.event-card-body {
  padding: 1rem;
  flex-shrink: 0;
}
.event-card-body h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.event-card-body p {
  font-size: 0.85rem;
  color: #cbd5e1;
  margin: 0;
  line-height: 1.4;
}
footer {
  text-align: center;
  padding: 2rem;
  color: #64748b;
  font-size: 0.85rem;
}
.events-section {
  margin-bottom: 2.5rem;
  scroll-margin-top: 1rem;
}
.discord-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.discord-section {
  margin-bottom: 0;
}
.section-title {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}
.section-hint {
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 1rem;
}
.events-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.events-list:empty::after {
  content: none;
}

.event-card-square.clickable {
  cursor: pointer;
}

/* Modal vue événement */
.modal-view-content {
  position: relative;
  background: #16213e;
  border-radius: 12px;
  padding: 2rem;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  font-size: 1.5rem;
  background: #334155;
  border: none;
  border-radius: 8px;
  color: #eee;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover {
  background: #475569;
}
.modal-view-img-wrap {
  position: relative;
  margin-bottom: 1.5rem;
  border-radius: 12px;
  overflow: hidden;
  background: #0f3460;
}
.modal-view-img-wrap img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  display: block;
  cursor: zoom-in;
}
.btn-zoom {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: #fff;
}
.btn-zoom:hover {
  background: rgba(0, 0, 0, 0.8);
}
.modal-view-body h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}
.desc-tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}
.desc-tab {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  background: #334155;
  border: none;
  border-radius: 6px;
  color: #cbd5e1;
  cursor: pointer;
}
.desc-tab:hover,
.desc-tab.active {
  background: #0f3460;
  color: #fff;
}
.desc-content {
  font-size: 0.95rem;
  color: #cbd5e1;
  line-height: 1.6;
  margin: 0;
}
.view-add-btn {
  margin-top: 1.5rem;
}
.btn-add-from-view {
  padding: 0.6rem 1.2rem;
  background: #0f3460;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
}
.btn-add-from-view:hover {
  background: #1e3a5f;
}

/* Lightbox zoom */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  font-size: 2rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  line-height: 1;
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}
.lightbox img {
  max-width: 95%;
  max-height: 90vh;
  object-fit: contain;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-content {
  position: relative;
  background: #16213e;
  border-radius: 12px;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-content h2 {
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}
.modal-section-info-content {
  position: relative;
  padding-top: 0.5rem;
}
.modal-section-info-content .modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
}
.modal-section-info-content h2 {
  padding-right: 2.5rem;
}
.section-info-hint {
  color: #94a3b8;
  font-size: 0.95rem;
  margin: 0 0 1rem 0;
}
.modal-section-info-content #btn-section-info-ok {
  margin-top: 0.5rem;
}
.form-row {
  margin-bottom: 1rem;
}
.form-row label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
  color: #cbd5e1;
}
.form-row input[type="text"],
.form-row input[type="number"],
.form-row input[type="file"],
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #0f3460;
  color: #eee;
}
.form-row textarea {
  resize: vertical;
  min-height: 60px;
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}
.form-actions button {
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
}
.btn-cancel {
  background: #334155;
  color: #cbd5e1;
  border: none;
}
.btn-cancel:hover {
  background: #475569;
}
.form-actions button[type="submit"] {
  background: #0f3460;
  color: #fff;
  border: none;
}
.form-actions button[type="submit"]:hover {
  background: #1e3a5f;
}
.btn-publish-discord {
  background: #5865f2;
  color: #fff;
  border: none;
}
.btn-publish-discord:hover:not(:disabled) {
  background: #4752c4;
}
.btn-publish-discord:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.discord-feed {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.discord-msg {
  background: rgba(22, 33, 62, 0.9);
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid #0f3460;
}
.discord-author {
  font-weight: 600;
  color: #5865f2;
}
.discord-time {
  font-size: 0.8rem;
  color: #64748b;
  margin-left: 0.5rem;
}
.discord-content {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: #cbd5e1;
  white-space: pre-wrap;
  word-break: break-word;
}
.discord-empty {
  color: #64748b;
  font-size: 0.9rem;
}

.event-instance {
  background: #16213e;
  border-radius: 12px;
  padding: 1rem;
  border: 1px solid #0f3460;
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1rem;
  align-items: center;
}
.event-instance .event-img {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
}
.event-instance img {
  max-width: 80px;
  max-height: 80px;
  object-fit: contain;
  border-radius: 6px;
}
.event-instance-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  background: #334155;
}
.event-instance-actions {
  margin-top: 0.5rem;
}
.event-instance-actions button {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  margin-right: 0.5rem;
  cursor: pointer;
  background: #0f3460;
  color: #fff;
  border: none;
  border-radius: 4px;
}

/* ========== RESPONSIVE ========== */

/* --- Mobile portrait (< 480px) --- */
@media (max-width: 479px) {
  header {
    padding: 1rem;
  }
  header h1 {
    font-size: 1.25rem;
  }
  header p {
    font-size: 0.85rem;
  }
  .header-top {
    gap: 0.5rem;
  }
  .btn-lang,
  .btn-login,
  .btn-stats {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    min-height: 44px;
  }
  main {
    padding: 1rem 0.75rem;
  }
  .main-layout {
    flex-direction: column;
    gap: 1rem;
  }
  .nav-cards {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  .nav-group-label {
    flex-basis: 100%;
    text-align: center;
    margin: 0.5rem 0 0.2rem;
  }
  .nav-card {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    min-height: 44px;
  }
  .event-cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .event-card-body {
    padding: 0.75rem;
  }
  .event-card-body h3 {
    font-size: 0.95rem;
  }
  .event-card-body p {
    font-size: 0.8rem;
  }
  .section-title {
    font-size: 1.1rem;
  }
  .events-section {
    margin-bottom: 1.5rem;
  }
  .discord-block {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .event-instance {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 0.75rem;
  }
  .event-instance .event-img {
    min-width: 60px;
  }
  .event-instance img {
    max-width: 60px;
    max-height: 60px;
  }
  .modal-view-content,
  .modal-content {
    padding: 1.25rem;
    max-height: 85vh;
  }
  .modal-view-img-wrap img {
    max-height: 220px;
  }
  .form-actions {
    flex-direction: column;
  }
  .form-actions button {
    width: 100%;
  }
  footer {
    padding: 1rem;
    font-size: 0.8rem;
  }
}

/* --- Mobile landscape (480–767px) --- */
@media (min-width: 480px) and (max-width: 767px) {
  header {
    padding: 1rem 1.5rem;
  }
  main {
    padding: 1rem;
  }
  .main-layout {
    flex-direction: column;
    gap: 1rem;
  }
  .nav-cards {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
  }
  .nav-group-label {
    flex-basis: 100%;
    text-align: center;
  }
  .event-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .discord-block {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .event-instance {
    grid-template-columns: 80px 1fr;
  }
}
@media (max-width: 767px) and (orientation: landscape) {
  header {
    padding: 0.75rem 1rem;
  }
  header h1 {
    font-size: 1.15rem;
  }
  main {
    padding: 0.75rem;
  }
  .events-section {
    margin-bottom: 1.25rem;
  }
  .discord-block {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .event-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Tablet portrait (768–1023px) --- */
@media (min-width: 768px) and (max-width: 1023px) {
  main {
    padding: 1.5rem;
    max-width: 100%;
  }
  .main-layout {
    gap: 1.5rem;
  }
  .nav-cards {
    width: 180px;
  }
  .event-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
  .discord-block {
    grid-template-columns: 1fr;
  }
}

/* --- Tablet landscape (1024–1279px) --- */
@media (min-width: 1024px) and (max-width: 1279px) {
  main {
    padding: 1.5rem 2rem;
    max-width: 1200px;
  }
  .main-layout {
    gap: 1.75rem;
  }
  .nav-cards {
    width: 200px;
  }
  .event-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .discord-block {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
}

/* --- Desktop 17" (1280–1439px) --- */
@media (min-width: 1280px) and (max-width: 1439px) {
  main {
    padding: 2rem;
    max-width: 1280px;
  }
  .main-layout {
    gap: 2rem;
  }
  .nav-cards {
    width: 220px;
  }
  .event-cards-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
  .discord-block {
    gap: 2rem;
  }
}

/* --- Desktop 18–19" (1440–1599px) --- */
@media (min-width: 1440px) and (max-width: 1599px) {
  main {
    padding: 2rem;
    max-width: 1400px;
  }
  .main-layout {
    gap: 2rem;
  }
  .nav-cards {
    width: 230px;
  }
  .event-cards-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
  }
}

/* --- Desktop 20" (1600–1919px) --- */
@media (min-width: 1600px) and (max-width: 1919px) {
  main {
    padding: 2rem;
    max-width: 1560px;
  }
  .nav-cards {
    width: 240px;
  }
  .event-cards-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
}

/* --- Desktop 21–32" (≥ 1920px) --- */
@media (min-width: 1920px) {
  main {
    padding: 2.5rem;
    max-width: 1800px;
  }
  .main-layout {
    gap: 2.5rem;
  }
  .nav-cards {
    width: 260px;
  }
  .nav-card {
    padding: 1rem 1.25rem;
    font-size: 1rem;
  }
  .event-cards-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.75rem;
  }
  .event-card-body h3 {
    font-size: 1.05rem;
  }
  .event-card-body p {
    font-size: 0.9rem;
  }
  .section-title {
    font-size: 1.35rem;
  }
  .discord-block {
    gap: 2.5rem;
  }
  .discord-msg {
    padding: 1.25rem;
  }
}
