/* 
Style sheet for La Cueillette Citoyenne
Features:
- Responsive design for mobile and desktop
- Consistent color scheme and typography
- Mobile-first approach
- Vote status indicators
- White-dominant design with subtle yellow accents
*/

/* Variables */
:root {
  --primary-color: #F0f050; /* Slightly less flashy yellow */
  --secondary-color: #E0B000; /* Darker amber yellow */
  --accent-color: #E08800; /* Less flashy orange */
  --light-color: #FFFFFF; /* White */
  --dark-color: #333333; /* Dark gray */
  --success-color: #28a745; /* Green */
  --warning-color: #FFC107; /* Yellow */
  --danger-color: #dc3545; /* Red */
  --text-color: #333333;
  --header-bg: #FFF9E6; /* Subtle yellow for header */
  --border-radius: 4px;
  --box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  --transition: all 0.3s ease;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: #FCFCFC;
  padding-bottom: 2rem;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.25;
}

h1 {
  font-size: 1.75rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.25rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-color);
}

small {
  font-size: 0.875rem;
  color: var(--text-color);
}

/* Buttons */
.btn {
  display: inline-block;
  background-color: var(--primary-color);
  color: var(--dark-color);
  padding: 0.5rem 1rem;
  margin: 0.25rem;
  border-radius: var(--border-radius);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  font-size: 1rem;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  width: max-content;
}

.btn:hover {
  background-color: var(--secondary-color);
  color: var(--dark-color);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--dark-color);
}

.btn-primary:hover {
  background-color: var(--secondary-color);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--primary-color);
  color: var(--dark-color);
  opacity: 1;
}

.btn-outline:hover {
  background-color: rgba(230, 184, 0, 0.15);
  color: var(--dark-color);
  border-color: var(--secondary-color);
}

.btn-small {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.btn-admin {
  background-color: var(--accent-color);
  color: white;
}

.btn-admin:hover {
  background-color: #e08600;
}

.btn-danger {
  background-color: var(--danger-color);
  color: white;
}

.btn-danger:hover {
  background-color: #b02a37;
  color: white;
}

/* Forms */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

input, textarea, select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-family: inherit;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(230, 184, 0, 0.15);
}

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

