/* ============================================================================
   media-picker.css — Galeria de Midia (padrao U1)
   ============================================================================ */

.cfmp-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .6);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000;
  animation: cfmp-fade 150ms ease-out;
}
@keyframes cfmp-fade { from { opacity: 0; } to { opacity: 1; } }

.cfmp-modal {
  background: #fff;
  border-radius: 14px;
  width: 95%; max-width: 880px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,.25);
  font-family: 'Inter', sans-serif;
  animation: cfmp-pop 200ms cubic-bezier(.2,.9,.3,1.2);
}
@keyframes cfmp-pop {
  from { transform: scale(.95) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.cfmp-modal header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #E2E8F0;
}
.cfmp-modal h3 {
  display: flex; align-items: center; gap: 8px;
  font-family: 'IBM Plex Serif', serif;
  font-weight: 400; font-size: 18px; margin: 0;
  color: #0F172A;
}
.cfmp-modal h3 i { width: 18px; height: 18px; color: #1E5BAA; }
.cfmp-x {
  background: transparent; border: 0; cursor: pointer;
  padding: 6px; color: #64748B;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
}
.cfmp-x:hover { background: #F1F5F9; color: #DC2626; }
.cfmp-x i { width: 18px; height: 18px; }

.cfmp-tabs {
  display: flex; gap: 4px;
  padding: 8px 12px;
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
}
.cfmp-tab {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 0;
  padding: 8px 14px; border-radius: 6px;
  font-family: inherit; font-size: 12.5px;
  color: #64748B; cursor: pointer;
  transition: background 120ms;
}
.cfmp-tab:hover { background: #fff; }
.cfmp-tab.on { background: #fff; color: #1E5BAA; font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.cfmp-tab i { width: 14px; height: 14px; }

.cfmp-body {
  flex: 1; overflow: auto;
  padding: 16px 20px;
  min-height: 320px;
}

.cfmp-search {
  position: relative; margin-bottom: 14px;
}
.cfmp-search i {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: #94A3B8;
}
.cfmp-search input {
  width: 100%; padding: 8px 12px 8px 32px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  font-family: inherit; font-size: 13px;
}
.cfmp-search input:focus {
  outline: 2px solid #1E5BAA;
  outline-offset: -1px; border-color: transparent;
}

.cfmp-empty {
  text-align: center; padding: 48px 20px;
  color: #94A3B8;
}
.cfmp-empty i { width: 40px; height: 40px; margin-bottom: 12px; }
.cfmp-empty p { font-size: 13px; margin: 0; }

.cfmp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.cfmp-card {
  background: #fff;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 120ms;
  position: relative;
}
.cfmp-card:hover {
  border-color: #CBD5E1;
  transform: translateY(-2px);
}
.cfmp-card.is-selected {
  border-color: #1E5BAA;
  box-shadow: 0 0 0 4px rgba(30, 91, 170, .15);
}

.cfmp-thumb {
  aspect-ratio: 1;
  background: #F1F5F9;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.cfmp-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.cfmp-thumb i {
  width: 32px; height: 32px;
  color: #94A3B8;
}

.cfmp-meta {
  padding: 8px 10px;
  background: #fff;
}
.cfmp-meta strong {
  display: block; font-size: 12px;
  color: #0F172A;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cfmp-meta small {
  font-size: 10.5px; color: #94A3B8;
  font-family: 'IBM Plex Mono', monospace;
}

.cfmp-del {
  position: absolute; top: 6px; right: 6px;
  background: rgba(220, 38, 38, .9);
  color: #fff; border: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 120ms;
}
.cfmp-card:hover .cfmp-del { opacity: 1; }
.cfmp-del i { width: 12px; height: 12px; }

.cfmp-upload-area {
  min-height: 280px;
  border: 2px dashed #CBD5E1;
  border-radius: 12px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 32px;
  transition: all 120ms;
}
.cfmp-upload-area.is-drag {
  border-color: #1E5BAA;
  background: rgba(30, 91, 170, .04);
}
.cfmp-upload-cta {
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  cursor: pointer;
  color: #475569;
}
.cfmp-upload-cta i {
  width: 48px; height: 48px;
  color: #1E5BAA;
  margin-bottom: 8px;
}
.cfmp-upload-cta strong {
  font-size: 14px; color: #0F172A;
}
.cfmp-upload-cta small {
  font-size: 12px; color: #64748B;
}

.cfmp-upload-status {
  margin-top: 16px; width: 100%;
  display: flex; flex-direction: column; gap: 6px;
}
.cfmp-up-row, .cfmp-up-err {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #475569;
  padding: 6px 10px;
  background: #F8FAFC;
  border-radius: 6px;
}
.cfmp-up-err { color: #991B1B; background: #FEF2F2; }
.cfmp-up-row i, .cfmp-up-err i { width: 14px; height: 14px; }
.cfmp-spin { animation: cfmp-spin 1s linear infinite; }
@keyframes cfmp-spin { to { transform: rotate(360deg); } }

.cfmp-modal footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid #E2E8F0;
}
.cfmp-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 500;
  transition: background 120ms;
}
.cfmp-btn:disabled { opacity: .5; cursor: not-allowed; }
.cfmp-btn-primary {
  background: #1E5BAA; color: #fff;
}
.cfmp-btn-primary:hover:not(:disabled) { background: #143C7E; }
.cfmp-btn-ghost {
  background: transparent; color: #64748B;
}
.cfmp-btn-ghost:hover { background: #F1F5F9; color: #0F172A; }
