/* ═══════════════════════════════════════════════════════════════
   VIVEREA — Component Styles (Dark + Light Theme)
   All colors via CSS tokens — auto-switches with data-theme
   ═══════════════════════════════════════════════════════════════ */

/* ═══ HEADER BAR (Logo + User) ═══ */
.v-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.v-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.v-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.v-logo img {
  height: 32px;
}

[data-theme="dark"] .v-logo img { opacity: 0.92; }
[data-theme="light"] .v-logo img { opacity: 1; }

.v-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.v-user-email {
  font-size: 0.8125rem;
  color: var(--on-bg-dim);
  font-weight: 500;
  font-family: var(--font-sans);
}

.v-btn-logout {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--separator);
  border-radius: 10px;
  color: var(--on-bg-dim);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms ease-out;
  font-family: var(--font-sans);
  line-height: 1;
}

.v-btn-logout:hover {
  background: var(--hover-bg);
  color: var(--on-bg);
}

/* ═══ THEME TOGGLE — hidden ═══ */
.theme-toggle { display: none !important; }

/* ═══ NAVIGATION BAR (Page links) ═══ */
.v-nav {
  background: var(--header-bg);
  border-bottom: 1px solid var(--separator);
}

.v-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0;
  height: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.v-nav-inner::-webkit-scrollbar { display: none; }

.v-nav-item {
  display: flex;
  align-items: center;
  padding: 0 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--on-bg-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 150ms ease-out, border-color 150ms ease-out;
  white-space: nowrap;
  font-family: var(--font-sans);
}

.v-nav-item:hover {
  color: var(--on-bg-dim);
}

.v-nav-item.active {
  color: var(--accent-text);
  border-bottom-color: var(--nav-active-border);
  font-weight: 600;
}

/* ═══ BUTTONS ═══ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 10px 16px;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--r-xs);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  border: none;
  text-decoration: none;
  font-family: var(--font-sans);
  line-height: 1;
  letter-spacing: 0.01em;
}

.btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

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

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-color);
  border: 1px solid var(--btn-primary-border);
  box-shadow: var(--btn-primary-shadow);
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--btn-primary-hover-bg);
  transform: translateY(-1px);
  box-shadow: var(--btn-primary-hover-shadow);
}

.btn-primary:active {
  transform: translateY(0);
  background: var(--btn-primary-active-bg);
}

.btn-secondary {
  background: var(--btn-secondary-bg);
  color: var(--on-bg);
  border: 1px solid var(--btn-secondary-border);
}

.btn-secondary:hover {
  background: var(--btn-secondary-hover-bg);
  border-color: var(--btn-secondary-hover-border);
}

.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
  border: 1px solid rgba(220,38,38,0.16);
}

.btn-danger:hover {
  background: rgba(220,38,38,0.14);
}

.btn-success {
  background: var(--success-dim);
  color: var(--success);
  border: 1px solid rgba(22,163,74,0.16);
}

.btn-success:hover {
  background: rgba(22,163,74,0.14);
}

.btn-small {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

/* ═══ INPUTS ═══ */
.input,
.form-group input,
.form-group select,
.form-group textarea {
  background: var(--input-bg);
  border-radius: var(--r-xs);
  color: var(--on-bg);
  border: 1px solid var(--input-border);
  padding: 10px 12px;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  transition: all var(--dur) var(--ease);
  width: 100%;
}

.input::placeholder,
.form-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--separator);
}

.form-section-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--on-bg);
  margin: 0 0 1rem;
  letter-spacing: 0.02em;
}

.form-section.hidden {
  display: none !important;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--placeholder);
}

.input:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--input-focus-border);
  box-shadow: var(--input-focus-ring);
  background: var(--input-focus-bg);
}

/* ═══ KPI CARDS ═══ */
.kpi {
  background: var(--kpi-bg);
  border: none;
  border-radius: var(--r-m);
  box-shadow: var(--shadow-2);
  padding: var(--sp-5);
  color: var(--on-bg);
  font-variant-numeric: tabular-nums;
  transition: all var(--dur) var(--ease);
}

.kpi .label,
.kpi-label {
  color: var(--on-bg-muted);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.kpi .value,
.kpi-value {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.kpi:hover {
  box-shadow: var(--shadow-3);
  transform: translateY(-2px);
}

/* ═══ SEGMENTED CONTROLS ═══ */
.segment {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--segment-bg);
  border: none;
}

.segment button {
  padding: 8px 12px;
  border-radius: var(--r-pill);
  color: var(--on-bg-muted);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--font-sans);
  transition: all var(--dur) var(--ease);
}

.segment button:hover {
  color: var(--on-bg-dim);
}

.segment button[aria-pressed="true"],
.segment button.active {
  background: var(--segment-active-bg);
  color: var(--on-bg);
  box-shadow: var(--segment-active-shadow);
}

/* ═══ CARDS ═══ */
.card {
  background: var(--bg-1);
  border: none;
  border-radius: var(--r-m);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  transition: all var(--dur) var(--ease);
}

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

.card .chip {
  border-radius: var(--r-pill);
  padding: 4px 8px;
  border: 1px solid var(--chip-border);
  color: var(--on-bg-dim);
  font-size: 0.75rem;
  font-weight: 500;
}

