/* RESET & BASE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #f4f9f4;
  color: #1a1a1a;
}

/* NAVIGATION */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #1b5e20;
  padding: 16px 40px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  font-size: 1.8rem;
  font-weight: bold;
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 3px;
}

nav ul {
  list-style: none;
  display: flex;
  gap: 30px;
}

nav ul a {
  color: white;
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.2s;
}

nav ul a:hover {
  color: #a5d6a7;
}

.btn-premium {
  background-color: #f9a825;
  color: #1a1a1a !important;
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: bold;
}

/* HERO */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 20px;
  background: linear-gradient(135deg, #2e7d32, #66bb6a);
  color: white;
  min-height: 80vh;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 20px;
}

.hero h1 span {
  color: #f9a825;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 40px;
  line-height: 1.8;
  opacity: 0.9;
}

.btn {
  background-color: #f9a825;
  color: #1a1a1a;
  padding: 14px 32px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1rem;
  transition: background 0.2s;
}

.btn:hover {
  background-color: #fbc02d;
}

/* HERO FEATURES */
.hero h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
  opacity: 0.95;
}

.hero-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin: 40px 0;
  max-width: 1000px;
  width: 100%;
}

.feature {
  text-align: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  backdrop-filter: blur(10px);
}

.feature h3 {
  color: #fff;
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.feature p {
  color: #e8f5e8;
  font-size: 0.9rem;
  line-height: 1.4;
}

.btn-secondary {
  background-color: transparent;
  border: 2px solid #f9a825;
  color: #f9a825;
}

.btn-secondary:hover {
  background-color: #f9a825;
  color: #1a1a1a;
}

/* SEO CONTENT */
.seo-content {
  padding: 60px 20px;
  background: #f9f9f9;
  color: #333;
}

.seo-content .container {
  max-width: 1000px;
  margin: 0 auto;
}

.seo-content h2 {
  text-align: center;
  color: #1b5e20;
  margin-bottom: 40px;
  font-size: 2rem;
}

.seo-section {
  margin-bottom: 40px;
}

.seo-section h3 {
  color: #2e7d32;
  margin-bottom: 15px;
  font-size: 1.3rem;
}

.seo-section p {
  line-height: 1.6;
  font-size: 1rem;
  margin-bottom: 20px;
}

.seo-keywords {
  background: white;
  padding: 30px;
  border-radius: 10px;
  border-left: 5px solid #1b5e20;
  margin-top: 40px;
}

.seo-keywords h3 {
  color: #1b5e20;
  margin-bottom: 15px;
}

.seo-keywords p {
  line-height: 1.5;
  color: #555;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .hero-features {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .seo-content h2 {
    font-size: 1.5rem;
  }

  .seo-section h3 {
    font-size: 1.1rem;
  }
}

/* PAGE BIBLIOTHEQUE */
.library-section {
  padding: 60px 40px;
}

.library-section h1 {
  text-align: center;
  margin-bottom: 40px;
  font-size: 2.5rem;
  color: #1b5e20;
}

/* Cartes formats */
.game-formats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 50px;
}

.format-card {
  background: #2e7d32;
  color: white;
  padding: 25px 35px;
  border-radius: 15px;
  font-size: 1.4rem;
  text-align: center;
  text-decoration: none;
  font-weight: bold;
  transition: transform 0.2s, background 0.2s;
}

.format-card span {
  font-size: 0.9rem;
  opacity: 0.85;
}

.format-card:hover {
  background: #388e3c;
  transform: scale(1.05);
}

/* Thèmes */
h2 {
  color: #2e7d32;
  margin-top: 40px;
  margin-bottom: 15px;
}

.themes {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 40px;
}

.theme {
  background: #a5d6a7;
  padding: 12px 20px;
  border-radius: 20px;
  font-weight: bold;
  color: #1b5e20;
  cursor: pointer;
  transition: background 0.2s;
}

.theme:hover {
  background: #81c784;
}

