﻿/* VendeDO â€” Auth & Dashboard Styles */

/* â”€â”€ AUTH PAGES â”€â”€ */
.auth-page { min-height: 100vh; background: var(--gray-100); display: flex; flex-direction: column; }
.auth-main  { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card  {
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 40px; width: 100%; max-width: 460px;
}
.auth-logo  { display: flex; justify-content: center; margin-bottom: 28px; }
.auth-logo img { height: 56px; }
.auth-title { font-size: 1.5rem; font-weight: 800; color: var(--dark); text-align: center; margin-bottom: 6px; }
.auth-sub   { font-size: 0.875rem; color: var(--gray-500); text-align: center; margin-bottom: 28px; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 0.78rem; font-weight: 700; color: var(--gray-600); text-transform: uppercase; letter-spacing: 0.4px; }
.form-input {
  width: 100%;                        /* fill the grid cell so 4-up rows align */
  box-sizing: border-box;             /* padding+border included in the width  */
  padding: 11px 14px; border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
  font-size: 0.9rem; color: var(--gray-900); outline: none; transition: border-color 0.2s;
  background: var(--white); font-family: var(--font);
}
/* Selects need extra right padding for the dropdown chevron */
select.form-input { padding-right: 32px; appearance: auto; }
.form-input:focus { border-color: var(--primary); }
.form-input.error { border-color: var(--accent); }
.form-error { font-size: 0.78rem; color: var(--accent); font-weight: 600; }
.form-hint  { font-size: 0.75rem; color: var(--gray-400); }

/* Role selector cards */
.role-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-option { position: relative; }
.role-option input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.role-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 12px; border: 2px solid var(--gray-200); border-radius: var(--radius-md);
  cursor: pointer; transition: all 0.2s; text-align: center;
}
.role-card i { font-size: 1.5rem; color: var(--gray-400); transition: color 0.2s; }
.role-card strong { font-size: 0.88rem; font-weight: 700; color: var(--gray-700); }
.role-card span   { font-size: 0.75rem; color: var(--gray-500); line-height: 1.4; }
.role-option input:checked + .role-card { border-color: var(--primary); background: var(--primary-light); }
.role-option input:checked + .role-card i { color: var(--primary); }
.role-option input:checked + .role-card strong { color: var(--primary); }

.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--gray-400); font-size: 0.8rem; margin: 4px 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--gray-200); }

.auth-switch { text-align: center; font-size: 0.875rem; color: var(--gray-500); margin-top: 8px; }
.auth-switch a { color: var(--primary); font-weight: 700; }
.auth-switch a:hover { text-decoration: underline; }

.auth-alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600; margin-bottom: 4px; display: none; }
.auth-alert.show  { display: block; }
.auth-alert.error { background: var(--accent-light); color: var(--accent); border: 1px solid #FECACA; }
.auth-alert.info  { background: var(--primary-light); color: var(--primary-dark); border: 1px solid #BFDBFE; }

/* â”€â”€ NAVBAR USER MENU â”€â”€ */
.nav-user-menu {
  display: none; align-items: center; gap: 8px;
  padding: 5px 12px 5px 5px; border: 1.5px solid var(--gray-200);
  border-radius: 24px; background: var(--white); cursor: pointer;
}
.nav-user-avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--primary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.nav-user-avatar i { color: var(--white); font-size: 0.85rem; }
.nav-user-name { font-size: 0.85rem; font-weight: 700; color: var(--dark); }
.nav-user-role { font-size: 0.7rem; color: var(--gray-500); }

/* â”€â”€ DASHBOARD LAYOUT â”€â”€ */
.dash-page { min-height: 100vh; background: var(--gray-100); }
.dash-layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 68px); }

.dash-sidebar {
  background: var(--dark); color: rgba(255,255,255,0.75);
  padding: 28px 0; display: flex; flex-direction: column;
}
.dash-sidebar-header { padding: 0 20px 24px; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 16px; }
.dash-user-name { font-size: 0.95rem; font-weight: 700; color: var(--white); }
.dash-user-role { font-size: 0.75rem; opacity: 0.6; margin-top: 2px; }
.dash-user-avatar {
  width: 44px; height: 44px; background: var(--primary); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.dash-user-avatar i { color: var(--white); font-size: 1.1rem; }

.dash-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.dash-nav-link {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 500;
  color: rgba(255,255,255,0.65); transition: all 0.2s; cursor: pointer;
}
.dash-nav-link:hover, .dash-nav-link.active {
  background: rgba(255,255,255,0.1); color: var(--white);
}
.dash-nav-link i { width: 16px; font-size: 0.9rem; }
.dash-nav-divider { height: 1px; background: rgba(255,255,255,0.1); margin: 10px 0; }

.dash-main { padding: 32px; overflow-y: auto; }
.dash-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 12px; }
.dash-title { font-size: 1.5rem; font-weight: 800; color: var(--dark); }
.dash-sub   { font-size: 0.875rem; color: var(--gray-500); margin-top: 2px; }

