/* === AMKLELEC PWA === */

:root {
  --green: #F57C00;
  --green-light: #fff3e0;
  --red: #E24B4B;
  --red-light: #fdeaea;
  --bg: #f5f5f7;
  --card: #ffffff;
  --border: #e5e5ea;
  --border-light: #f0f0f2;
  --text: #1c1c1e;
  --text-secondary: #6e6e73;
  --text-tertiary: #aeaeb2;
  --radius: 12px;
  --radius-sm: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* === HEADER === */
.header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border-light);
}

.header-logo {
  flex-shrink: 0;
  line-height: 0;
}

.header-name {
  font-size: 16px;
  font-weight: 600;
}

.header-sub {
  font-size: 12px;
  color: var(--text-tertiary);
}

/* === MAIN === */
.main {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

/* === SECTION === */
.section {
  background: var(--card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.section-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-badge.before { background: var(--red); }
.section-badge.after { background: #F57C00; }

.section-title {
  font-size: 15px;
  font-weight: 600;
}

.section-tag {
  font-size: 12px;
  margin-left: auto;
}
.section-tag.optional { color: var(--text-tertiary); }
.section-tag.required { color: var(--red); }

/* === UPLOAD ZONE === */
.upload-zone {
  margin-bottom: 10px;
}

.upload-placeholder {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s;
  background: var(--bg);
}

.upload-placeholder:active {
  border-color: var(--green);
}

.upload-plus {
  font-size: 28px;
  color: var(--text-tertiary);
  line-height: 1;
  margin-bottom: 4px;
}

.upload-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.upload-hint {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* Quand il y a des médias, on cache le placeholder vide */
.upload-placeholder.has-media {
  display: none;
}

/* === MEDIA GRID === */
.media-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.media-grid:empty {
  display: none;
}

.media-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  background: var(--bg);
  flex-shrink: 0;
}

.media-thumb img,
.media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-thumb .remove-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.55);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.media-thumb .video-icon {
  position: absolute;
  bottom: 3px;
  left: 3px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
}

.add-more-btn {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 22px;
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: border-color 0.15s;
}

.add-more-btn:active {
  border-color: var(--green);
}

/* === DESCRIPTION ROW === */
.desc-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.desc-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}

.desc-input:focus {
  border-color: var(--green);
}

.desc-input::placeholder {
  color: var(--text-tertiary);
}

.mic-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}

.mic-btn:active,
.mic-btn.recording {
  background: var(--red-light);
  border-color: var(--red);
  color: var(--red);
}

.mic-btn.recording {
  animation: pulse-mic 1s infinite;
}

@keyframes pulse-mic {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.mic-btn.has-audio {
  background: var(--green-light);
  border-color: var(--green);
  color: var(--green);
}

/* === AUDIO FEEDBACK === */
.audio-feedback {
  min-height: 0;
  transition: all 0.2s;
}

.audio-feedback:not(:empty) {
  margin-top: 8px;
}

.audio-feedback .audio-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border-radius: 20px;
  padding: 6px 12px;
}

.audio-feedback .audio-bar .audio-info {
  font-size: 12px;
  color: var(--text-secondary);
  flex: 1;
}

.audio-feedback .audio-bar .audio-delete {
  background: none;
  border: none;
  color: var(--red);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
}

.audio-feedback .recording-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--red);
}

.recording-dot {
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  animation: pulse-dot 1s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* === PUBLISH BUTTON === */
.publish-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius);
  background: var(--green);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}

.publish-btn:active {
  opacity: 0.85;
}

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

.publish-networks {
  text-align: center;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-tertiary);
  padding-bottom: 20px;
}

/* === OVERLAYS === */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 40px;
}

.overlay.hidden {
  display: none;
}

.overlay-content {
  text-align: center;
  max-width: 300px;
}

.overlay-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  margin: 0 auto 16px;
  color: #fff;
}

.overlay-icon.success { background: var(--green); }
.overlay-icon.error { background: var(--red); }

.overlay-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.overlay-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* === SPINNER === */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