/* ═══ EMPTY STATES ═══ */
.v-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3.5rem 2rem;
  background: var(--empty-bg);
  border: none;
  border-radius: var(--r-m);
  margin: 1rem 0;
  box-shadow: var(--shadow-1);
}

.v-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--r-m);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--empty-icon-bg);
  border: none;
  margin-bottom: 1.25rem;
  color: var(--on-bg-muted);
}

.v-empty-icon svg {
  width: 26px;
  height: 26px;
  stroke-width: 1.5;
}

.v-empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--on-bg);
  margin-bottom: 0.375rem;
  font-family: var(--font-sans);
}

.v-empty-sub {
  font-size: 0.8125rem;
  color: var(--on-bg-muted);
  max-width: 320px;
  line-height: var(--lh-body);
  margin-bottom: 1.25rem;
}

.v-empty-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  background: var(--empty-btn-bg);
  border: none;
  border-radius: var(--r-s);
  color: var(--on-bg);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  text-decoration: none;
  font-family: var(--font-sans);
}

.v-empty-btn:hover {
  background: var(--empty-btn-hover-bg);
  color: var(--on-bg);
}

.v-empty-btn svg {
  width: 14px;
  height: 14px;
}

/* ═══ TOAST NOTIFICATIONS ═══ */
.toast-container {
  position: fixed;
  top: 100px;
  right: 2rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  background: var(--toast-bg);
  backdrop-filter: blur(var(--blur-m));
  border: none;
  border-radius: var(--r-m);
  padding: 0.875rem 1.25rem;
  color: var(--on-bg);
  font-size: 0.875rem;
  box-shadow: var(--shadow-3);
  transform: translateX(400px);
  opacity: 0;
  transition: all 0.3s var(--ease);
  pointer-events: auto;
  min-width: 300px;
  max-width: 400px;
  font-family: var(--font-sans);
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-success {
  border-left: 3px solid var(--success);
}

.toast-error {
  border-left: 3px solid var(--danger);
}

/* ═══ MODALS ═══ */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: var(--modal-overlay);
  backdrop-filter: blur(var(--blur-m));
  animation: fadeIn var(--dur);
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--bg-1);
  border-radius: var(--r-l);
  padding: 0;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-3);
  animation: slideUp 0.3s var(--ease);
  border: none;
}

.modal-small { max-width: 400px; }
.modal-medium { max-width: 500px; }
.modal-large { max-width: 1000px; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--separator-subtle);
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ═══ PROPERTY DETAIL DRAWER ═══ */
.property-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
}

.property-drawer.show {
  display: block;
  pointer-events: auto;
}

.property-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 300ms ease;
}

.property-drawer.show .property-drawer-backdrop {
  opacity: 1;
}

.property-drawer-panel {
  position: absolute;
  right: 0;
  top: 0;
  height: 100vh;
  width: 460px;
  max-width: 100%;
  background: var(--bg-1);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 300ms ease;
  overflow: hidden;
}

.property-drawer.show .property-drawer-panel {
  transform: translateX(0);
}

.property-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--separator);
  flex-shrink: 0;
}

.property-drawer-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
  color: var(--on-bg);
}

.property-drawer-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--on-bg-dim);
  padding: 0.25rem;
  border-radius: 6px;
  transition: color 150ms ease, background 150ms ease;
}

.property-drawer-close:hover {
  color: var(--on-bg);
  background: var(--hover-bg);
}

.property-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.property-drawer-gallery {
  margin-bottom: 1.25rem;
}

.property-drawer-main-image {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: var(--r-s);
  background: var(--bg-0);
}

.property-drawer-thumbnails {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.property-drawer-thumbnails img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 150ms ease, opacity 150ms ease;
}

.property-drawer-thumbnails img:hover,
.property-drawer-thumbnails img.active {
  border-color: var(--accent);
}

.property-drawer-badges {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.property-drawer-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 8px;
}

.property-drawer-badges .property-status-badge-overlay {
  display: inline-block !important;
}

.property-drawer-property-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--on-bg);
}

.property-drawer-address {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: var(--on-bg-dim);
  font-size: 0.9375rem;
}

.property-drawer-address svg {
  flex-shrink: 0;
}

.property-drawer-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1rem;
}

.property-drawer-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.property-drawer-info-label {
  font-size: 0.75rem;
  color: var(--on-bg-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.property-drawer-info-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--on-bg);
}

.property-drawer-info-value.price {
  color: var(--accent);
}

.property-drawer-notes {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--bg-0);
  border-radius: var(--r-s);
  font-size: 0.875rem;
  color: var(--on-bg-dim);
  line-height: 1.5;
}

.property-drawer-notes:empty {
  display: none;
}

.property-drawer-section {
  margin-bottom: 1rem;
}

.property-drawer-section:empty {
  display: none;
}

.property-drawer-section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--on-bg-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.5rem;
}

.property-drawer-section-content {
  font-size: 0.875rem;
  color: var(--on-bg);
  line-height: 1.5;
}

.property-drawer-meta {
  font-size: 0.8125rem;
  color: var(--on-bg-dim);
}

.property-drawer-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--separator);
  flex-shrink: 0;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  .v-header-inner,
  .v-nav-inner {
    padding: 0 1rem;
  }
}