/* PAGE CREER UN EXERCICE */
.create-section {
  padding: 40px 20px;
  margin: 0 auto;
}

.create-section h1 {
  text-align: center;
  color: #1b5e20;
  margin-bottom: 30px;
  font-size: 2.2rem;
}

.create-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

/* SCHEMA PART */
.schema-part {
  background: white;
  padding: 20px;
  border-radius: 10px;
  border: 2px solid #e0e0e0;
  width: 100%;
}

.schema-part h2 {
  display: none;
}

/* TOOLS SECTION */
.tools-section {
  background: #f5f5f5;
  padding: 12px;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
  margin-bottom: 20px;
}

.canvas-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

#terrainCanvas,
#terrainCanvas2 {
  border: 3px solid #1b5e20;
  border-radius: 10px;
  width: 100%;
  height: auto;
  background: #4caf50;
  cursor: crosshair;
  display: block;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
  gap: 6px;
  background: transparent;
  padding: 0;
  border-radius: 0;
  max-height: none;
  overflow-y: visible;
}

.tools h3 {
  display: none;
}

.rotation-control {
  display: flex;
  gap: 3px;
  align-items: center;
}

.rotation-display {
  background: #2e7d32;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
  font-size: 0.75rem;
  text-align: center;
  min-width: 35px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-btn {
  padding: 6px;
  border: 2px solid #2e7d32;
  background: white;
  color: #2e7d32;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1rem;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  width: 100%;
}

.tool-btn:hover {
  background: #f1f5f1;
  transform: translateX(2px);
}

.tool-btn.active {
  background: #2e7d32;
  color: white;
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3);
}

.tool-btn.danger {
  border-color: #d32f2f;
  color: #d32f2f;
}

.tool-btn.danger:hover {
  background: #ffebee;
}

.tool-btn.danger.active {
  background: #d32f2f;
  color: white;
}

.text-zone-input {
  position: absolute;
  display: none;
  z-index: 20;
  padding: 8px 10px;
  border: 1px solid #333;
  border-radius: 8px;
  background: white;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
  font-size: 0.95rem;
  min-width: 180px;
}

.nav-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: white;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.account-status {
  margin: 16px 0;
  padding: 14px 18px;
  border-radius: 12px;
  background: #eef7ef;
  border: 1px solid #c7e5c4;
  color: #1b5e20;
  font-weight: 600;
}

.auth-modal-content {
  max-width: 500px;
  padding: 30px;
}

.auth-section {
  display: none;
}

.auth-section h2 {
  margin-bottom: 18px;
  color: #2e7d32;
}

.auth-error {
  color: #d32f2f;
  margin: 10px 0 0;
}

.comment-section,
.comments-section {
  margin-top: 24px;
}

.comment-section h3,
.comments-section h3 {
  margin-bottom: 14px;
  color: #2e7d32;
}

.comments-list {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.comment,
.comment-item {
  background: #f5f7f5;
  border: 1px solid #d7e6d1;
  border-radius: 12px;
  padding: 14px 16px;
}

.comment strong,
.comment-item .comment-author {
  font-weight: 700;
  color: #1b5e20;
}

.comment-item .comment-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  color: #1b5e20;
}

.comment-item .comment-text {
  margin: 0;
  color: #333;
}

.comment small {
  color: #666;
}

.comment-form textarea {
  width: 100%;
  min-height: 100px;
  border: 1px solid #ccc;
  border-radius: 12px;
  padding: 12px;
  font-size: 1rem;
  resize: vertical;
}

.comment-form button {
  margin-top: 12px;
}

.comment-login {
  margin-top: 16px;
  background: #fff7e0;
  border: 1px solid #ffd699;
  border-radius: 12px;
  padding: 16px;
  color: #6a4a00;
}

.comment-login p {
  margin: 0 0 10px;
}

.comment-login button {
  margin-top: 0;
}

/* FORM PART */
.form-part {
  position: static;
  background: #f5f5f5;
  padding: 20px;
  border-radius: 10px;
  border: 2px solid #e0e0e0;
  width: 100%;
}

