/* ============================================
   Light Mode Theme with Purple Gradient
   WCAG AA Compliant | Design Token Based
   ============================================ */

:root {
  /* Color Tokens */
  --color-bg: #ffffff;
  --color-gradient-start: #8B5CF6; /* purple-500 */
  --color-gradient-end: #ffffff;
  --color-text: #111827;           /* near-black */
  --color-text-accent: #6D28D9;    /* purple-700 */
  --color-border: rgba(124, 58, 237, 0.15);
  
  /* Shadow Tokens */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 24px rgba(17,24,39,0.08);
  
  /* Radius Tokens */
  --radius-lg: 16px;
  --radius-md: 12px;
  
  /* Focus Ring */
  --focus-ring: 0 0 0 3px rgba(139, 92, 246, 0.35);
  
  /* Transition */
  --transition: 180ms cubic-bezier(.2,.7,.2,1);
}

/* ============================================
   Global Background Gradient
   ============================================ */

html,
body {
  min-height: 100%;
  background: linear-gradient(135deg, var(--color-gradient-start) 0%, var(--color-gradient-end) 60%);
  background-attachment: fixed;
  color: var(--color-text);
  margin: 0;
  padding: 0;
}


/* ============================================
   Site Header - Sticky with Blur
   ============================================ */

.site-header,
header.site-header,
.navbar.site-header,
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: box-shadow var(--transition), margin var(--transition);
}

.site-header.scrolled,
header.scrolled {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* Header Text */
.site-header,
.site-header * {
  color: var(--color-text);
}

.site-header a {
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition);
}

.site-header a:hover,
.site-header a.active {
  color: var(--color-text-accent);
}

.site-header a:focus {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 4px;
}

/* Logo styling */
.site-header .logo,
.site-header .logo a {
  color: var(--color-text-accent);
  font-weight: 700;
}

/* ============================================
   Cards - White Surface with Purple Border
   ============================================ */

.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  will-change: transform, box-shadow;
}

.card:hover,
.card:focus-within {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Card Titles */
.card h1,
.card h2,
.card h3,
.card h4,
.card h5,
.card h6,
.card-title {
  color: var(--color-text-accent);
  margin-top: 0;
  font-weight: 600;
}

/* Card Body Text */
.card p,
.card-body {
  color: var(--color-text);
  line-height: 1.6;
}

/* Card Gap */
.card > * + * {
  margin-top: 16px;
}

/* ============================================
   Modules - Similar to Cards
   ============================================ */

.module,
.section-box,
.content-module {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.module:hover,
.module:focus-within {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Module Titles */
.module h1,
.module h2,
.module h3,
.module h4,
.module h5,
.module h6,
.module-title {
  color: var(--color-text-accent);
  margin-top: 0;
  font-weight: 600;
}

/* Module Body */
.module p,
.module-body {
  color: var(--color-text);
}

/* Module Gap */
.module > * + * {
  margin-top: 16px;
}

/* ============================================
   Buttons - Purple Primary Style
   ============================================ */

button,
.btn,
.button {
  background: var(--color-text-accent);
  color: var(--color-bg);
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

button:hover,
.btn:hover,
.button:hover {
  background: #5B21B6; /* purple-800 - darker */
  transform: translateY(-1px);
}

button:active,
.btn:active,
.button:active {
  transform: translateY(0);
}

button:focus,
.btn:focus,
.button:focus {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Secondary Button */
.btn-secondary,
button.secondary {
  background: transparent;
  color: var(--color-text-accent);
  border: 2px solid var(--color-text-accent);
}

.btn-secondary:hover,
button.secondary:hover {
  background: rgba(139, 92, 246, 0.1);
  transform: translateY(-1px);
}

/* ============================================
   Links - Purple Accent
   ============================================ */

a {
  color: var(--color-text-accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: #5B21B6; /* purple-800 */
  text-decoration: underline;
}

a:focus {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: 2px;
}

/* ============================================
   Content Wrappers - White Surface
   ============================================ */

.content-wrapper,
.main-content,
.page-content,
main {
  background: var(--color-bg);
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 16px;
}

/* ============================================
   Property Cards (specific to real estate)
   ============================================ */

.property-card,
.listing-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.property-card:hover,
.listing-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.property-card .price,
.listing-card .price {
  color: var(--color-text-accent);
  font-weight: 700;
  font-size: 1.25rem;
}

.property-card .title,
.listing-card .title {
  color: var(--color-text);
  font-weight: 600;
}

/* ============================================
   Form Elements
   ============================================ */

input,
textarea,
select {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px;
  color: var(--color-text);
  font-family: inherit;
  transition: all var(--transition);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--color-text-accent);
  box-shadow: var(--focus-ring);
}

input::placeholder,
textarea::placeholder {
  color: #6B7280; /* gray-500 */
}

/* ============================================
   Stats Cards / Dashboard Cards
   ============================================ */

.stat-card,
.stats-card,
.dashboard-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.stat-card:hover,
.stats-card:hover,
.dashboard-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card .stat-value,
.stats-card .stat-value {
  color: var(--color-text-accent);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.stat-card .stat-label,
.stats-card .stat-label {
  color: var(--color-text);
  font-size: 0.875rem;
  margin-top: 8px;
}

/* ============================================
   Badges / Tags
   ============================================ */

.badge,
.tag,
.label {
  display: inline-block;
  background: rgba(139, 92, 246, 0.1);
  color: var(--color-text-accent);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 0.875rem;
  font-weight: 600;
}

/* ============================================
   Tables
   ============================================ */

table {
  width: 100%;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

thead {
  background: rgba(139, 92, 246, 0.05);
}

th {
  color: var(--color-text-accent);
  font-weight: 600;
  text-align: right;
  padding: 12px;
  border-bottom: 1px solid var(--color-border);
}

td {
  color: var(--color-text);
  padding: 12px;
  border-bottom: 1px solid var(--color-border);
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: rgba(139, 92, 246, 0.02);
}

/* ============================================
   Modal / Dialog
   ============================================ */

.modal,
.dialog {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(17, 24, 39, 0.15);
  padding: 32px;
  max-width: 600px;
  margin: 0 auto;
}

.modal-header,
.dialog-header {
  color: var(--color-text-accent);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 16px;
}

/* ============================================
   Navigation Menu
   ============================================ */

.nav-menu,
.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 8px;
}

.nav-menu a,
.menu a {
  color: var(--color-text);
  padding: 8px 16px;
  border-radius: 8px;
  transition: all var(--transition);
}

.nav-menu a:hover,
.menu a:hover,
.nav-menu a.active,
.menu a.active {
  color: var(--color-text-accent);
  background: rgba(139, 92, 246, 0.05);
  text-decoration: none;
}

/* ============================================
   Accessibility - Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .card:hover,
  .module:hover,
  button:hover,
  .btn:hover {
    transform: none !important;
  }
}

/* ============================================
   Focus Visible (keyboard navigation)
   ============================================ */

*:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
  html,
  body {
    background: white !important;
  }
  
  .card,
  .module {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 768px) {
  .card,
  .module {
    padding: 16px;
  }
  
  .container {
    padding: 16px 12px;
  }
  
  button,
  .btn {
    width: 100%;
  }
}
