/* ================================================
   Việc Nhà - Custom Styles
   ================================================ */

:root {
  --primary:   #2c6e49;
  --primary-d: #1b4332;
  --bg-light:  #f5f7f5;
  --radius:    .75rem;
}

/* Override Bootstrap primary */
.bg-primary     { background-color: var(--primary) !important; }
.btn-primary    { background-color: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background-color: var(--primary-d); border-color: var(--primary-d); }
.text-primary   { color: var(--primary) !important; }
.border-primary { border-color: var(--primary) !important; }
.navbar-dark.bg-primary { background-color: var(--primary) !important; }

body {
  background-color: var(--bg-light);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
}

/* ── Avatar Circle ────────────────────────────────── */
.avatar-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(255,255,255,.25);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  flex-shrink: 0;
}
.avatar-circle-sm {
  width: 28px;
  height: 28px;
  font-size: .75rem;
  background-color: var(--primary);
  color: #fff;
}

/* ── Cards ────────────────────────────────────────── */
.card {
  border-radius: var(--radius);
}
.card-header {
  border-radius: var(--radius) var(--radius) 0 0 !important;
}

/* ── Chore cards ──────────────────────────────────── */
.chore-card {
  transition: transform .15s ease, box-shadow .15s ease;
}
.chore-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.1) !important;
}
.chore-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

/* Status borders */
.status-pending   { border-left: 4px solid #adb5bd !important; }
.status-in_progress { border-left: 4px solid #0dcaf0 !important; }
.status-completed { border-left: 4px solid #198754 !important; }

/* ── Status badges ────────────────────────────────── */
.status-badge {
  font-size: .75rem;
  padding: .35em .65em;
  border-radius: .5rem;
}
.status-badge-pending {
  background-color: #e9ecef;
  color: #495057;
}
.status-badge-in_progress {
  background-color: #cff4fc;
  color: #055160;
}
.status-badge-completed {
  background-color: #d1e7dd;
  color: #0a3622;
}

/* ── Photo grid ───────────────────────────────────── */
.photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.photo-item {
  width: 100px;
  height: 100px;
  border-radius: .5rem;
  overflow: hidden;
  background: #eee;
}
.photo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity .15s;
}
.photo-thumb:hover { opacity: .85; }

@media (max-width: 576px) {
  .photo-item {
    width: calc(33.33% - .35rem);
    height: 0;
    padding-bottom: calc(33.33% - .35rem);
    position: relative;
  }
  .photo-thumb {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
  }
}

/* ── Forms ────────────────────────────────────────── */
.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 .2rem rgba(44, 110, 73, .15);
}

/* ── Loading spinner on buttons ──────────────────── */
.btn.loading {
  pointer-events: none;
  opacity: .7;
}
.btn.loading::after {
  content: '';
  display: inline-block;
  width: .875rem;
  height: .875rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  margin-left: .4rem;
  vertical-align: -.2em;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Navbar tweaks ────────────────────────────────── */
.navbar-brand { font-size: 1.1rem; letter-spacing: -.3px; }
.dropdown-menu { border-radius: var(--radius); box-shadow: 0 .5rem 1.5rem rgba(0,0,0,.12); }

/* ── Misc ─────────────────────────────────────────── */
.font-monospace { font-size: .875rem; }
pre { font-size: .82rem; }

/* Prevent layout shift on page load */
[x-cloak] { display: none !important; }