/* Stat cards */
.dash-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.dash-stat-card { background: var(--white); border-radius: var(--radius-md); padding: 20px; border: 1px solid var(--gray-200); }
.dash-stat-card .num { font-size: 2rem; font-weight: 800; color: var(--dark); line-height: 1; }
.dash-stat-card .lbl { font-size: 0.78rem; color: var(--gray-500); margin-top: 4px; }
.dash-stat-card .icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.icon-blue  { background: var(--primary-light); color: var(--primary); }
.icon-green { background: #D6F0DD; color: var(--green); }
.icon-amber { background: #FEF3C7; color: #D97706; }
.icon-red   { background: var(--accent-light); color: var(--accent); }

/* Status badges */
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; }
.status-pending  { background: #FEF3C7; color: #92400E; }
.status-approved { background: #D6F0DD; color: #1F7A3A; }
.status-rejected { background: var(--accent-light); color: var(--accent); }

/* Listings table (admin) */
.data-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--gray-200); }
.data-table th { background: var(--gray-100); padding: 12px 16px; text-align: left; font-size: 0.75rem; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--gray-200); white-space: nowrap; }
.data-table td { padding: 14px 16px; font-size: 0.875rem; color: var(--gray-700); border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--gray-100); }
.table-img { width: 52px; height: 40px; border-radius: 6px; object-fit: cover; }
.table-title { font-weight: 600; color: var(--dark); max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-actions { display: flex; gap: 6px; flex-wrap: nowrap; }

/* Tabs */
.dash-tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--gray-200); margin-bottom: 20px; }
.dash-tab {
  padding: 10px 18px; font-size: 0.875rem; font-weight: 600; color: var(--gray-500);
  cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -2px;
  transition: all 0.2s; background: none; border-top: none; border-left: none; border-right: none;
}
.dash-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.dash-tab:hover:not(.active) { color: var(--gray-900); }
.dash-panel { display: none; }
.dash-panel.active { display: block; animation: fadeIn 0.2s ease; }

/* â”€â”€ LISTING SUBMISSION FORM â”€â”€ */
.submit-page { background: var(--gray-100); min-height: 100vh; }
.submit-wrap { max-width: 860px; margin: 0 auto; padding: 36px 24px; }
.submit-card { background: var(--white); border-radius: var(--radius-lg); padding: 36px; border: 1px solid var(--gray-200); }
.submit-section { margin-bottom: 32px; padding-bottom: 32px; border-bottom: 1px solid var(--gray-100); }
.submit-section:last-child { border-bottom: none; margin-bottom: 0; }
.submit-section-title { font-size: 1rem; font-weight: 800; color: var(--dark); margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.submit-section-title i { color: var(--primary); }
.submit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.submit-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.submit-grid.cols-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.col-span-2 { grid-column: span 2; }

/* Photo upload area */
.photo-upload-area {
  border: 2px dashed var(--gray-300); border-radius: var(--radius-md); padding: 36px;
  text-align: center; cursor: pointer; transition: all 0.2s; background: var(--gray-100);
}
.photo-upload-area:hover, .photo-upload-area.dragover { border-color: var(--primary); background: var(--primary-light); }
.photo-upload-area i { font-size: 2rem; color: var(--gray-400); margin-bottom: 10px; display: block; }
.photo-upload-area p { font-size: 0.875rem; color: var(--gray-500); }
.photo-upload-area strong { color: var(--primary); }
/* Grid uses a CSS variable so a single class toggle changes tile size everywhere.
   Sizes are bumped to better suit real-estate photography â€” wider tiles,
   3:2 aspect (photography standard), with full-width cards at XL. */
.photo-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--photo-grid-min, 220px), 1fr));
  gap: 14px;
  margin-top: 14px;
}
.photo-preview-grid.size-sm { --photo-grid-min: 160px; }
.photo-preview-grid.size-md { --photo-grid-min: 220px; }
.photo-preview-grid.size-lg { --photo-grid-min: 320px; }
.photo-preview-grid.size-xl { --photo-grid-min: 460px; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }

