/* ======================
   PAGE CONTRIBUER - VERSION COMPACTE
   ====================== */

/* Body avec fond gris */
body.contribuer-page {
  background: var(--bg-body, #f8fafc) !important;
  min-height: 100vh !important;
  display: block !important;
  padding: 10px 20px !important;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif !important;
  box-sizing: border-box !important;
}

/* Card principale - mêmes valeurs que .container de styles.css */
body.contribuer-page .main-card {
  background: var(--bg-card, #ffffff) !important;
  border-radius: var(--radius-lg, 12px) !important;
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(15, 23, 42, 0.12)) !important;
  max-width: 900px !important;
  width: 100% !important;
  overflow: hidden !important;
  margin: 0 auto !important;
  padding: 0 40px 10px 40px !important;
  border: 1px solid var(--border, #e2e8f0) !important;
}

/* Header - mêmes valeurs que .header de styles.css */
body.contribuer-page .main-card .header {
  margin: 0 -40px 16px -40px !important;
  width: calc(100% + 80px) !important;
  border-radius: 12px 12px 0 0 !important;
  background: linear-gradient(135deg, #1e293b, #334155) !important;
  padding: 16px 24px !important;
}

/* Contenu */
body.contribuer-page .main-card .content {
  padding: 0 !important;
  background: transparent !important;
}

/* ======================
   ZONE UPLOAD COMPACTE
   ====================== */

.upload-zone {
  background: #f7fafc;
  border: 2px dashed #cbd5e0;
  border-radius: 10px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 20px;
}

.upload-zone:hover {
  border-color: #3182ce;
  background: #edf2f7;
}

.upload-zone.drag-over {
  border-color: #3182ce;
  background: #e2e8f0;
}

.upload-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

.upload-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: #2d3748;
  margin: 0;
}

.upload-hint {
  font-size: 0.8rem;
  color: #718096;
  margin: 4px 0 0 0;
}

/* ======================
   PREVIEW ZONE
   ====================== */

.preview-zone {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #f7fafc;
  margin-bottom: 20px;
}

.preview-zone img {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  display: block;
}

.btn-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-remove:hover {
  background: rgba(0, 0, 0, 0.9);
}

/* ======================
   FORMULAIRE COMPACT
   ====================== */

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

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #2d3748;
  font-family: inherit;
  box-sizing: border-box;
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
}

.form-input::placeholder {
  color: #a0aec0;
}

/* Select avec flèche custom */
select.form-input {
  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='%23718096' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

/* ======================
   CONSENTEMENT COMPACT
   ====================== */

.consent-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.consent-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #3182ce;
  flex-shrink: 0;
  cursor: pointer;
}

.consent-group label {
  font-size: 0.85rem;
  color: #4a5568;
  line-height: 1.4;
  cursor: pointer;
}

/* ======================
   BOUTON SUBMIT COMPACT
   ====================== */

.btn-submit {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: #2d3748;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-submit:hover:not(:disabled) {
  background: #1a202c;
}

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

/* ======================
   FOOTER INFO
   ====================== */

.footer-info {
  margin: 16px 0 0 0;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-info p {
  font-size: 0.75rem;
  color: #718096;
  margin: 0;
}

/* ======================
   SECTION RÉSULTAT
   ====================== */

.result-content {
  text-align: center;
}

.result-icon-wrapper {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #48bb78, #38a169);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.result-icon-wrapper.error {
  background: linear-gradient(135deg, #fc8181, #e53e3e);
}

.result-icon-wrapper.pending {
  background: linear-gradient(135deg, #ed8936, #dd6b20);
}

.result-emoji {
  font-size: 2.2rem;
  color: white;
}

.result-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #1a202c;
  margin: 0 0 8px;
}

.result-message {
  font-size: 1rem;
  color: #718096;
  margin: 0 0 28px;
  line-height: 1.5;
}

.extracted-data {
  background: #f7fafc;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 28px;
  text-align: left;
}

.extracted-data h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #2d3748;
  margin: 0 0 12px;
}

.extracted-data .extracted-item {
  font-size: 0.9rem;
  color: #4a5568;
  margin-bottom: 8px;
}

.extracted-data ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.extracted-data li {
  margin-bottom: 4px;
  color: #718096;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 320px;
  margin: 0 auto;
}

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  background: transparent;
  color: #2d3748;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #f7fafc;
  border-color: #cbd5e0;
}

/* ======================
   DARK MODE
   ====================== */

[data-theme="dark"] .upload-zone {
  background: rgba(255, 255, 255, 0.03);
  border-color: #475569;
}

[data-theme="dark"] .upload-zone:hover {
  background: rgba(49, 130, 206, 0.1);
  border-color: #3182ce;
}

[data-theme="dark"] .upload-text {
  color: #f1f5f9;
}

[data-theme="dark"] .upload-hint {
  color: #94a3b8;
}

[data-theme="dark"] .preview-zone {
  background: #0f172a;
}

[data-theme="dark"] .form-label {
  color: #e2e8f0;
}

[data-theme="dark"] .form-input {
  background: rgba(255, 255, 255, 0.05);
  border-color: #475569;
  color: #f1f5f9;
}

[data-theme="dark"] .form-input:focus {
  border-color: #3182ce;
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.2);
}

