/* Motherland Property Admin Dashboard Stylesheet */
:root {
  --bg-deep: #070913;
  --bg-surface: rgba(20, 24, 39, 0.6);
  --bg-surface-hover: rgba(30, 37, 58, 0.85);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 180, 216, 0.5);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --primary-glow: linear-gradient(135deg, #00b4d8, #0077b6);
  --accent-color: #00b4d8;
  --accent-color-rgb: 0, 180, 216;
  --danger-color: #ef4444;
  --success-color: #10b981;
  --warning-color: #f59e0b;
}

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

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: 'Manrope', 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Cursor Glow matching frontend */
.cursor-glow {
  position: fixed;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(var(--accent-color-rgb), 0.06) 0%, rgba(0,0,0,0) 70%);
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.6s ease;
}

/* Authentication Layout */
.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 100vh;
  z-index: 1;
  padding: 24px;
}

.auth-card {
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  padding: 40px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo {
  max-height: 48px;
  margin-bottom: 16px;
}

.auth-title {
  font-family: 'Playfair Display', serif;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: 14px;
}

/* Main Dashboard Layout */
.admin-sidebar {
  width: 260px;
  background: rgba(10, 12, 22, 0.95);
  border-right: 1px solid var(--border-subtle);
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  z-index: 10;
  padding: 24px 0;
}

.sidebar-brand {
  padding: 0 24px 24px 24px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
  display: flex;
  justify-content: center;
}

.sidebar-logo {
  max-height: 38px;
  max-width: 100%;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 16px;
  flex-grow: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.sidebar-link:hover, .sidebar-link.active {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-link.active {
  background: rgba(var(--accent-color-rgb), 0.15);
  border-left: 3px solid var(--accent-color);
  padding-left: 13px;
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
}

.admin-main {
  margin-left: 260px;
  padding: 40px;
  width: calc(100% - 260px);
  z-index: 1;
  position: relative;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.page-title h1 {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.5px;
}

.page-title p {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info {
  text-align: right;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
}

.user-role {
  font-size: 12px;
  color: var(--text-muted);
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.stat-info h3 {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.stat-number {
  font-size: 32px;
  font-weight: 600;
  font-family: 'Manrope', sans-serif;
}

.stat-icon {
  background: rgba(var(--accent-color-rgb), 0.1);
  color: var(--accent-color);
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
}

/* Sections & Panels */
.dashboard-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  margin-bottom: 32px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.panel-title {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 500;
}

/* Custom UI Elements: Tables */
.table-wrapper {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  padding: 14px 16px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
}

.admin-table td {
  padding: 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-primary { background: rgba(0, 180, 216, 0.15); color: var(--accent-color); }
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--success-color); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--danger-color); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--warning-color); }

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  width: 100%;
  background: rgba(15, 18, 30, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-main);
  padding: 12px 16px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(var(--accent-color-rgb), 0.25);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* Language Tabs */
.lang-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
  padding-bottom: 8px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: var(--text-main);
  background: rgba(var(--accent-color-rgb), 0.15);
  border: 1px solid rgba(var(--accent-color-rgb), 0.3);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--primary-glow);
  color: #fff;
  box-shadow: 0 4px 12px rgba(var(--accent-color-rgb), 0.3);
}

.btn-primary:hover {
  box-shadow: 0 4px 20px rgba(var(--accent-color-rgb), 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger-color);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: var(--danger-color);
  color: #fff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

/* Actions list */
.actions-cell {
  display: flex;
  gap: 8px;
}

/* Alerts */
.alert {
  padding: 14px 20px;
  border-radius: 8px;
  margin-bottom: 24px;
  font-size: 14px;
}

.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--success-color);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger-color);
}

/* Property Photo Box */
.photo-uploader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border-subtle);
  border-radius: 12px;
  padding: 40px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(15, 18, 30, 0.4);
}

.photo-uploader:hover {
  border-color: var(--accent-color);
  background: rgba(var(--accent-color-rgb), 0.02);
}

.photo-uploader svg {
  width: 48px;
  height: 48px;
  stroke: var(--text-muted);
  margin-bottom: 12px;
}

.preview-box {
  width: 100%;
  height: 180px;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  margin-top: 12px;
  position: relative;
}

/* Toast status container */
.admin-toast-alert {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(20, 24, 39, 0.95);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px 24px;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
}

.admin-toast-alert.show {
  transform: translateY(0);
  opacity: 1;
}

/* Responsive elements */
@media (max-width: 768px) {
  body {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    min-height: auto;
    position: relative;
    padding: 16px 0;
  }
  .sidebar-brand {
    padding-bottom: 16px;
    margin-bottom: 16px;
  }
  .admin-main {
    margin-left: 0;
    width: 100%;
    padding: 24px;
  }
}