/* New layered structure: each .photo-preview is now a vertical stack of
   .photo-img-wrap (the image area with overlays) and .photo-meta-bar
   (controls below). The image area's height is what changes with grid size. */
.photo-preview {
  height: auto !important;
  display: flex; flex-direction: column;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
}
.photo-img-wrap {
  position: relative; width: 100%; overflow: hidden; flex-shrink: 0;
  aspect-ratio: 3 / 2;   /* photography-standard; lets width determine height */
}
/* Explicit heights kept as a fallback for older browsers and as overrides
   when the wrapping grid cell isn't dictating width yet (e.g., during reflow) */
.photo-preview-grid.size-sm .photo-img-wrap { min-height: 110px; }
.photo-preview-grid.size-md .photo-img-wrap { min-height: 150px; }
.photo-preview-grid.size-lg .photo-img-wrap { min-height: 215px; }
.photo-preview-grid.size-xl .photo-img-wrap { min-height: 310px; }

/* Saved badge for existing photos */
.photo-saved-badge {
  position: absolute; bottom: 5px; right: 5px;
  background: rgba(0,0,0,.5); color: #fff;
  font-size: .6rem; padding: 2px 5px; border-radius: 3px;
}

/* Meta bar â€” sits BELOW the image (no longer overlaid).
   Contains the Encuadrar icon button, dimensions text, quality + tile selects. */
.photo-meta-bar {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 6px;
  background: var(--gray-100); border-top: 1px solid var(--gray-200);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
}
.photo-meta-bar .meta-btn {
  background: var(--white); border: 1px solid var(--gray-300); color: var(--gray-600);
  width: 24px; height: 24px; border-radius: 4px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; font-size: .72rem;
}
.photo-meta-bar .meta-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.photo-info-badge-text {
  font-size: .65rem; font-weight: 600; color: var(--gray-600); line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex: 1; min-width: 0;
}
.photo-meta-bar .meta-select {
  background: var(--white); color: var(--gray-700);
  border: 1px solid var(--gray-300); border-radius: 4px;
  font-size: .65rem; font-weight: 600; padding: 3px 18px 3px 5px;
  cursor: pointer; flex-shrink: 1; min-width: 0;
  max-width: 38%;
  appearance: auto;
}
.photo-meta-bar .meta-select:hover { border-color: var(--primary); }
.photo-meta-bar .meta-select:focus { outline: 2px solid var(--primary); outline-offset: -1px; }

/* Per-photo tile size override â€” bumps a single tile to a wider span
   for hero-shot emphasis. Aspect ratio is inherited from .photo-img-wrap. */
.photo-preview.tile-sm { grid-column: span 1; }
.photo-preview.tile-md { grid-column: span 1; }
.photo-preview.tile-lg { grid-column: span 2; }
.photo-preview.tile-xl { grid-column: span 3; }
.photo-preview.tile-xl { grid-column: span 2; }

