/*
 * HMO Manager Pro – Frontend Styles
 * Room listings, property pages, tenant portal, forms.
 */

/* ── Design tokens ──────────────────────────────────────────────────────────── */
:root {
  --hmo-primary:      #2c3e50;
  --hmo-accent:       #27ae60;
  --hmo-accent-2:     #2980b9;
  --hmo-danger:       #e74c3c;
  --hmo-warn:         #f39c12;
  --hmo-text:         #2d3436;
  --hmo-text-muted:   #636e72;
  --hmo-border:       #dfe6e9;
  --hmo-bg:           #f8fafb;
  --hmo-white:        #ffffff;
  --hmo-radius:       10px;
  --hmo-radius-sm:    6px;
  --hmo-shadow:       0 4px 20px rgba(0,0,0,0.08);
  --hmo-shadow-hover: 0 8px 30px rgba(0,0,0,0.13);
  --hmo-transition:   all 0.25s ease;
  --hmo-font:         'Segoe UI',-apple-system,BlinkMacSystemFont,'Helvetica Neue',Arial,sans-serif;
}

/* ════════════════════════════════════════════════════════════════
   ROOM CARDS — ARCHIVE / SHORTCODE GRID
════════════════════════════════════════════════════════════════ */
.hmo-rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin: 24px 0;
}

.hmo-room-card {
  background: var(--hmo-white);
  border-radius: var(--hmo-radius);
  border: 1px solid var(--hmo-border);
  overflow: hidden;
  box-shadow: var(--hmo-shadow);
  transition: var(--hmo-transition);
  display: flex;
  flex-direction: column;
}

.hmo-room-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--hmo-shadow-hover);
  border-color: #c8d6de;
}

/* Thumbnail */
.hmo-card-thumb {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: #edf2f7;
}

.hmo-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.hmo-room-card:hover .hmo-card-thumb img {
  transform: scale(1.04);
}

/* Status badge */
.hmo-room-status-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}

.hmo-status-available  { background: rgba(39,174,96,0.9);  color: #fff; }
.hmo-status-occupied   { background: rgba(231,76,60,0.9);  color: #fff; }
.hmo-status-notice     { background: rgba(243,156,18,0.9); color: #fff; }
.hmo-status-reserved   { background: rgba(41,128,185,0.9); color: #fff; }
.hmo-status-maintenance{ background: rgba(99,110,114,0.9); color: #fff; }

/* Room type pill */
.hmo-room-type-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(44,62,80,0.8);
  color: #fff;
  padding: 3px 9px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
}

/* Card body */
.hmo-card-body {
  padding: 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.hmo-card-property {
  font-size: 11px;
  font-weight: 600;
  color: var(--hmo-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.hmo-card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--hmo-primary);
  margin: 0 0 10px;
  line-height: 1.3;
}

.hmo-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}

.hmo-card-title a:hover { color: var(--hmo-accent); }

/* Card features */
.hmo-card-features {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.hmo-feature-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--hmo-text-muted);
  background: var(--hmo-bg);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--hmo-border);
  white-space: nowrap;
}

.hmo-feature-chip svg,
.hmo-feature-chip .hmo-icon { flex-shrink: 0; opacity: 0.7; }

/* Price */
.hmo-card-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--hmo-border);
}

.hmo-price-amount {
  font-size: 22px;
  font-weight: 800;
  color: var(--hmo-primary);
  line-height: 1;
}

.hmo-price-period {
  font-size: 12px;
  color: var(--hmo-text-muted);
  font-weight: 500;
}

.hmo-price-deposit {
  margin-left: auto;
  font-size: 12px;
  color: var(--hmo-text-muted);
}

/* Card footer */
.hmo-card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--hmo-border);
  background: var(--hmo-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* ════════════════════════════════════════════════════════════════
   SINGLE ROOM PAGE
════════════════════════════════════════════════════════════════ */
.hmo-single-room-wrap {
  max-width: 1100px;
  margin: 0 auto;
  font-family: var(--hmo-font);
}

/* Gallery */
.hmo-gallery-main {
  position: relative;
  border-radius: var(--hmo-radius);
  overflow: hidden;
  background: #edf2f7;
  aspect-ratio: 16/9;
  margin-bottom: 8px;
}

.hmo-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hmo-gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.hmo-gallery-thumb {
  width: 90px;
  height: 60px;
  border-radius: var(--hmo-radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  flex-shrink: 0;
  transition: border-color 0.15s;
}

.hmo-gallery-thumb.active,
.hmo-gallery-thumb:hover {
  border-color: var(--hmo-primary);
}

.hmo-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Single room layout */
.hmo-single-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  margin-top: 28px;
  align-items: start;
}

/* Info section */
.hmo-single-info {}

.hmo-single-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--hmo-text-muted);
  margin-bottom: 6px;
}