.form-part h2 {
  display: none;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  color: #1b5e20;
  font-weight: bold;
  margin-bottom: 5px;
  font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-family: 'Segoe UI', sans-serif;
  font-size: 0.9rem;
  transition: border 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #2e7d32;
  box-shadow: 0 0 5px rgba(46, 125, 50, 0.2);
}

.form-group textarea {
  resize: vertical;
  min-height: 60px;
}

.btn-submit {
  width: 100%;
  padding: 12px;
  background: #2e7d32;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 10px;
}

.btn-submit:hover {
  background: #1b5e20;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.btn-publish {
  flex: 1;
  padding: 12px;
  background: #2196f3;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-publish:hover {
  background: #1976d2;
}

/* RESPONSIVE */
@media (max-width: 1200px) {
  .schema-part,
  .form-part {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .create-section {
    padding: 20px;
  }
  
  #terrainCanvas,
  #terrainCanvas2 {
    max-width: 100%;
  }
  
  .tools {
    grid-template-columns: repeat(auto-fit, minmax(38px, 1fr));
    gap: 5px;
  }
}

/* PAGE COMMUNAUTE */
.community-section {
  padding: 40px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

/* AUTH MODAL */
.auth-modal-content {
  max-width: 500px;
  width: 90%;
}

.auth-section {
  display: none;
}

.auth-section h2 {
  color: #1b5e20;
  margin-bottom: 20px;
  text-align: center;
}

.auth-section h3 {
  color: #2e7d32;
  margin-bottom: 15px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #333;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 10px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  box-sizing: border-box;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.auth-error {
  color: #d32f2f;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.btn-primary, .btn-secondary {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-right: 10px;
}

.btn-primary {
  background-color: #1b5e20;
  color: white;
}

.btn-primary:hover {
  background-color: #0d4f0f;
}

.btn-secondary {
  background-color: #f5f5f5;
  color: #333;
  border: 1px solid #ddd;
}

.btn-secondary:hover {
  background-color: #e0e0e0;
}

/* PROFILE STYLES */
.profile-view {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.profile-avatar-section {
  text-align: center;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #1b5e20;
  margin-bottom: 10px;
}

.profile-info p {
  margin-bottom: 10px;
}

.profile-bio {
  background: #f9f9f9;
  padding: 10px;
  border-radius: 5px;
  font-style: italic;
  margin-top: 5px;
}

.profile-edit {
  background: #f9f9f9;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.profile-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* USER SEARCH */
.user-search {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
}

.user-search .search-bar {
  flex: 1;
}

.user-results {
  margin-bottom: 30px;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 10px;
  border: 1px solid #ddd;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: white;
  border-radius: 8px;
  margin-bottom: 10px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.user-profile img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #ddd;
}

.user-info h4 {
  margin: 0 0 5px;
  color: #2e7d32;
}

.user-info p {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

.user-bio {
  font-style: italic;
  margin-top: 5px;
  color: #555;
  font-size: 0.85rem;
  line-height: 1.3;
}

.user-stats {
  margin-left: auto;
  text-align: right;
}

.user-stats .stat {
  display: block;
  font-weight: bold;
  color: #1b5e20;
}

.user-stats .stat-label {
  font-weight: normal;
  color: #666;
  font-size: 0.8rem;
}

.filters {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.search-bar, .filter-select, .tag-filter {
  padding: 10px 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
}

.search-bar {
  flex: 1;
  min-width: 250px;
}

.filter-select, .tag-filter {
  min-width: 150px;
}

.exercises-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.exercise-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.exercise-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.exercise-schema {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #f5f5f5;
}

.exercise-info {
  padding: 15px;
}

.exercise-title {
  font-size: 1.2rem;
  font-weight: bold;
  color: #2e7d32;
  margin-bottom: 8px;
  display: block;
}

.exercise-author {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.exercise-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.tag {
  background: #e8f5e8;
  color: #2e7d32;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.exercise-category {
  color: #666;
  font-size: 0.9rem;
  font-weight: 500;
}

.no-exercises {
  text-align: center;
  padding: 50px 20px;
  color: #666;
}

.btn-primary {
  display: inline-block;
  padding: 12px 24px;
  background: #2e7d32;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #1b5e20;
}

/* MODAL */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: white;
  margin: 5% auto;
  padding: 0;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.close-modal {
  position: absolute;
  right: 20px;
  top: 15px;
  font-size: 28px;
  font-weight: bold;
  color: #666;
  cursor: pointer;
  z-index: 1001;
}

.close-modal:hover {
  color: #333;
}

.exercise-detail {
  padding: 30px;
}

.exercise-detail h2 {
  color: #2e7d32;
  margin-bottom: 20px;
}

.exercise-detail-schema {
  width: 100%;
  max-width: 400px;
  margin: 20px 0;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.exercise-detail-info {
  margin: 20px 0;
}

.exercise-detail-info p {
  margin-bottom: 10px;
  line-height: 1.6;
}

.exercise-detail-info strong {
  color: #2e7d32;
}

/* PAGE BIBLIOTHEQUE */
.library-section {
  padding: 40px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.library-section h1 {
  text-align: center;
  color: #1b5e20;
  margin-bottom: 40px;
  font-size: 2.2rem;
}

.game-formats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 50px;
}

.format-card {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: white;
  padding: 25px 30px;
  border-radius: 15px;
  text-decoration: none;
  text-align: center;
  font-weight: bold;
  font-size: 1.2rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, box-shadow 0.2s;
}

.format-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.format-card span {
  display: block;
  font-size: 0.9rem;
  font-weight: normal;
  margin-top: 5px;
}

.library-section h2 {
  color: #2e7d32;
  margin: 40px 0 20px 0;
  font-size: 1.8rem;
  border-bottom: 3px solid #4caf50;
  padding-bottom: 10px;
}

.themes {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 40px;
}

.theme {
  background: #a5d6a7;
  padding: 12px 20px;
  border-radius: 20px;
  font-weight: bold;
  color: #1b5e20;
  cursor: pointer;
  transition: background 0.2s;
}

.theme:hover {
  background: #81c784;
}

.exercises-display {
  margin-top: 30px;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 12px;
  border: 2px solid #e0e0e0;
}

.exercises-display h3 {
  color: #2e7d32;
  margin-bottom: 20px;
  font-size: 1.4rem;
}

.exercises-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

.exercise-card-lib {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.exercise-card-lib:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.exercise-header {
  padding: 15px;
  background: #f5f5f5;
}

.exercise-header h4 {
  margin: 0 0 10px 0;
  color: #2e7d32;
  font-size: 1.1rem;
}

.exercise-meta {
  display: flex;
  gap: 15px;
  font-size: 0.9rem;
  color: #666;
}

.exercise-schema {
  padding: 15px;
  text-align: center;
  background: #fafafa;
}

.exercise-content {
  padding: 15px;
}

.exercise-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.exercise-consignes,
.exercise-objectifs,
.exercise-variantes {
  margin-bottom: 10px;
  line-height: 1.4;
}

.exercise-consignes strong,
.exercise-objectifs strong,
.exercise-variantes strong {
  color: #2e7d32;
}

.exercise-actions {
  padding: 15px;
  background: #f5f5f5;
  text-align: center;
}

.btn-use-exercise {
  background: #2196f3;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-use-exercise:hover {
  background: #1976d2;
}

.exercise-likes {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.like-btn {
  background: #f5f5f5;
  border: 2px solid #ddd;
  color: #666;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.like-btn:hover {
  border-color: #ff6b6b;
  color: #ff6b6b;
}

.like-btn.liked {
  background: #ffe0e0;
  border-color: #ff6b6b;
  color: #ff6b6b;
}

.likes-count {
  color: #666;
  font-size: 0.85rem;
  font-weight: 500;
}
