/* Colomio Account / Profile — base styling.
 *
 * All rules are scoped under .colomio-root so we have strong specificity vs.
 * the host WP theme's defaults (which often style <button> with white text on
 * coloured backgrounds and override us if we are not explicit).
 */

.colomio-root {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: #111;
  font-size: 14px;
  line-height: 1.4;
}

.colomio-root * { box-sizing: border-box; }

.colomio-root .colomio-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  margin-bottom: 16px;
  color: #111;
}

.colomio-root .colomio-card h2 { margin-top: 0; font-size: 18px; color: #111; }
.colomio-root .colomio-card h3 { margin-top: 0; font-size: 16px; color: #111; }
.colomio-root .colomio-card p  { color: #333; }

.colomio-root label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #111;
}

.colomio-root input[type="email"],
.colomio-root input[type="text"] {
  display: block;
  width: 100%;
  max-width: 360px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  margin-top: 4px;
  background: #fff;
  color: #111;
}

.colomio-root input[type="checkbox"] {
  margin-right: 6px;
  vertical-align: middle;
}

/* --- BUTTONS ----------------------------------------------------------------
 * Buttons use the unique class `cmm-btn` (Colomio account button). This
 * class is rare enough that no WordPress theme should style it, so we win
 * the cascade against `.entry-content button` and similar theme rules.
 *
 * We additionally use !important on the colours because some themes inject
 * inline <style> with high specificity (e.g. via the Customizer), and we
 * really do want our buttons to be readable everywhere.
 */
.cmm-btn,
button.cmm-btn,
a.cmm-btn,
.colomio-root .cmm-btn {
  display: inline-block !important;
  padding: 10px 18px !important;
  border-radius: 999px !important;
  border: 1px solid #2563eb !important;
  background: #2563eb !important;
  background-color: #2563eb !important;
  background-image: none !important;
  color: #fff !important;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none !important;
  text-shadow: none !important;
  box-shadow: none !important;
  transition: background-color .15s ease, border-color .15s ease;
  -webkit-appearance: none !important;
  appearance: none !important;
}
.cmm-btn:hover,
button.cmm-btn:hover,
a.cmm-btn:hover,
.colomio-root .cmm-btn:hover {
  background: #1d4ed8 !important;
  background-color: #1d4ed8 !important;
  border-color: #1d4ed8 !important;
  color: #fff !important;
}
.cmm-btn:focus-visible,
button.cmm-btn:focus-visible,
.colomio-root .cmm-btn:focus-visible {
  outline: 2px solid #93c5fd !important;
  outline-offset: 2px;
}
.cmm-btn:disabled,
button.cmm-btn:disabled,
.colomio-root .cmm-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* Secondary / ghost button if we ever need one */
.cmm-btn--ghost,
button.cmm-btn--ghost,
.colomio-root .cmm-btn--ghost {
  background: #fff !important;
  background-color: #fff !important;
  color: #2563eb !important;
}
.cmm-btn--ghost:hover,
button.cmm-btn--ghost:hover,
.colomio-root .cmm-btn--ghost:hover {
  background: #eff6ff !important;
  background-color: #eff6ff !important;
  color: #1d4ed8 !important;
}

/* --- MESSAGES --------------------------------------------------------------- */
.colomio-root .colomio-error { color: #b91c1c; }
.colomio-root #cm-msg,
.colomio-root #cm-nick-msg { margin-top: 8px; font-size: 13px; color: #166534; }
.colomio-root #cm-msg:empty,
.colomio-root #cm-nick-msg:empty { display: none; }

/* --- USER BAR --------------------------------------------------------------- */
.colomio-root .colomio-userbar,
.colomio-root .cmm-userbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  margin: 0 0 20px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  flex-wrap: wrap;
}
.colomio-root .cmm-userbar__identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.colomio-root .cmm-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
  user-select: none;
}
.colomio-root .cmm-userbar__name-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.colomio-root .cmm-userbar__name {
  font-size: 15px;
  font-weight: 600;
  color: #111;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
.colomio-root .cmm-userbar__sub {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}
.colomio-root .cmm-userbar__action {
  flex-shrink: 0;
}
.colomio-root .colomio-link { color: #2563eb; text-decoration: none; }
.colomio-root .colomio-link:hover { text-decoration: underline; }

/* --- LIBRARY SECTION ------------------------------------------------------- */
.colomio-root .cmm-section { display: block; }
.colomio-root .cmm-skeleton {
  padding: 24px;
  text-align: center;
  color: #6b7280;
  background: #f9fafb;
  border-radius: 12px;
  border: 1px dashed #e5e7eb;
}
.colomio-root .cmm-error {
  padding: 16px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}
.colomio-root .cmm-library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.colomio-root .cmm-library-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.colomio-root .cmm-h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #111;
}
.colomio-root .cmm-count {
  font-size: 12px;
  color: #6b7280;
  background: #f3f4f6;
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 500;
}
.colomio-root .cmm-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #6b7280;
}
.colomio-root .cmm-filter__label { white-space: nowrap; }
.colomio-root .cmm-filter__select {
  padding: 6px 28px 6px 10px;
  font-size: 13px;
  color: #111;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%236b7280' d='M5 6L0 0h10z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.colomio-root .cmm-filter__select:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 1px;
}
.colomio-root .cmm-empty {
  padding: 24px;
  text-align: center;
  color: #6b7280;
  background: #f9fafb;
  border: 1px dashed #e5e7eb;
  border-radius: 8px;
}
.colomio-root .cmm-loadmore {
  margin-top: 16px;
  text-align: center;
}

/* --- PROFILE HEAD ----------------------------------------------------------- */
.colomio-root .colomio-profile-head,
.colomio-root .cmm-profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 16px;
}
.colomio-root .cmm-avatar--lg {
  width: 64px;
  height: 64px;
  font-size: 28px;
}
.colomio-root .cmm-profile-name {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #111;
  line-height: 1.2;
}
.colomio-root .colomio-profile-head h1 { margin: 0 0 4px; font-size: 22px; color: #111; }
.colomio-root .colomio-profile-meta { color: #666; font-size: 12px; margin: 0; }

/* --- OWN-PROFILE NOTICE ---------------------------------------------------- */
.colomio-root .cmm-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin: 0 0 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  font-size: 13px;
  color: #1e3a8a;
  line-height: 1.5;
}
.colomio-root .cmm-notice__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.colomio-root .cmm-notice__text { flex: 1; }

/* --- GRID + CARDS ----------------------------------------------------------- */
.colomio-root .hc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.colomio-root .hc-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.colomio-root .hc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
  border-color: #c7d2fe;
}
.colomio-root .hc-card__media {
  margin: 0;
  padding: 0;
  line-height: 0;
  aspect-ratio: 1 / 1;
  background: #f7f7f7;
  overflow: hidden;
}
.colomio-root .hc-card__media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.colomio-root .hc-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
}
.colomio-root .hc-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #2563eb;
  background: #eff6ff;
  border-radius: 999px;
  padding: 2px 8px;
}
.colomio-root .hc-tag--drawing {
  color: #7c3aed;
  background: #f5f3ff;
}
.colomio-root .hc-card__date {
  font-size: 11px;
  color: #6b7280;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .colomio-root .hc-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
  .colomio-root .cmm-userbar { padding: 12px; }
  .colomio-root .cmm-userbar__action { width: 100%; text-align: center; }
}
