/* ══════════════════════════════════════════════════
   AXURE PROPERTY AFRICA — APPLE-INSPIRED DESIGN SYSTEM
   Minimalist • Fast • Mobile-first • Premium
   ══════════════════════════════════════════════════ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── ROOT & TYPOGRAPHY ─────────────────────────── */
html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
  background: #fafafa;
  color: #1d1d1d;
  line-height: 1.5;
  letter-spacing: -0.3px;
  background-attachment: fixed;
}

/* ── COLOR PALETTE (Apple-inspired) ─────────────── */
:root {
  --primary: #10b981;
  --primary-dark: #059669;
  --primary-light: #d1fae5;

  --text-primary: #1d1d1d;
  --text-secondary: #666666;
  --text-tertiary: #999999;

  --bg-primary: #ffffff;
  --bg-secondary: #fafafa;
  --bg-tertiary: #f5f5f5;

  --border: #e5e5e5;
  --border-light: #f0f0f0;

  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;

  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 16px;
  --spacing-xl: 24px;
  --spacing-2xl: 32px;
  --spacing-3xl: 48px;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── TYPOGRAPHY SCALE ──────────────────────────── */
h1 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

h2 {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.3px;
}

h3 {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

h4 {
  font-size: 16px;
  font-weight: 600;
}

p, li {
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-secondary);
}

small, .text-sm {
  font-size: 14px;
  color: var(--text-tertiary);
}

.text-xs {
  font-size: 12px;
  color: var(--text-tertiary);
}

.text-lg {
  font-size: 18px;
}

/* ── MOBILE TYPOGRAPHY ─────────────────────────── */
@media (max-width: 640px) {
  h1 { font-size: 24px; }
  h2 { font-size: 20px; }
  h3 { font-size: 16px; }
  p, li { font-size: 15px; }
}

/* ── BUTTONS ───────────────────────────────────── */
button, [role="button"], .btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  user-select: none;
}

button:hover {
  opacity: 0.85;
}

button:active {
  transform: scale(0.98);
}

/* Primary button */
.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-md);
}

/* Secondary button */
.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

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

/* Ghost button */
.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg-tertiary);
}

/* ── FORMS & INPUTS ────────────────────────────── */
input, textarea, select {
  font-family: inherit;
  font-size: 16px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: var(--transition);
  width: 100%;
  min-height: 44px;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

input::placeholder {
  color: var(--text-tertiary);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* ── CARDS & CONTAINERS ────────────────────────── */
.card {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: var(--spacing-lg);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.card-compact {
  padding: var(--spacing-md);
}

/* ── GRID SYSTEM (8px baseline) ────────────────── */
.container {
  width: 100%;
  padding: 0 var(--spacing-lg);
  margin: 0 auto;
}

@media (min-width: 640px) {
  .container {
    max-width: 640px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1024px;
  }
}

@media (min-width: 1280px) {
  .container {
    max-width: 1280px;
  }
}

/* ── SPACING UTILITIES ─────────────────────────── */
.p-0 { padding: 0; }
.p-1 { padding: var(--spacing-sm); }
.p-2 { padding: var(--spacing-md); }
.p-3 { padding: var(--spacing-lg); }
.p-4 { padding: var(--spacing-xl); }
.p-5 { padding: var(--spacing-2xl); }

.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }
.gap-3 { gap: var(--spacing-lg); }
.gap-4 { gap: var(--spacing-xl); }

.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }
.mb-5 { margin-bottom: var(--spacing-2xl); }

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }
.mt-5 { margin-top: var(--spacing-2xl); }

/* ── LAYOUT UTILITIES ──────────────────────────── */
.flex { display: flex; }
.grid { display: grid; }

.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }

.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.w-full { width: 100%; }
.w-64 { width: 16rem; }
.min-w-0 { min-width: 0; }
.min-h-screen { min-height: 100vh; }
.max-w-md { max-width: 448px; }
.max-w-lg { max-width: 512px; }
.max-w-2xl { max-width: 672px; }