.hmo-single-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--hmo-primary);
  margin: 0 0 16px;
  line-height: 1.2;
}

.hmo-single-features {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.hmo-single-description {
  font-size: 15px;
  line-height: 1.7;
  color: var(--hmo-text);
  margin-bottom: 28px;
}

/* Room details table */
.hmo-details-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  border-radius: var(--hmo-radius);
  overflow: hidden;
  border: 1px solid var(--hmo-border);
  margin-bottom: 28px;
}

.hmo-details-table th {
  background: var(--hmo-bg);
  padding: 10px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--hmo-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  width: 40%;
  border-bottom: 1px solid var(--hmo-border);
}

.hmo-details-table td {
  padding: 10px 16px;
  color: var(--hmo-text);
  font-weight: 600;
  border-bottom: 1px solid var(--hmo-border);
}

.hmo-details-table tr:last-child th,
.hmo-details-table tr:last-child td {
  border-bottom: none;
}

/* Booking sidebar */
.hmo-booking-sidebar {
  position: sticky;
  top: 20px;
}

.hmo-booking-card {
  background: var(--hmo-white);
  border: 1px solid var(--hmo-border);
  border-radius: var(--hmo-radius);
  box-shadow: var(--hmo-shadow);
  overflow: hidden;
}

.hmo-booking-card-header {
  background: var(--hmo-primary);
  color: #fff;
  padding: 20px 22px;
}

.hmo-booking-price {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.hmo-booking-price sup {
  font-size: 18px;
  vertical-align: top;
  margin-top: 4px;
}

.hmo-booking-period {
  font-size: 13px;
  opacity: 0.75;
  margin-top: 4px;
}

.hmo-booking-card-body {
  padding: 20px 22px;
}

.hmo-booking-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--hmo-border);
  font-size: 14px;
}

.hmo-booking-row:last-child { border-bottom: none; }

.hmo-booking-row .label { color: var(--hmo-text-muted); font-size: 13px; }
.hmo-booking-row .value { font-weight: 700; color: var(--hmo-primary); }

.hmo-booking-actions {
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid var(--hmo-border);
  background: var(--hmo-bg);
}

/* ════════════════════════════════════════════════════════════════
   BUTTONS
════════════════════════════════════════════════════════════════ */
.hmo-btn,
a.hmo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--hmo-radius-sm);
  font-size: 14px;
  font-weight: 700;
  font-family: var(--hmo-font);
  cursor: pointer;
  transition: var(--hmo-transition);
  border: none;
  text-decoration: none;
  text-align: center;
  line-height: 1;
  white-space: nowrap;
}

.hmo-btn-primary,
a.hmo-btn-primary {
  background: var(--hmo-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(44,62,80,0.25);
}

.hmo-btn-primary:hover {
  background: #1a252f;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(44,62,80,0.3);
  text-decoration: none;
}

.hmo-btn-accent,
a.hmo-btn-accent {
  background: var(--hmo-accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(39,174,96,0.3);
}

.hmo-btn-accent:hover {
  background: #219a52;
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

.hmo-btn-outline,
a.hmo-btn-outline {
  background: transparent;
  color: var(--hmo-primary);
  border: 2px solid var(--hmo-primary);
}

.hmo-btn-outline:hover {
  background: var(--hmo-primary);
  color: #fff;
  text-decoration: none;
}

.hmo-btn-full { width: 100%; }
.hmo-btn-sm   { padding: 8px 16px; font-size: 13px; }
.hmo-btn-lg   { padding: 15px 32px; font-size: 16px; }

/* ════════════════════════════════════════════════════════════════
   PROPERTY CARD
════════════════════════════════════════════════════════════════ */
.hmo-properties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
  margin: 24px 0;
}

.hmo-property-card {
  background: var(--hmo-white);
  border-radius: var(--hmo-radius);
  border: 1px solid var(--hmo-border);
  overflow: hidden;
  box-shadow: var(--hmo-shadow);
  transition: var(--hmo-transition);
}

.hmo-property-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--hmo-shadow-hover);
}