[data-theme="dark"] .form-input::placeholder {
  color: #64748b;
}

[data-theme="dark"] .consent-group label {
  color: #94a3b8;
}

[data-theme="dark"] .footer-info {
  border-color: #334155;
}

[data-theme="dark"] .footer-info p {
  color: #94a3b8;
}

[data-theme="dark"] .result-title {
  color: #f1f5f9;
}

[data-theme="dark"] .result-message {
  color: #94a3b8;
}

[data-theme="dark"] .extracted-data {
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .extracted-data h4 {
  color: #f1f5f9;
}

[data-theme="dark"] .extracted-data .extracted-item {
  color: #cbd5e0;
}

[data-theme="dark"] .btn-secondary {
  color: #f1f5f9;
  border-color: #475569;
}

[data-theme="dark"] .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
}

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

@media (max-width: 768px) {
  body.contribuer-page {
    padding: 8px 12px !important;
  }

  body.contribuer-page .main-card {
    padding: 0 20px 20px 20px !important;
  }

  body.contribuer-page .main-card .header {
    margin: 0 -20px 16px -20px !important;
    width: calc(100% + 40px) !important;
    padding: 14px 20px !important;
  }

  .upload-zone {
    padding: 24px 16px;
  }

  .btn-submit {
    max-width: none;
  }
}

@media (max-width: 480px) {
  body.contribuer-page {
    padding: 6px 8px !important;
  }

  body.contribuer-page .main-card {
    padding: 0 16px 16px 16px !important;
  }

  body.contribuer-page .main-card .header {
    margin: 0 -16px 16px -16px !important;
    width: calc(100% + 32px) !important;
    padding: 12px 16px !important;
  }

  .upload-zone {
    padding: 20px 14px;
  }

  .form-input {
    padding: 10px 12px;
  }
}

/* ======================
   ACCESSIBILITÉ
   ====================== */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ======================
   BARRE DE PROGRESSION UPLOAD
   ====================== */
.upload-progress-container {
  margin: 16px 0;
  display: none;
}

.upload-progress-container.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.upload-progress-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.upload-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3182ce, #38a169);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.upload-progress-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #718096;
}

.upload-progress-percentage {
  font-weight: 600;
  color: #3182ce;
}

/* États de progression */
.upload-progress-container.success .upload-progress-fill {
  background: #38a169;
  width: 100%;
}

.upload-progress-container.success .upload-progress-text {
  color: #38a169;
}

.upload-progress-container.error .upload-progress-fill {
  background: #e53e3e;
}

.upload-progress-container.error .upload-progress-text {
  color: #e53e3e;
}

.upload-status-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Effet ripple pour le bouton */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
  opacity: 0;
}

.btn-ripple:active::before {
  width: 200%;
  height: 200%;
  opacity: 1;
  transition: width 0s, height 0s, opacity 0s;
}

/* Dark mode pour la progression */
[data-theme="dark"] .upload-progress-bar {
  background: #334155;
}

[data-theme="dark"] .upload-progress-text {
  color: #94a3b8;
}

[data-theme="dark"] .upload-progress-percentage {
  color: #60a5fa;
}

[data-theme="dark"] .upload-progress-container.success .upload-progress-text {
  color: #4ade80;
}

[data-theme="dark"] .upload-progress-container.error .upload-progress-text {
  color: #f87171;
}