.fixed { position: fixed; }
.static { position: static; }
.relative { position: relative; }
.absolute { position: absolute; }
.inset-0 { inset: 0; }
.inset-y-0 { top: 0; bottom: 0; }
.left-0 { left: 0; }
.bottom-4 { bottom: 1rem; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.overflow-auto { overflow: auto; }
.overflow-y-auto { overflow-y: auto; }

/* ── DISPLAY UTILITIES ─────────────────────────── */
.hidden { display: none !important; }
.block { display: block; }
.inline { display: inline; }
.inline-flex { display: inline-flex; }
.inline-block { display: inline-block; }

/* ── RESPONSIVE UTILITIES ──────────────────────── */
@media (max-width: 640px) {
  .hidden-mobile { display: none !important; }

  .flex-mobile-col { flex-direction: column; }

  h1 { font-size: 24px; }
  h2 { font-size: 20px; }

  button, input, textarea, select {
    font-size: 16px; /* Prevents iOS zoom */
  }

  .p-3 { padding: var(--spacing-md); }
  .p-4 { padding: var(--spacing-lg); }
}

@media (min-width: 641px) {
  .hidden-tablet { display: none !important; }
}

@media (min-width: 1024px) {
  .lg\:flex { display: flex !important; }
  .lg\:hidden { display: none !important; }
  .lg\:static { position: static !important; }
  .lg\:z-auto { z-index: auto !important; }
}

/* ── TEXT UTILITIES ────────────────────────────── */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-muted { color: var(--text-tertiary); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--text-primary); }

/* ── BADGES & LABELS ───────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
}

.badge-success { background: #d1fae5; color: #059669; }
.badge-warning { background: #fef3c7; color: #d97706; }
.badge-error { background: #fee2e2; color: #dc2626; }
.badge-info { background: #dbeafe; color: #1e40af; }

/* ── ANIMATIONS ────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-in {
  animation: slideUp 0.3s ease-out;
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ── MODALS & OVERLAYS ─────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  padding: var(--spacing-md);
}

@media (min-width: 641px) {
  .modal-overlay {
    align-items: center;
  }
}

.modal-content {
  background: var(--bg-primary);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  width: 100%;
  max-width: 512px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease-out;
}

@media (min-width: 641px) {
  .modal-content {
    border-radius: var(--radius-2xl);
  }
}

/* ── LOADING STATES ────────────────────────────── */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 0%,
    var(--border) 50%,
    var(--bg-tertiary) 100%
  );
  background-size: 200% 100%;
  animation: pulse 2s ease-in-out infinite;
  border-radius: var(--radius-md);
}

/* ── NAVIGATION ────────────────────────────────── */
.nav {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: var(--spacing-lg) var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  sticky: top;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-sm);
}

.nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  padding: 8px 12px;
  border-radius: var(--radius-md);
}

.nav a:hover {
  color: var(--primary);
  background: var(--bg-tertiary);
}

/* ── LISTS & TABLES ────────────────────────────── */
.list {
  list-style: none;
}

.list-item {
  padding: var(--spacing-md) 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

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

.list-item:hover {
  background: var(--bg-tertiary);
  padding-left: var(--spacing-md);
}

/* ── FOCUS STATES ──────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── SCROLLBAR STYLING ─────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ── DARK MODE SUPPORT ─────────────────────────── */
@media (prefers-color-scheme: dark) {
  body {
    background: #161616;
    color: #f5f5f5;
  }

  :root {
    --text-primary: #f5f5f5;
    --text-secondary: #999999;
    --text-tertiary: #666666;

    --bg-primary: #1d1d1d;
    --bg-secondary: #262626;
    --bg-tertiary: #323232;

    --border: #404040;
    --border-light: #2d2d2d;
  }

  .card {
    border-color: var(--border);
  }

  input, textarea, select {
    background: var(--bg-secondary);
    color: var(--text-primary);
  }
}

/* ── PRINT STYLES ──────────────────────────────── */
@media print {
  body {
    background: white;
  }

  .no-print {
    display: none !important;
  }
}