.help-text {
  color: #666;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Header */
header {
  background-color: var(--header-bg);
  color: var(--dark-color);
  padding: 1rem 0;
  box-shadow: var(--box-shadow);
  border-bottom: 3px solid var(--primary-color);
  margin-bottom: 2rem;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

header h1 {
  font-size: 1.5rem;
  margin: 0;
}

header h1 a {
  color: var(--dark-color);
  text-decoration: none;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.home-link {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
}

.home-link:hover {
  color: var(--accent-color);
  text-decoration: none;
}

.user-actions {
  display: flex;
  gap: 0.5rem;
}

/* Notification */
.notification {
  padding: 1rem;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  background-color: #FFF8E1;
  border-left: 4px solid var(--primary-color);
}

.notification.warning {
  background-color: #FFF3CD;
  border-left: 4px solid var(--warning-color);
}

/* Profile Notification */
.profile-notification {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--header-bg);
  color: var(--dark-color);
  padding: 1rem;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  box-shadow: var(--box-shadow);
  border-left: 4px solid var(--warning-color);
  animation: fadeIn 0.5s ease-in-out;
}

.notification-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.notification-content p {
  margin: 0;
}

.notification-content a {
  align-self: flex-start;
}

.notification-close {
  background: none;
  border: none;
  color: var(--dark-color);
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Proposals */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.proposal-card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border-left: 3px solid var(--primary-color);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.proposal-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.proposal-meta {
  display: flex;
  gap: 1rem;
  color: var(--text-color);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.proposal-content {
  margin-bottom: 1.5rem;
}

.proposal-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.votes {
  display: flex;
  gap: 1rem;
}

.vote-form {
  display: inline;
}

.vote-btn {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  gap: 0.25rem;
  font-size: 1rem;
  color: var(--text-color);
  transition: color 0.2s;
}

.vote-btn:hover {
  color: var(--text-color);
}

.vote-btn.upvote.active {
  color: var(--success-color);
}

.vote-btn.downvote.active {
  color: var(--accent-color);
}

.vote-count {
  font-weight: 600;
}

.votes-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.vote-status {
  display: flex;
  flex-direction: column;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.vote-status.condensed {
  margin-top: 0.25rem;
  font-size: 0.75rem;
}

.vote-message {
  color: var(--text-color);
  font-style: italic;
}

.vote-message.vote-up {
  color: var(--success-color);
}

.vote-message.vote-down {
  color: var(--accent-color);
}

.vote-stats {
  color: var(--text-color);
  margin-top: 0.25rem;
}

/* Comments */
.comments-section {
  margin-top: 2rem;
}

.comments-list {
  margin-bottom: 1.5rem;
  padding: 1.5rem;
}

.comment {
  background-color: #FAFAFA;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 1rem;
  margin-bottom: 1rem;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  color: var(--text-color);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.comment-content p {
  margin-bottom: 0;
}

/* Admin */
.user-creation-section {
  margin-bottom: 2rem;
}

.qr-container {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border-top: 3px solid var(--primary-color);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.user-details {
  margin-bottom: 1.5rem;
}

.qr-code-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.qr-code-card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  text-align: center;
}

.qr-code-card h3 {
  margin-bottom: 1rem;
}

.qr-code-card #qrCode {
  margin: 2rem 0;
}

.qr-code-card .note {
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: #666;
}

.qr-code-container {
  text-align: center;
  margin-bottom: 1.5rem;
}

.btn-container {
  text-align: center;
}

.table-container {
  overflow-x: auto;
}

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

.users-table th,
.users-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.users-table th {
  font-weight: 600;
  background-color: #FFF8E1;
}

/* Profile */
.profile-details {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border-top: 3px solid var(--primary-color);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.detail-item {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
}

.detail-label {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-color);
}

/* Media queries */
@media (min-width: 768px) {
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
  
  h3 {
    font-size: 1.5rem;
  }
  
  .header-content {
    flex-direction: row;
    align-items: center;
  }
  
  .detail-item {
    flex-direction: row;
    gap: 1rem;
  }
  
  .detail-label {
    min-width: 120px;
    margin-bottom: 0;
  }
  
  .user-info {
    margin-top: 0;
  }
  
  /* Add horizontal layout rules for wider screens */
  .vote-options {
    flex-direction: row;
    flex-wrap: nowrap; /* Prevent wrapping */
    overflow-x: auto;  /* Add scroll if needed */
    padding-bottom: 5px; /* Add slight padding for scrollbar */
  }
  
  .vote-option {
    flex: 0 0 auto; /* Let items take natural width */
  }
}

@media (max-width: 767px) {
  header .container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .user-info {
    margin-top: 1rem;
    flex-wrap: wrap;
  }
  
  .admin-actions {
    flex-direction: column;
  }
  
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* Messages d'erreur */
.error-message {
  background-color: rgba(220, 53, 69, 0.1);
  color: var(--danger-color);
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--danger-color);
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

/* Cartes et conteneurs */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 0;
}

.auth-card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border-top: 3px solid var(--primary-color);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
}

.auth-card h2 {
  margin-bottom: 1.5rem;
  text-align: center;
}

.proposition-card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border-left: 3px solid var(--primary-color);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.proposition-card h3 {
  margin-bottom: 0.5rem;
  color: var(--dark-color);
}

.proposition-meta {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.proposition-content {
  margin-bottom: 1rem;
}

.proposition-actions {
  margin-top: 1rem;
}

.profile-container, .proposition-form {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border-top: 3px solid var(--primary-color);
  padding: 2rem;
  max-width: 600px;
  margin: 0 auto;
}

.profile-container h2, .proposition-form h2 {
  margin-bottom: 1.5rem;
}

/* Pages d'administration */
.admin-container {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border-top: 3px solid var(--primary-color);
  padding: 2rem;
  margin-bottom: 2rem;
}

.admin-container h2 {
  margin-bottom: 1.5rem;
}

.admin-actions {
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.users-list h3 {
  margin-bottom: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #FFF0C0;
}

th {
  background-color: #FFF8E1;
  font-weight: 600;
}

.qr-code-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.qr-code-card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  text-align: center;
}

.qr-code-card h3 {
  margin-bottom: 1rem;
}

.qr-code-card #qrCode {
  margin: 2rem 0;
}

.qr-code-card .note {
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  color: #666;
}

/* Détails de proposition */
.proposition-detail {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border-left: 3px solid var(--primary-color);
  padding: 2rem;
}

.proposition-header {
  margin-bottom: 1.5rem;
}

.proposition-header h2 {
  margin-bottom: 0.5rem;
  color: var(--dark-color);
}

.suggestions-section, .comments-section {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--primary-color);
}

.suggestions-section h3, .comments-section h3 {
  margin-bottom: 1.5rem;
}

.suggestion-item {
  background-color: #FAFAFA;
  border-radius: var(--border-radius);
  border-left: 2px solid var(--primary-color);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.suggestion-content {
  margin-bottom: 1rem;
}

.suggestion-meta {
  font-size: 0.875rem;
  color: #666;
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.voting-section {
  padding-top: 1rem;
  border-top: 1px solid var(--primary-color);
}

.vote-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.vote-option {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
  cursor: pointer;
  margin-bottom: 0px; /* Add some space between options */
  padding-bottom: 0px;
}

.vote-option.selected {
  background-color: rgba(230, 184, 0, 0.1);
}

.vote-option input {
  width: auto;
  margin-right: 0.5rem;
}

/* Container for label + percentage */
.vote-option-container {
  margin-bottom: 0px; /* Add some space between options */
  padding-bottom: 0px;
}

/* Style for the percentage display */
.vote-percentage {
  display: none; /* Hidden by default */
  font-size: 0.85em;
  color: #555;
  margin-left: 20px; /* Indent below the radio button */
  text-align: center;
}

.vote-percentage.visible {
  display: block; /* Shown by JS when votes are revealed */
}

.comment-item {
  background-color: #FAFAFA;
  border-radius: var(--border-radius);
  border-left: 2px solid var(--primary-color);
  margin-bottom: 1.5rem;
  transition: all 0.2s ease;
  padding-left: 1.5rem;
}

.comment-item.depth-0 {
  margin-left: 0;
}

.comment-item.depth-1 {
  margin-left: 2rem;
}

.comment-item.depth-2 {
  margin-left: 4rem;
}

.comment-item.depth-3 {
  margin-left: 6rem;
}

.comment-item.depth-4 {
  margin-left: 8rem;
}

.comment-item.depth-5 {
  margin-left: 10rem;
}

.comment-content {
  margin-bottom: 0.5rem;
}

.comment-meta {
  font-size: 0.875rem;
  color: #666;
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.reply-btn {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.reply-form {
  margin-top: 1rem;
  padding: 1rem;
  background-color: #f5f5f5;
  border-radius: var(--border-radius);
  border-left: 2px solid var(--primary-color);
}

.reply-form textarea {
  min-height: 60px;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.reply-container {
  margin-top: 1rem;
}

.add-suggestion, .add-comment {
  margin-top: 2rem;
}

.add-suggestion h4, .add-comment h4 {
  margin-bottom: 1rem;
}

.back-link {
  margin-top: 2rem;
  text-align: center;
}

.no-content {
  text-align: center;
  padding: 2rem;
  color: #666;
}

/* Mobile adjustments for comment indentation */
@media (max-width: 767px) {
  .comment-item.depth-1 { margin-left: 1rem; }
  .comment-item.depth-2 { margin-left: 1.5rem; }
  .comment-item.depth-3 { margin-left: 2rem; }
  .comment-item.depth-4 { margin-left: 2.5rem; }
  .comment-item.depth-5 { margin-left: 3rem; }
}

/* Responsive */
@media (min-width: 1000px) {
  /* Add horizontal layout rules for wider screens */
  .vote-options {
    flex-direction: row;
    flex-wrap: nowrap; /* Prevent wrapping */
    overflow-x: auto;  /* Add scroll if needed */
    padding-bottom: 5px; /* Add slight padding for scrollbar */
  }
  
  .vote-option {
    flex: 0 0 auto; /* Let items take natural width */
  }
}

@media (max-width: 767px) {
  header .container {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .user-info {
    margin-top: 1rem;
    flex-wrap: wrap;
  }
  
  .admin-actions {
    flex-direction: column;
  }
  
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

.suggestion-preview {
  font-size: 0.8rem;
  color: #666;
  margin-left: 1rem;
  max-width: 50%; /* Limit width */
  border-left: 1px solid #eee;
  padding-left: 1rem;
}

.suggestion-preview ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.suggestion-preview li {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.2rem;
}

/* Login Banner */
.login-banner {
    background-color: #FFF8E1;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.login-banner p {
    margin: 0;
    flex: 1;
}

.login-banner .btn {
    white-space: nowrap;
}

/* Read-only votes display */
.read-only-votes {
    background-color: #FFF8E1;
    border-radius: 5px;
    padding: 15px;
    margin-top: 10px;
}

.read-only-votes p {
    margin-top: 0;
}

.read-only-votes ul {
    margin: 0;
    padding-left: 20px;
}

.read-only-votes li {
    margin-bottom: 5px;
}

footer {
  margin-top: 3rem;
  padding: 1.5rem 0;
  background-color: var(--light-color);
  border-top: 3px solid var(--primary-color);
  color: var(--dark-color);
}

.home-container {
  background-color: var(--light-color);
  padding: 1rem 0;
}

.site-text-block {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  border-left: 3px solid var(--primary-color);
}

.vote-option:hover {
  background-color: rgba(230, 184, 0, 0.05);
}

/* Hidden Proposition Styles */
.proposition-hidden {
  opacity: 0.7; /* Make the whole card slightly faded */
  border-left-color: var(--dark-color); /* Change border color to indicate status */
}

.proposition-hidden .hidden-title a,
.proposition-hidden .hidden-title {
  font-style: italic;
  color: #666; /* Gray color for the hidden title */
}

.proposition-hidden .hidden-status {
  font-size: 0.9em;
  color: #666;
  margin-left: 5px;
  font-weight: normal;
}

.proposition-hidden .proposition-content {
  /* Optional: Maybe slightly hide content too */
  /* color: #888; */
} 