/* Photo-controls toolbar (grid size + quality) */
.photo-toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 10px 0 4px; padding: 10px 12px;
  background: var(--gray-100); border-radius: var(--radius-sm);
}
.photo-toolbar-label {
  font-size: .72rem; color: var(--gray-500); font-weight: 700;
  text-transform: uppercase; letter-spacing: .4px;
}
.seg-btn-group {
  display: inline-flex; border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm); overflow: hidden; background: #fff;
}
.seg-btn {
  background: transparent; border: none; padding: 6px 10px;
  cursor: pointer; font-size: .78rem; color: var(--gray-500);
  border-right: 1px solid var(--gray-200); font-weight: 700;
}
.seg-btn:last-child { border-right: none; }
.seg-btn.active { background: var(--primary); color: #fff; }
.seg-btn:hover:not(.active) { background: var(--gray-100); }
.photo-remove {
  position: absolute; top: 8px; left: 8px;
  width: 32px; height: 32px;
  background: rgba(192,49,43,0.95);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: 2px solid rgba(255,255,255,0.85);
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  transition: transform .15s ease, background .15s ease;
  z-index: 4;
}
.photo-remove:hover { background: rgba(160,30,25,1); transform: scale(1.08); }
.photo-remove i { color: #fff; font-size: 0.88rem; }
.upload-progress { margin-top: 12px; }
.progress-bar { height: 4px; background: var(--gray-200); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 2px; transition: width 0.3s; width: 0%; }

/* â”€â”€ FAVORITES PAGE â”€â”€ */
.empty-state { text-align: center; padding: 80px 32px; color: var(--gray-500); }
.empty-state i { font-size: 3rem; color: var(--gray-300); margin-bottom: 16px; display: block; }
.empty-state h3 { font-size: 1.2rem; font-weight: 700; color: var(--dark); margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; max-width: 360px; margin: 0 auto 20px; }

/* â”€â”€ TOAST NOTIFICATION â”€â”€ */
.vd-toast {
  position: fixed; bottom: 28px; right: 28px; z-index: 9999;
  padding: 14px 20px; border-radius: var(--radius-md); font-size: 0.875rem; font-weight: 600;
  box-shadow: var(--shadow-lg); transform: translateY(20px); opacity: 0;
  transition: all 0.3s ease; max-width: 360px;
}
.vd-toast.show { transform: none; opacity: 1; }
.vd-toast-success { background: #1F7A3A; color: white; }
.vd-toast-error   { background: var(--accent); color: white; }
.vd-toast-info    { background: var(--primary); color: white; }

/* â”€â”€ AUTH FLASH PREVENTION â”€â”€ */
/* Hide auth buttons until JS confirms the auth state (prevents signed-in users
   seeing the login button briefly on page load)                                */
body:not(.auth-ready) #nav-signin,
body:not(.auth-ready) #nav-list,
body:not(.auth-ready) #nav-user-menu { visibility: hidden; }

/* â”€â”€ STATUS BADGES (extended) â”€â”€ */
.status-just-listed  { background: #DBEAFE; color: #1D4ED8; }
.status-active       { background: #D6F0DD; color: #1F7A3A; }
.status-under-contract { background: #FEF3C7; color: #92400E; }
.status-price-reduced  { background: #F3E8FF; color: #7C3AED; }
.status-sold         { background: #FCE7F3; color: #9D174D; }

/* â”€â”€ LISTING STATUS SELECTOR (submit form) â”€â”€ */
.listing-status-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap:10px; }
.listing-status-option { position: relative; }
.listing-status-option input[type="radio"] { position:absolute; opacity:0; width:0; height:0; }
.listing-status-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 10px; border: 2px solid var(--gray-200); border-radius: var(--radius-md);
  cursor: pointer; transition: all .2s; text-align: center; font-size: .82rem; font-weight: 600; color: var(--gray-600);
}
.listing-status-card i { font-size: 1.3rem; }
.listing-status-option input:checked + .listing-status-card { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }

/* â”€â”€ DRAG-TO-REORDER PHOTOS â”€â”€ */
.photo-preview { cursor: grab; transition: opacity .2s, transform .2s; }
.photo-preview.dragging { opacity: .45; transform: scale(.96); cursor: grabbing; }
.photo-preview.drag-over { outline: 2.5px solid var(--primary); outline-offset: 2px; }
.cover-badge {
  position: absolute; bottom: 5px; left: 5px;
  background: var(--primary); color: #fff;
  font-size: .62rem; font-weight: 800; padding: 2px 7px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: .4px; pointer-events: none;
}
.drag-handle {
  position: absolute; top: 4px; left: 4px; width: 22px; height: 22px;
  background: rgba(0,0,0,.5); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
}
.drag-handle i { color: #fff; font-size: .6rem; }
/* (Earlier .photo-preview-grid definition above is the single source of truth â€”
   the duplicate that used to live here masked the S/M/L/XL size toggle.) */
.photo-count-hint { font-size: .75rem; color: var(--gray-400); margin-top: 6px; }

/* â”€â”€ VIDEO INPUT SECTION â”€â”€ */
.video-input-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.video-url-input { flex: 1; }
.video-platform-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 4px; font-size: .75rem; font-weight: 700;
  margin-top: 5px;
}
.chip-youtube { background: #FEE2E2; color: #B91C1C; }
.chip-vimeo   { background: #EDE9FE; color: #5B21B6; }
.add-video-btn { margin-top: 4px; }

/* â”€â”€ RESPONSIVE â”€â”€ */
@media (max-width: 900px) {
  .dash-layout { grid-template-columns: 1fr; }
  .dash-sidebar { display: none; }
  .submit-grid { grid-template-columns: 1fr; }
  .submit-grid.cols-3 { grid-template-columns: 1fr 1fr; }
  .submit-grid.cols-4 { grid-template-columns: 1fr 1fr; }
  .col-span-2 { grid-column: span 1; }
}

@media (max-width: 600px) {
  .auth-card { padding: 28px 20px; }
  .submit-card { padding: 24px 16px; }
  .dash-main { padding: 20px 16px; }
  .role-selector { grid-template-columns: 1fr; }
  .submit-grid.cols-3 { grid-template-columns: 1fr; }
  .submit-grid.cols-4 { grid-template-columns: 1fr; }
}