.hmo-property-card .hmo-card-body {
  padding: 20px 22px;
}

.hmo-property-address {
  font-size: 13px;
  color: var(--hmo-text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.hmo-property-stats {
  display: flex;
  gap: 16px;
  margin: 14px 0;
}

.hmo-property-stat {
  text-align: center;
  flex: 1;
  padding: 10px 6px;
  background: var(--hmo-bg);
  border-radius: var(--hmo-radius-sm);
  border: 1px solid var(--hmo-border);
}

.hmo-property-stat .stat-num {
  display: block;
  font-size: 22px;
  font-weight: 800;
  color: var(--hmo-primary);
  line-height: 1;
}

.hmo-property-stat .stat-label {
  display: block;
  font-size: 11px;
  color: var(--hmo-text-muted);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 600;
}

/* ════════════════════════════════════════════════════════════════
   FILTERS / SEARCH BAR
════════════════════════════════════════════════════════════════ */
.hmo-filter-bar {
  background: var(--hmo-white);
  border: 1px solid var(--hmo-border);
  border-radius: var(--hmo-radius);
  padding: 18px 22px;
  margin-bottom: 24px;
  box-shadow: var(--hmo-shadow);
}

.hmo-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.hmo-filter-field {
  flex: 1;
  min-width: 150px;
}

.hmo-filter-field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--hmo-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 5px;
}

.hmo-filter-field input,
.hmo-filter-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--hmo-border);
  border-radius: var(--hmo-radius-sm);
  font-size: 13px;
  color: var(--hmo-text);
  background: #fff;
  font-family: var(--hmo-font);
  transition: border-color 0.2s;
}

.hmo-filter-field input:focus,
.hmo-filter-field select:focus {
  border-color: var(--hmo-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(44,62,80,0.08);
}

/* ════════════════════════════════════════════════════════════════
   TENANT PORTAL
════════════════════════════════════════════════════════════════ */
.hmo-portal-wrap {
  max-width: 1000px;
  margin: 0 auto;
  font-family: var(--hmo-font);
}

/* Portal header */
.hmo-portal-header {
  background: var(--hmo-primary);
  border-radius: var(--hmo-radius) var(--hmo-radius) 0 0;
  padding: 24px 28px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 18px;
}

.hmo-portal-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.hmo-portal-header h2 {
  color: #fff;
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
}

.hmo-portal-header p {
  margin: 0;
  opacity: 0.75;
  font-size: 13px;
}

/* Portal nav */
.hmo-portal-nav {
  display: flex;
  background: #f0f2f5;
  border-left: 1px solid var(--hmo-border);
  border-right: 1px solid var(--hmo-border);
  overflow-x: auto;
}

.hmo-portal-nav a {
  padding: 13px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--hmo-text-muted);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  transition: var(--hmo-transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.hmo-portal-nav a:hover,
.hmo-portal-nav a.active {
  color: var(--hmo-primary);
  border-bottom-color: var(--hmo-primary);
  background: rgba(44,62,80,0.04);
}

/* Portal content */
.hmo-portal-content {
  background: var(--hmo-white);
  border: 1px solid var(--hmo-border);
  border-top: none;
  border-radius: 0 0 var(--hmo-radius) var(--hmo-radius);
  padding: 28px;
  box-shadow: var(--hmo-shadow);
}

/* Portal stat cards */
.hmo-portal-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.hmo-portal-stat-card {
  background: var(--hmo-bg);
  border: 1px solid var(--hmo-border);
  border-radius: var(--hmo-radius);
  padding: 18px;
  text-align: center;
}

.hmo-portal-stat-card .stat-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.hmo-portal-stat-card .stat-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--hmo-primary);
  display: block;
}

.hmo-portal-stat-card .stat-label {
  font-size: 12px;
  color: var(--hmo-text-muted);
  margin-top: 3px;
  display: block;
}

