/* ============================================
   EstateVue Admin Dashboard - Creative Glass UI
   ============================================ */

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --primary-glow: rgba(99,102,241,0.3);
  --accent: #f59e0b;
  --accent-glow: rgba(245,158,11,0.25);
  --bg: #f0f2f8;
  --bg-card: rgba(255,255,255,0.85);
  --bg-glass: rgba(255,255,255,0.6);
  --bg-dark: #0c0f1a;
  --bg-dark-card: rgba(15,23,42,0.9);
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: rgba(148,163,184,0.18);
  --success: #10b981;
  --danger: #f43f5e;
  --warning: #f59e0b;
  --shadow: 0 2px 12px rgba(0,0,0,0.04);
  --shadow-md: 0 8px 30px rgba(0,0,0,0.06);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.08);
  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --gradient-mesh: 
    radial-gradient(ellipse at 20% 0%, rgba(99,102,241,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(245,158,11,0.06) 0%, transparent 50%);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  background-image: var(--gradient-mesh);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

@keyframes fadeIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideIn { from { opacity:0; transform:translateX(-24px); } to { opacity:1; transform:translateX(0); } }
@keyframes slideUp { from { opacity:0; transform:translateY(40px); } to { opacity:1; transform:translateY(0); } }
@keyframes scaleIn { from { opacity:0; transform:scale(0.9); } to { opacity:1; transform:scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 0%,100%{ transform:translateX(0); } 25%{ transform:translateX(-6px); } 75%{ transform:translateX(6px); } }
@keyframes gradient-shift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes glow-pulse { 0%,100% { box-shadow: 0 0 20px var(--primary-glow); } 50% { box-shadow: 0 0 40px var(--primary-glow); } }
@keyframes float { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-6px); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes blob { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(20px,-30px) scale(1.05); } 66% { transform: translate(-15px,15px) scale(0.95); } }

.animate-fade { animation: fadeIn 0.4s ease-out; }

/* ========== LOGIN PAGE ========== */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg-dark);
  padding: 20px;
  position: relative; overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute; width: 400px; height: 400px;
  background: var(--primary); border-radius: 50%;
  filter: blur(120px); opacity: 0.15;
  top: -100px; right: -100px;
  animation: blob 12s ease-in-out infinite;
}
.login-page::after {
  content: '';
  position: absolute; width: 300px; height: 300px;
  background: var(--accent); border-radius: 50%;
  filter: blur(100px); opacity: 0.1;
  bottom: -80px; left: -80px;
  animation: blob 12s ease-in-out infinite reverse;
}

