/* ═══════════════════════════════════════════════════════════════════════
   DISCORD EMBED PREVIEW - Styles fidèles à Discord
   Composant réutilisable pour simuler l'apparence d'un message Discord
   ═══════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════
   CONTAINER
   ═══════════════════════════════════════════════════════════════════════ */

.discord-preview-container {
  background: #313338;
  border-radius: 8px;
  padding: 1rem 1rem 1rem 4.5rem;
  position: relative;
  font-family: 'gg sans', 'Noto Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.375;
  color: #dbdee1;
  margin: 1rem 0;
  overflow: hidden;
}

.discord-preview-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #5865F2, #EB459E);
  opacity: 0.8;
}

.discord-preview-container.compact {
  padding: 0.75rem 1rem 0.75rem 3.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════
   MESSAGE STRUCTURE
   ═══════════════════════════════════════════════════════════════════════ */

.discord-message {
  position: relative;
}

/* Avatar */
.discord-avatar {
  position: absolute;
  left: -3.5rem;
  top: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.compact .discord-avatar {
  width: 32px;
  height: 32px;
  left: -2.75rem;
}

.discord-avatar .avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.discord-avatar .avatar-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #5865F2, #EB459E);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
  color: white;
}

.compact .discord-avatar .avatar-placeholder {
  font-size: 14px;
}

/* Message Content */
.discord-message-content {
  min-width: 0;
}

/* Message Header */
.discord-message-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.discord-username {
  font-weight: 600;
  color: #f2f3f5;
  font-size: 15px;
  cursor: pointer;
}

.discord-username:hover {
  text-decoration: underline;
}

.discord-bot-tag {
  background: #5865F2;
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.discord-timestamp {
  color: #949ba4;
  font-size: 12px;
  font-weight: 400;
}

/* ═══════════════════════════════════════════════════════════════════════
   EMBED
   ═══════════════════════════════════════════════════════════════════════ */

.discord-embed {
  display: flex;
  background: #2b2d31;
  border-radius: 4px;
  border-left: 4px solid var(--embed-color, #5865F2);
  max-width: 520px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.embed-color-bar {
  display: none; /* Utilise border-left à la place */
}

.embed-content {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 1rem 0.75rem 0.75rem;
}

/* Author */
.embed-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.embed-author .author-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.embed-author .author-name {
  font-size: 13px;
  font-weight: 600;
  color: #f2f3f5;
}

/* Title */
.embed-title {
  font-size: 15px;
  font-weight: 700;
  color: #00aff4;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

/* Description */
.embed-description {
  font-size: 14px;
  color: #dbdee1;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.embed-description strong {
  font-weight: 700;
  color: #f2f3f5;
}

.embed-description em {
  font-style: italic;
}

.embed-description u {
  text-decoration: underline;
}

.embed-description del {
  text-decoration: line-through;
  opacity: 0.7;
}

.embed-description code {
  background: #1e1f22;
  padding: 0.15em 0.3em;
  border-radius: 3px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 85%;
}

.discord-mention {
  background: rgba(88, 101, 242, 0.3);
  color: #c9cdfb;
  padding: 0 2px;
  border-radius: 3px;
  cursor: pointer;
}

.discord-mention:hover {
  background: #5865F2;
  color: white;
}

/* Fields */
.embed-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.embed-field {
  flex: 0 0 100%;
  min-width: 0;
}

.embed-field.inline {
  flex: 0 0 calc(33.333% - 0.5rem);
  min-width: 150px;
}

.embed-field .field-name {
  font-size: 13px;
  font-weight: 700;
  color: #f2f3f5;
  margin-bottom: 0.15rem;
}

.embed-field .field-value {
  font-size: 14px;
  color: #dbdee1;
  line-height: 1.3;
}

/* Image */
.embed-image {
  margin-top: 0.75rem;
  border-radius: 4px;
  overflow: hidden;
  max-width: 400px;
}

.embed-image img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Thumbnail */
.embed-thumbnail {
  flex-shrink: 0;
  padding: 0.75rem 0.75rem 0.75rem 0;
}

.embed-thumbnail img {
  width: 80px;
  height: 80px;
  border-radius: 4px;
  object-fit: cover;
}

/* Footer */
.embed-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.embed-footer .footer-text {
  font-size: 12px;
  color: #949ba4;
  font-weight: 400;
}

/* ═══════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════ */

.discord-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.discord-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 14px;
  font-weight: 500;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  transition: background-color 0.17s ease, color 0.17s ease;
  min-width: 60px;
  height: 32px;
}

.discord-btn-primary {
  background: #5865F2;
  color: white;
}

.discord-btn-primary:hover {
  background: #4752c4;
}

.discord-btn-success {
  background: #248046;
  color: white;
}

.discord-btn-success:hover {
  background: #1a6334;
}

.discord-btn-danger {
  background: #da373c;
  color: white;
}

.discord-btn-danger:hover {
  background: #a12d31;
}

.discord-btn-secondary {
  background: #4e5058;
  color: white;
}

.discord-btn-secondary:hover {
  background: #6d6f78;
}

/* ═══════════════════════════════════════════════════════════════════════
   MESSAGES SECTION SPECIFIC - Preview Cards
   ═══════════════════════════════════════════════════════════════════════ */

.messages-preview-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.message-preview-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  padding: 1.25rem;
  transition: all var(--transition-normal);
  overflow: hidden;
}

.message-preview-card:hover {
  border-color: rgba(88, 101, 242, 0.3);
  box-shadow: 0 4px 20px rgba(88, 101, 242, 0.1);
}

.message-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.message-preview-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.message-preview-title .preview-icon {
  font-size: 1.25rem;
}

.message-preview-title .preview-label {
  font-weight: 600;
  color: var(--text-primary);
}

.message-preview-badge {
  background: linear-gradient(135deg, #5865F2, #EB459E);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 0.25em 0.6em;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Message Input Area */
.message-input-area {
  margin-bottom: 1rem;
}

.message-input-area label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.message-input-wrapper {
  position: relative;
}

.message-input-area .message-input {
  width: 100%;
  padding: 0.75rem 1rem;
  padding-right: 2.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  transition: all var(--transition-fast);
}

.message-input-area .message-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.2);
}

.message-input-area .message-input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.btn-clear-input {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-clear-input:hover {
  background: rgba(237, 66, 69, 0.2);
  color: #ed4245;
}

/* Variables Helper */
.variables-helper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: rgba(88, 101, 242, 0.1);
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(88, 101, 242, 0.3);
}

.variables-helper-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.variable-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: #5865F2;
  color: white;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.variable-tag:hover {
  background: #4752c4;
  transform: scale(1.05);
}

.variable-tag::before {
  content: '+';
  font-size: 10px;
  opacity: 0.8;
}

/* Divider */
.preview-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.25rem 0 1rem;
}

.preview-divider::before,
.preview-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.preview-divider-text {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════ */

@media (max-width: 600px) {
  .discord-preview-container {
    padding: 1rem 0.75rem 1rem 3.5rem;
  }

  .discord-avatar {
    width: 32px;
    height: 32px;
    left: -2.75rem; /* Position in the left padding, not in content */
  }

  .discord-embed {
    max-width: 100%;
  }

  .embed-thumbnail img {
    width: 60px;
    height: 60px;
  }

  .embed-field.inline {
    flex: 0 0 calc(50% - 0.25rem);
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   MESSAGES SECTION V3 - Styles pour l'interface améliorée
   ═══════════════════════════════════════════════════════════════════════ */

.messages-section-v3 {
  /* Hérite de builder-section */
}

.message-fields-grid-v3 {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.message-field-card-v3 {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  padding: 1.25rem;
  transition: all var(--transition-normal);
  overflow: hidden;
}

.message-field-card-v3:hover {
  border-color: rgba(88, 101, 242, 0.3);
  box-shadow: 0 4px 20px rgba(88, 101, 242, 0.1);
}

.message-field-card-v3.preview-active {
  border-color: rgba(88, 101, 242, 0.5);
  box-shadow: 0 8px 32px rgba(88, 101, 242, 0.2);
}

/* Field Header V3 */
.field-header-v3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.field-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.field-emoji {
  font-size: 1.25rem;
}

.field-header-v3 .field-label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

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

.btn-preview-toggle {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(88, 101, 242, 0.1);
  border: 1px solid rgba(88, 101, 242, 0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-preview-toggle:hover {
  background: rgba(88, 101, 242, 0.2);
  border-color: rgba(88, 101, 242, 0.4);
}

.btn-preview-toggle.active {
  background: #5865F2;
  border-color: #5865F2;
}

.btn-preview-toggle .preview-icon {
  font-size: 14px;
}

/* Input Wrap V3 */
.field-input-wrap-v3 {
  position: relative;
  margin-bottom: 0.75rem;
}

.message-input-v3 {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  min-height: 60px;
  transition: all var(--transition-fast);
}

.message-input-v3:focus {
  outline: none;
  border-color: #5865F2;
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.2);
}

.message-input-v3::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.btn-clear-field-v3 {
  position: absolute;
  right: 0.5rem;
  top: 0.5rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(237, 66, 69, 0.1);
  border: none;
  border-radius: 50%;
  color: #ed4245;
  cursor: pointer;
  font-size: 12px;
  transition: all var(--transition-fast);
}

.btn-clear-field-v3:hover {
  background: rgba(237, 66, 69, 0.2);
  transform: scale(1.1);
}

/* Variables Helper V3 */
.variables-helper-v3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(88, 101, 242, 0.08);
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(88, 101, 242, 0.25);
}

.variables-helper-v3 .helper-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.variable-tag-v3 {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  background: #5865F2;
  color: white;
  font-size: 12px;
  font-weight: 500;
  font-family: 'Consolas', 'Monaco', monospace;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.variable-tag-v3:hover {
  background: #4752c4;
  transform: scale(1.05);
}

/* Discord Preview Wrapper */
.discord-preview-wrapper {
  margin-top: 0.5rem;
  animation: fadeSlideIn 0.3s ease;
}

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

/* Preview Transition */
.preview-expand-enter-active,
.preview-expand-leave-active {
  transition: all 0.3s ease;
}

.preview-expand-enter-from,
.preview-expand-leave-to {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
}

.preview-expand-enter-to,
.preview-expand-leave-from {
  opacity: 1;
  max-height: 500px;
}

/* Quick Preview V3 */
.quick-preview-v3 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  border-left: 3px solid rgba(88, 101, 242, 0.5);
}

.preview-label-v3 {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.preview-text-v3 {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  word-break: break-word;
}

/* Responsive V3 */
@media (max-width: 600px) {
  .message-field-card-v3 {
    padding: 1rem;
  }

  .field-header-v3 {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .message-input-v3 {
    font-size: 16px; /* Prevent zoom on iOS */
  }
}

/* =========================================
   Templates Section - Discord Preview Button
   ========================================= */

/* Preview Actions Layout */
.template-preview-actions {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 0.75rem;
}

.template-preview-actions .template-preview-v2 {
  flex: 1;
  margin: 0;
}

/* Discord Preview Button */
.btn-discord-preview {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  background: rgba(88, 101, 242, 0.2);
  border: 1px solid rgba(88, 101, 242, 0.3);
  border-radius: var(--radius-sm);
  color: #7289da;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-discord-preview:hover {
  background: rgba(88, 101, 242, 0.3);
  border-color: rgba(88, 101, 242, 0.5);
  color: #99aab5;
}

.btn-discord-preview.active {
  background: rgba(88, 101, 242, 0.4);
  border-color: #5865f2;
  color: white;
  box-shadow: 0 0 10px rgba(88, 101, 242, 0.3);
}

/* Discord Preview Wrapper in Templates */
.templates-section-v2 .discord-preview-wrapper {
  margin-top: 1rem;
  animation: fadeIn 0.3s ease;
}

.templates-section-v2 .preview-divider {
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.templates-section-v2 .preview-divider::before,
.templates-section-v2 .preview-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(88, 101, 242, 0.3), transparent);
}

.templates-section-v2 .preview-divider-text {
  padding: 0 1rem;
  font-size: 11px;
  color: #7289da;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

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

/* ═══════════════════════════════════════════════════════════════════════
   MESSAGES SECTION V5 - Discord Preview Always Visible
   ═══════════════════════════════════════════════════════════════════════ */

.messages-section-v5 {
  /* Hérite de builder-section */
}

.messages-grid-v5 {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.message-card-v5 {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.message-card-v5:hover {
  border-color: rgba(88, 101, 242, 0.3);
  box-shadow: 0 4px 20px rgba(88, 101, 242, 0.1);
}

.message-card-v5.filled {
  border-color: rgba(87, 242, 135, 0.3);
}

.message-card-header-v5 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-color);
}

.message-card-header-v5 .header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.message-card-header-v5 .field-icon {
  font-size: 1.25rem;
}

.message-card-header-v5 .field-label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.message-card-header-v5 .filled-indicator {
  color: #57F287;
  font-size: 14px;
  font-weight: bold;
}

.message-card-content-v5 {
  padding: 1.25rem;
}

.message-card-content-v5 .input-wrapper {
  position: relative;
}

.message-card-content-v5 .input-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.message-input-v5 {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  min-height: 60px;
  transition: all var(--transition-fast);
}

.message-input-v5:focus {
  outline: none;
  border-color: #5865F2;
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.2);
}

.message-input-v5::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.message-card-content-v5 .btn-clear {
  position: absolute;
  right: 0.5rem;
  top: 2rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(237, 66, 69, 0.1);
  border: none;
  border-radius: 50%;
  color: #ed4245;
  cursor: pointer;
  font-size: 12px;
  transition: all var(--transition-fast);
}

.message-card-content-v5 .btn-clear:hover {
  background: rgba(237, 66, 69, 0.2);
  transform: scale(1.1);
}

.message-card-content-v5 .variables-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(88, 101, 242, 0.08);
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(88, 101, 242, 0.25);
}

.message-card-content-v5 .variables-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.message-card-content-v5 .variable-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  background: #5865F2;
  color: white;
  font-size: 12px;
  font-weight: 500;
  font-family: 'Consolas', 'Monaco', monospace;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.message-card-content-v5 .variable-btn:hover {
  background: #4752c4;
  transform: scale(1.05);
}

.message-card-content-v5 .gif-input-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(88, 101, 242, 0.2);
}

.message-card-content-v5 .gif-input {
  height: auto !important;
  min-height: unset !important;
  padding: 0.75rem 2.5rem 0.75rem 1rem !important;
}

.message-card-content-v5 .gif-hint {
  margin: 0.5rem 0 0;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.7;
}

/* Discord Preview Section V5 - Toujours visible */
.discord-preview-section-v5 {
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-color);
}

.discord-preview-section-v5 .preview-divider {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.discord-preview-section-v5 .preview-divider::before,
.discord-preview-section-v5 .preview-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(88, 101, 242, 0.3), transparent);
}

.discord-preview-section-v5 .preview-divider span {
  padding: 0 1rem;
  font-size: 11px;
  color: #7289da;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Messages Stats Footer */
.messages-section-v5 .messages-stats-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--glass-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.messages-section-v5 .messages-stats-footer .stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.messages-section-v5 .messages-stats-footer .stat-icon {
  font-size: 1rem;
}

.messages-section-v5 .messages-stats-footer .stat-value {
  font-weight: 600;
  color: var(--text-primary);
}

.messages-section-v5 .messages-stats-footer .stat-value.complete {
  color: #57F287;
}

.messages-section-v5 .messages-stats-footer .stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* Button Preview for mystery_box_button_label */
.messages-section-v5 .button-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
}

.messages-section-v5 .discord-button-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blurple, #5865F2);
  color: white;
  padding: 0.5rem 1.25rem;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 500;
  min-width: 120px;
  cursor: default;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(88, 101, 242, 0.3);
}

.messages-section-v5 .discord-button-preview:hover {
  background: var(--blurple-hover, #4752C4);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

.messages-section-v5 .discord-button-preview .button-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.messages-section-v5 .button-preview-hint {
  font-size: 11px;
  color: var(--text-muted, #72767d);
  text-align: center;
  margin: 0;
}

/* Responsive V5 */
@media (max-width: 600px) {
  .message-card-content-v5 {
    padding: 1rem;
  }

  .discord-preview-section-v5 {
    padding: 1rem;
  }

  .message-input-v5 {
    font-size: 16px; /* Prevent zoom on iOS */
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   MESSAGES SECTION V4 - Unified Card with GIF Field (Legacy)
   ═══════════════════════════════════════════════════════════════════════ */

/* Label pour les champs */
.messages-section-v4 .input-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Section GIF intégrée */
.gif-input-section {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(88, 101, 242, 0.2);
}

.gif-input-section .input-wrapper {
  position: relative;
}

.gif-input {
  height: auto !important;
  min-height: unset !important;
  padding: 0.75rem 2.5rem 0.75rem 1rem !important;
}

.gif-hint {
  margin: 0.5rem 0 0;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.7;
}

/* Amélioration du layout des cards V4 */
.messages-grid-v4 {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.message-card-v4 {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.message-card-v4:hover {
  border-color: rgba(88, 101, 242, 0.3);
}

.message-card-v4.filled {
  border-color: rgba(87, 242, 135, 0.3);
}

.message-card-v4.expanded {
  border-color: rgba(88, 101, 242, 0.5);
  box-shadow: 0 8px 32px rgba(88, 101, 242, 0.15);
}

.message-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  transition: background var(--transition-fast);
}

.message-card-header:hover {
  background: rgba(255, 255, 255, 0.04);
}

.message-card-header .header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.message-card-header .field-icon {
  font-size: 1.25rem;
}

.message-card-header .field-label {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

.message-card-header .header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.message-card-header .filled-indicator {
  color: #57F287;
  font-size: 14px;
}

.message-card-header .expand-icon {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.message-card-header .expand-icon.rotated {
  transform: rotate(180deg);
}

.message-card-content {
  padding: 0 1.25rem 1.25rem;
}

.message-card-content .input-wrapper {
  position: relative;
}

.message-input-v4 {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  min-height: 60px;
  transition: all var(--transition-fast);
}

.message-input-v4:focus {
  outline: none;
  border-color: #5865F2;
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.2);
}

.message-input-v4::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.message-card-content .btn-clear {
  position: absolute;
  right: 0.5rem;
  top: 0.5rem;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(237, 66, 69, 0.1);
  border: none;
  border-radius: 50%;
  color: #ed4245;
  cursor: pointer;
  font-size: 12px;
  transition: all var(--transition-fast);
}

.message-card-content .btn-clear:hover {
  background: rgba(237, 66, 69, 0.2);
  transform: scale(1.1);
}

.variables-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(88, 101, 242, 0.08);
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(88, 101, 242, 0.25);
}

.variables-row .variables-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.variable-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  background: #5865F2;
  color: white;
  font-size: 12px;
  font-weight: 500;
  font-family: 'Consolas', 'Monaco', monospace;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.variable-btn:hover {
  background: #4752c4;
  transform: scale(1.05);
}

.quick-preview {
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  border-left: 3px solid rgba(88, 101, 242, 0.5);
}

.quick-preview .preview-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.quick-preview .preview-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  word-break: break-word;
}

.discord-preview-section {
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-color);
}

.discord-preview-section .preview-divider {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.discord-preview-section .preview-divider::before,
.discord-preview-section .preview-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(88, 101, 242, 0.3), transparent);
}

.discord-preview-section .preview-divider span {
  padding: 0 1rem;
  font-size: 11px;
  color: #7289da;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Messages Stats Footer */
.messages-stats-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--glass-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.messages-stats-footer .stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.messages-stats-footer .stat-icon {
  font-size: 1rem;
}

.messages-stats-footer .stat-value {
  font-weight: 600;
  color: var(--text-primary);
}

.messages-stats-footer .stat-value.complete {
  color: #57F287;
}

.messages-stats-footer .stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

/* Transition slide-down */
.slide-down-enter-active,
.slide-down-leave-active {
  transition: all 0.3s ease;
}

.slide-down-enter-from,
.slide-down-leave-to {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
}

.slide-down-enter-to,
.slide-down-leave-from {
  opacity: 1;
  max-height: 600px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LIGHT MODE - Discord Preview Adjustments
   Le preview Discord reste SOMBRE (fidèle à Discord) mais le wrapper est BLANC
   ═══════════════════════════════════════════════════════════════════════════ */

/* Wrapper MessagesSection - fond blanc */
[data-theme="light"] .discord-preview-section-v5 {
  background: #FFFFFF !important;
  border-top-color: rgba(0, 0, 0, 0.1) !important;
  border-radius: 12px !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .discord-preview-section-v5 .preview-divider span,
[data-theme="light"] .discord-preview-section-v5 .preview-divider-text {
  color: #475569 !important;
  font-weight: 600 !important;
}

[data-theme="light"] .discord-preview-section-v5 .preview-divider::before,
[data-theme="light"] .discord-preview-section-v5 .preview-divider::after {
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.12), transparent) !important;
}

/* Wrapper TemplatesSection - fond blanc */
[data-theme="light"] .discord-preview-wrapper {
  background: #FFFFFF !important;
  border-radius: 12px !important;
  padding: 1rem !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .discord-preview-wrapper .preview-divider span,
[data-theme="light"] .discord-preview-wrapper .preview-divider-text {
  color: #475569 !important;
  font-weight: 600 !important;
}

[data-theme="light"] .discord-preview-wrapper .preview-divider::before,
[data-theme="light"] .discord-preview-wrapper .preview-divider::after {
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.12), transparent) !important;
}

/* Discord preview container - reste SOMBRE mais avec meilleur contraste */
[data-theme="light"] .discord-preview-container {
  background: #313338 !important; /* Garder le fond sombre Discord */
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25) !important;
  border: 2px solid rgba(49, 51, 56, 0.5) !important;
  border-radius: 10px !important;
}

/* Discord embed - reste SOMBRE */
[data-theme="light"] .discord-embed {
  background: #2b2d31 !important; /* Garder le fond sombre Discord */
}