/* Tenancy summary card */
.hmo-tenancy-card {
  background: var(--hmo-bg);
  border: 1px solid var(--hmo-border);
  border-radius: var(--hmo-radius);
  padding: 22px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
}

.hmo-tenancy-card h3 {
  margin: 0 0 14px;
  font-size: 16px;
  color: var(--hmo-primary);
}

.hmo-tenancy-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hmo-detail-row {
  font-size: 13px;
}

.hmo-detail-row .detail-label {
  color: var(--hmo-text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
}

.hmo-detail-row .detail-value {
  font-weight: 700;
  color: var(--hmo-text);
}

/* Activity feed */
.hmo-activity-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hmo-activity-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hmo-border);
}

.hmo-activity-item:last-child { border-bottom: none; }

.hmo-activity-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  background: var(--hmo-bg);
  border: 1px solid var(--hmo-border);
}

.hmo-activity-body { flex: 1; }

.hmo-activity-body strong {
  display: block;
  font-size: 14px;
  color: var(--hmo-primary);
}

.hmo-activity-body span {
  font-size: 12px;
  color: var(--hmo-text-muted);
}

.hmo-activity-time {
  font-size: 11px;
  color: var(--hmo-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════════
   ALERTS / NOTICES
════════════════════════════════════════════════════════════════ */
.hmo-alert {
  padding: 14px 18px;
  border-radius: var(--hmo-radius-sm);
  font-size: 14px;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-left: 4px solid;
}

.hmo-alert-success { background: #eafaf1; border-color: var(--hmo-accent); color: #155724; }
.hmo-alert-error   { background: #fdecea; border-color: var(--hmo-danger); color: #721c24; }
.hmo-alert-warning { background: #fef9e7; border-color: var(--hmo-warn);   color: #7d6608; }
.hmo-alert-info    { background: #e8f4fd; border-color: var(--hmo-accent-2);color: #1a5276; }

/* ════════════════════════════════════════════════════════════════
   PAGINATION
════════════════════════════════════════════════════════════════ */
.hmo-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 32px 0;
  flex-wrap: wrap;
}

.hmo-pagination a,
.hmo-pagination span {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--hmo-radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid var(--hmo-border);
  text-decoration: none;
  color: var(--hmo-text);
  transition: var(--hmo-transition);
  background: var(--hmo-white);
}

.hmo-pagination a:hover {
  border-color: var(--hmo-primary);
  color: var(--hmo-primary);
}

.hmo-pagination .current {
  background: var(--hmo-primary);
  color: #fff;
  border-color: var(--hmo-primary);
}

/* ════════════════════════════════════════════════════════════════
   UTILITY CLASSES
════════════════════════════════════════════════════════════════ */
.hmo-text-muted   { color: var(--hmo-text-muted); }
.hmo-text-accent  { color: var(--hmo-accent); }
.hmo-text-danger  { color: var(--hmo-danger); }
.hmo-fw-bold      { font-weight: 700; }
.hmo-mt-0         { margin-top: 0; }
.hmo-mb-0         { margin-bottom: 0; }
.hmo-flex         { display: flex; align-items: center; gap: 8px; }
.hmo-d-none       { display: none; }

/* No results */
.hmo-no-results {
  text-align: center;
  padding: 48px 24px;
  color: var(--hmo-text-muted);
  font-size: 15px;
}

.hmo-no-results .hmo-no-results-icon { font-size: 48px; margin-bottom: 14px; display: block; }

/* Loading spinner */
.hmo-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--hmo-border);
  border-top-color: var(--hmo-primary);
  border-radius: 50%;
  animation: hmoSpin 0.7s linear infinite;
  display: inline-block;
}

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

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hmo-single-layout  { grid-template-columns: 1fr; }
  .hmo-rooms-grid     { grid-template-columns: 1fr; }
  .hmo-properties-grid{ grid-template-columns: 1fr; }
  .hmo-booking-sidebar{ position: static; }
  .hmo-tenancy-card   { grid-template-columns: 1fr; }
  .hmo-portal-stat-card { padding: 12px; }
  .hmo-filter-field   { min-width: 100%; }
  .hmo-portal-content { padding: 16px; }
  .hmo-tenancy-details{ grid-template-columns: 1fr; }
}