.login-card {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(30px);
  border-radius: var(--radius); padding: 44px;
  width: 100%; max-width: 440px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.3);
  animation: scaleIn 0.6s cubic-bezier(0.22,1,0.36,1);
  position: relative; z-index: 1;
  border: 1px solid rgba(255,255,255,0.3);
}
.login-logo { text-align: center; margin-bottom: 36px; }
.login-logo h1 {
  font-size: 30px; font-weight: 900; letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  background-size: 200% 200%;
  animation: gradient-shift 4s ease infinite;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.login-logo p { color: var(--text-secondary); font-size: 14px; margin-top: 6px; font-weight: 500; }

.form-group { margin-bottom: 22px; }
.form-group label {
  display: block; font-size: 12px; font-weight: 800;
  color: var(--text-secondary); margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: 0.8px;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 14px 18px; border: 1.5px solid var(--border);
  border-radius: var(--radius-xs); font-size: 15px; color: var(--text);
  background: rgba(248,250,252,0.8); outline: none;
  transition: all 0.3s cubic-bezier(0.22,1,0.36,1);
  font-family: 'Inter', sans-serif; font-weight: 500;
  backdrop-filter: blur(4px);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.08), 0 4px 12px rgba(99,102,241,0.08);
  background: white;
}
.form-group textarea { resize: vertical; min-height: 110px; }
.form-group .error { border-color: var(--danger); animation: shake 0.3s; }
.form-error { color: var(--danger); font-size: 13px; margin-top: 4px; font-weight: 600; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

.btn {
  padding: 14px 24px; border-radius: var(--radius-xs);
  font-size: 14px; font-weight: 700; cursor: pointer;
  border: none; display: inline-flex; align-items: center;
  justify-content: center; gap: 8px;
  transition: all 0.3s cubic-bezier(0.22,1,0.36,1);
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.1px;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-primary:hover { box-shadow: 0 8px 28px var(--primary-glow); transform: translateY(-1px); }
.btn-success { background: linear-gradient(135deg, var(--success), #059669); color: white; box-shadow: 0 4px 16px rgba(16,185,129,0.3); }
.btn-danger { background: linear-gradient(135deg, var(--danger), #e11d48); color: white; box-shadow: 0 4px 16px rgba(244,63,94,0.3); }
.btn-outline { background: var(--bg-glass); border: 1.5px solid var(--border); color: var(--text); backdrop-filter: blur(8px); }
.btn-outline:hover { background: rgba(99,102,241,0.04); border-color: var(--primary); }
.btn-full { width: 100%; }
.btn-sm { padding: 10px 16px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ========== DASHBOARD LAYOUT ========== */
.dashboard { display: flex; min-height: 100vh; }

.sidebar {
  width: 270px; background: var(--bg-dark);
  color: white; padding: 28px 0; position: fixed; height: 100vh;
  display: flex; flex-direction: column; z-index: 100;
  box-shadow: 4px 0 30px rgba(0,0,0,0.2);
}
.sidebar-logo {
  padding: 0 26px 26px; border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 18px;
}
.sidebar-logo h2 {
  font-size: 24px; font-weight: 900; letter-spacing: -0.5px;
  background: linear-gradient(135deg, #818cf8, var(--accent));
  background-size: 200% 200%;
  animation: gradient-shift 5s ease infinite;
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.sidebar-logo span { font-size: 12px; color: var(--text-muted); font-weight: 600; }

.sidebar-nav { flex: 1; padding: 0 14px; }
.nav-link {
  display: flex; align-items: center; gap: 13px;
  padding: 13px 18px; border-radius: 12px;
  color: var(--text-muted); cursor: pointer;
  font-size: 14px; font-weight: 600;
  transition: all 0.3s; margin-bottom: 4px;
}
.nav-link:hover { background: rgba(255,255,255,0.04); color: white; }
.nav-link.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(99,102,241,0.08));
  color: white;
  box-shadow: inset 0 0 0 1px rgba(99,102,241,0.15);
}
.nav-link i { width: 22px; text-align: center; font-size: 17px; }

.sidebar-footer { padding: 18px 26px; border-top: 1px solid rgba(255,255,255,0.06); }
.sidebar-footer .admin-info { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sidebar-footer .admin-avatar {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.sidebar-footer .admin-name { font-size: 14px; font-weight: 700; }
.sidebar-footer .admin-email { font-size: 12px; color: var(--text-muted); }

/* ========== MAIN CONTENT ========== */
.main-panel {
  flex: 1; margin-left: 270px; padding: 28px 36px;
  max-width: calc(100% - 270px);
}
.page-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 28px;
}
.page-header h1 { font-size: 26px; font-weight: 900; letter-spacing: -0.5px; }

/* ========== STAT CARDS ========== */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px; margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  animation: fadeIn 0.4s ease-out;
  transition: all 0.3s;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0; transition: opacity 0.3s;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.stat-card:hover::before { opacity: 1; }
.stat-card .stat-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 14px;
}
.stat-card .stat-value { font-size: 32px; font-weight: 900; letter-spacing: -1px; }
.stat-card .stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; font-weight: 600; }

/* ========== TABLE ========== */
.table-container {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md); border: 1px solid var(--border);
  overflow: hidden;
}
.table-header {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.table-header h3 { font-size: 17px; font-weight: 800; letter-spacing: -0.2px; }

table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 14px 18px; font-size: 11px; font-weight: 800;
  color: var(--text-secondary); text-align: left;
  text-transform: uppercase; letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border);
  background: rgba(248,250,252,0.6);
}
tbody td {
  padding: 14px 18px; font-size: 14px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr { transition: all 0.2s; }
tbody tr:hover { background: rgba(99,102,241,0.02); }
tbody tr:last-child td { border-bottom: none; }

.property-cell { display: flex; align-items: center; gap: 14px; }
.property-cell img {
  width: 60px; height: 45px; border-radius: 10px; object-fit: cover;
  flex-shrink: 0; box-shadow: var(--shadow);
}
.property-cell .title { font-weight: 700; font-size: 14px; }
.property-cell .subtitle { font-size: 12px; color: var(--text-muted); font-weight: 500; }

.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 700;
}
.status-badge.active { background: rgba(16,185,129,0.1); color: var(--success); }
.status-badge.sold { background: rgba(244,63,94,0.1); color: var(--danger); }
.status-badge.pending { background: rgba(245,158,11,0.1); color: var(--warning); }
.status-badge.featured { background: rgba(245,158,11,0.1); color: #b8860b; }

.action-btns { display: flex; gap: 8px; }
.action-btn {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--bg-glass);
  backdrop-filter: blur(8px);
  cursor: pointer; transition: all 0.2s; font-size: 14px;
  color: var(--text-secondary);
}
.action-btn:hover { background: rgba(99,102,241,0.04); }
.action-btn.edit:hover { color: var(--primary); border-color: var(--primary); box-shadow: 0 0 12px var(--primary-glow); }
.action-btn.delete:hover { color: var(--danger); border-color: var(--danger); box-shadow: 0 0 12px rgba(244,63,94,0.2); }

/* ========== FORM CARD ========== */
.form-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow-md); border: 1px solid var(--border);
  margin-bottom: 18px; animation: fadeIn 0.4s ease-out;
}
.form-card h3 {
  font-size: 17px; font-weight: 800; margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
  letter-spacing: -0.2px;
}
.form-card h3 i {
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white; display: flex; align-items: center; justify-content: center;
  font-size: 13px; box-shadow: 0 4px 12px var(--primary-glow);
}

/* ========== IMAGE UPLOAD ========== */
.image-list { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.image-preview {
  position: relative; width: 105px; height: 80px; border-radius: 12px;
  overflow: hidden; border: 1px solid var(--border);
  box-shadow: var(--shadow); transition: all 0.3s;
}
.image-preview:hover { transform: scale(1.05); box-shadow: var(--shadow-md); }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-preview .remove-img {
  position: absolute; top: 5px; right: 5px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(244,63,94,0.9); color: white;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 10px; border: none;
  box-shadow: 0 2px 8px rgba(244,63,94,0.3);
  transition: all 0.2s;
}
.image-preview .remove-img:hover { transform: scale(1.15); }
.add-image-input {
  width: 100%; padding: 10px; border: 1.5px dashed var(--border);
  border-radius: 10px; display: flex; gap: 10px; align-items: center;
  transition: border-color 0.3s;
}
.add-image-input:focus-within { border-color: var(--primary); }
.add-image-input input {
  flex: 1; border: none; outline: none; font-size: 13px;
  background: transparent; font-family: 'Inter', sans-serif; font-weight: 500;
}

/* ========== AMENITY TAGS ========== */
.amenity-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.amenity-tag {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 14px; background: rgba(99,102,241,0.08); border-radius: 20px;
  font-size: 13px; color: var(--primary); font-weight: 600;
  border: 1px solid rgba(99,102,241,0.12);
}
.amenity-tag .remove-amenity {
  cursor: pointer; font-size: 12px; color: var(--danger);
  width: 18px; height: 18px; display: flex; align-items: center;
  justify-content: center; border-radius: 50%; background: none; border: none;
  transition: all 0.2s;
}
.amenity-tag .remove-amenity:hover { background: rgba(244,63,94,0.1); }

/* ========== CONFIRM MODAL ========== */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.55); z-index: 300;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.25s ease-out;
  backdrop-filter: blur(6px);
}
.modal-box {
  background: white; border-radius: var(--radius); padding: 32px;
  width: 90%; max-width: 440px; text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,0.25);
  animation: scaleIn 0.4s cubic-bezier(0.22,1,0.36,1);
}
.modal-box .icon { font-size: 52px; margin-bottom: 18px; }
.modal-box h3 { font-size: 20px; font-weight: 800; margin-bottom: 10px; letter-spacing: -0.3px; }
.modal-box p { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; line-height: 1.6; }
.modal-box .actions { display: flex; gap: 12px; justify-content: center; }

/* ========== TOAST ========== */
.toast {
  position: fixed; top: 24px; right: 24px; z-index: 400;
  padding: 16px 22px; border-radius: 14px;
  font-size: 14px; font-weight: 700;
  animation: slideIn 0.4s cubic-bezier(0.22,1,0.36,1);
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  backdrop-filter: blur(16px);
}
.toast.success { background: rgba(16,185,129,0.12); color: var(--success); border: 1px solid rgba(16,185,129,0.2); }
.toast.error { background: rgba(244,63,94,0.12); color: var(--danger); border: 1px solid rgba(244,63,94,0.2); }

.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-right-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ========== MOBILE ========== */
.mobile-toggle {
  display: none; position: fixed; top: 18px; left: 18px; z-index: 110;
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--bg-dark); color: white; border: none;
  cursor: pointer; font-size: 18px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.sidebar-backdrop {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 99;
  backdrop-filter: blur(4px);
}

@media (max-width: 768px) {
  .mobile-toggle { display: flex; align-items: center; justify-content: center; }
  .sidebar { transform: translateX(-100%); transition: transform 0.4s cubic-bezier(0.22,1,0.36,1); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.open { display: block; }
  .main-panel { margin-left: 0; padding: 18px; padding-top: 72px; max-width: 100%; }
  table { font-size: 13px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-header h1 { font-size: 22px; }
}
