/* global.css */
:root {
  /* Brand Colors - Luxurious Palette */
  --primary-color: #bfa183; /* Muted Gold */
  --secondary-color: #2d2d2d; /* Dark Grey */
  --accent-color: #c99b6b; /* Rich Gold Accent */

  /* Text Colors */
  --text-primary: #333333; /* Main text */
  --text-secondary: #777777; /* Lighter Grey / Subdued text */
  --text-light: #ffffff; /* Text on dark backgrounds */
  --text-on-primary: #ffffff; /* Text on primary color background */

  /* Background Colors */
  --bg-primary: #ffffff; /* Main background (e.g., body, cards) */
  --bg-secondary: #f8f8f8; /* Very Light Grey (e.g., alternate sections) */
  --bg-dark: #2d2d2d; /* Dark backgrounds (e.g., footer) */

  /* Border Color */
  --border-color: #e0e0e0; /* Light border color */

  /* Alert/Message Colors */
  --alert-info-bg: #e2f3fd;
  --alert-info-text: #0a58ca;
  --alert-info-border: #b6d4fe;
  --alert-error-bg: #f8d7da;
  --alert-error-text: #842029;
  --alert-error-border: #f5c2c7;
  --alert-success-bg: #d1e7dd;
  --alert-success-text: #0f5132;
  --alert-success-border: #badbcc;

  /* Danger/Error Colors */
  --danger-color: #dc3545;
  --danger-bg-light: rgba(220, 53, 69, 0.1);
  --danger-border-light: rgba(220, 53, 69, 0.2);
  --danger-color-alt: #dc2626;
  --danger-bg-alt: #fef2f2;
  --danger-border-alt: #fecaca;

  /* Success Colors */
  --success-color: #28a745;

  /* Pure Colors */
  --black: #000000;
  --white: #ffffff;

  /* Spacing - Consistent scale */
  --spacing-xs: 0.5rem; /* 8px */
  --spacing-sm: 0.75rem; /* 12px */
  --spacing-md: 1.25rem; /* 20px */
  --spacing-lg: 2rem; /* 32px */
  --spacing-xl: 3.5rem; /* 56px */
  --spacing-xxl: 5rem; /* 80px */

  /* Typography - Elegant Fonts */
  --font-primary: 'Lora', serif; /* Serif for headings and prominent text */
  --font-secondary: 'Nunito Sans', sans-serif; /* Sans-serif for body text */
  --font-size-xs: 0.8rem;
  --font-size-sm: 0.9rem;
  --font-size-md: 1rem; /* Base size */
  --font-size-lg: 1.25rem;
  --font-size-xl: 1.75rem;
  --font-size-2xl: 2.5rem;
  --font-size-3xl: 3.5rem;
  --line-height-base: 1.7;
  --line-height-heading: 1.3;

  /* Border Radius - Consistent rounding */
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --border-radius-lg: 16px;
  --border-radius-pill: 50px;
  --border-radius-circle: 50%;

  /* Shadows - Subtle depth */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 5px 10px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.1);

  /* Container */
  --container-width: 1200px;
  --container-padding: 1.5rem; /* Slightly less padding */

  /* Transitions */
  --transition-base: all 0.3s ease;

  /* Add primary color RGB variable for focus ring */
  --primary-color-rgb: 191, 161, 131; /* RGB values for #bfa183 */
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px; /* Base font size */
}

body {
  font-family: var(--font-secondary);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: var(--line-height-base);
  font-size: var(--font-size-md);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: var(--container-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
  width: 100%;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-primary);
  font-weight: 700;
  color: var(--secondary-color); /* Use dark grey for headings */
  line-height: var(--line-height-heading);
  margin-bottom: var(--spacing-md);
}

h1 {
  font-size: var(--font-size-3xl);
}
h2 {
  font-size: var(--font-size-2xl);
}
h3 {
  font-size: var(--font-size-xl);
}
h4 {
  font-size: var(--font-size-lg);
}
h5 {
  font-size: var(--font-size-md);
  font-weight: 600;
} /* Bolder h5 */
h6 {
  font-size: var(--font-size-sm);
  font-weight: 600;
} /* Bolder h6 */

p {
  margin-bottom: var(--spacing-md);
  color: var(--text-secondary); /* Default paragraph color */
}
p:last-child {
  margin-bottom: 0; /* Remove margin from last paragraph in a block */
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition-base);
}

a:hover {
  color: color-mix(in srgb, var(--primary-color) 80%, black);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  vertical-align: middle; /* Remove bottom space */
}

ul,
ol {
  padding-left: var(--spacing-md); /* Add default padding */
  margin-bottom: var(--spacing-md);
}
li {
  margin-bottom: var(--spacing-xs); /* Space between list items */
}

/* Common Components */
.btn {
  display: inline-block;
  padding: var(--spacing-sm) var(--spacing-lg); /* Adjusted padding */
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition-base);
  cursor: pointer;
  border: 1px solid transparent; /* Base border */
  font-size: var(--font-size-sm);
  text-align: center;
  line-height: 1.5; /* Ensure consistent line height */
  vertical-align: middle; /* Align button with text */
}
.btn:hover {
  text-decoration: none; /* Remove underline on hover */
  transform: translateY(-2px); /* Subtle lift */
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background-color: var(--primary-color);
  color: var(--text-on-primary);
  border-color: var(--primary-color);
}
.btn-primary:hover {
  background-color: color-mix(in srgb, var(--primary-color) 90%, black);
  border-color: color-mix(in srgb, var(--primary-color) 90%, black);
  color: var(--text-on-primary); /* Ensure text color stays */
}

.btn-secondary {
  background-color: var(--secondary-color);
  color: var(--text-light);
  border-color: var(--secondary-color);
}
.btn-secondary:hover {
  background-color: color-mix(in srgb, var(--secondary-color) 90%, black);
  border-color: color-mix(in srgb, var(--secondary-color) 90%, black);
  color: var(--text-light);
}

.btn-outline-primary {
  background-color: transparent;
  color: var(--primary-color);
  border-color: var(--primary-color);
}
.btn-outline-primary:hover {
  background-color: var(--primary-color);
  color: var(--text-on-primary);
}

.btn-outline-secondary {
  background-color: transparent;
  color: var(--secondary-color);
  border-color: var(--secondary-color);
}
.btn-outline-secondary:hover {
  background-color: var(--secondary-color);
  color: var(--text-light);
}

/* Section Styling */
.section {
  padding-top: var(--spacing-xl);
  padding-bottom: var(--spacing-xl);
}
.section-bg-secondary {
  background-color: var(--bg-secondary);
}
.section-header {
  text-align: center;
  margin-bottom: var(--spacing-lg);
  max-width: 700px; /* Constrain header width */
  margin-left: auto;
  margin-right: auto;
}
.section-title {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--spacing-sm); /* Less margin below title */
  color: var(--secondary-color);
}
.section-subtitle {
  color: var(--text-secondary);
  font-size: var(--font-size-lg); /* Slightly larger subtitle */
  margin-bottom: 0; /* Remove margin if it's the last element */
  line-height: 1.6;
}

/* Card Styling */
.card {
  background: var(--bg-primary);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  padding: var(--spacing-lg);
  transition: var(--transition-base);
  overflow: hidden; /* Ensure content respects border radius */
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

/* Form Styling */
.form-group {
  margin-bottom: var(--spacing-md);
}
.form-group label {
  display: block;
  margin-bottom: var(--spacing-xs);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  font-weight: 600;
}
.form-group input[type='text'],
.form-group input[type='email'],
.form-group input[type='tel'],
.form-group input[type='number'],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md); /* Consistent padding */
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-md);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.5; /* Consistent line height */
  transition:
    border-color 0.2s ease-in-out,
    box-shadow 0.2s ease-in-out;
  height: calc(
    var(--spacing-sm) * 2 + 1em + 2px
  ); /* Standard height (approx 44px) */
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb, 191, 161, 131), 0.25);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
  height: auto; /* Override standard height */
}

/* Select dropdown arrow */
.form-group select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23777777" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'); /* Darker arrow */
  background-repeat: no-repeat;
  background-position-x: calc(100% - var(--spacing-sm));
  background-position-y: center;
  padding-right: calc(var(--spacing-md) * 2); /* Space for arrow */
}
.form-group select[multiple] {
  background-image: none; /* Remove arrow for multiple select */
  height: auto; /* Allow multiple select to grow */
}

/* Helper Classes */
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}
.text-primary {
  color: var(--primary-color);
}
.text-secondary {
  color: var(--text-secondary);
}
.text-light {
  color: var(--text-light);
}
.mb-0 {
  margin-bottom: 0 !important;
}
.mt-0 {
  margin-top: 0 !important;
}

/* Font Awesome */
.fa,
.fas,
.far,
.fal,
.fab {
  line-height: 1; /* Prevent icons affecting line height */
}

/* Refined Action Button style for property cards */
.action-btn {
  background-color: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-circle);
  width: 36px; /* Slightly larger */
  height: 36px;
  display: inline-flex; /* Use inline-flex for better alignment with text */
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition-base);
  text-decoration: none; /* Ensure links look like buttons */
  vertical-align: middle; /* Align with text if needed */
  padding: 0; /* Remove default padding */
}
.action-btn:hover {
  background-color: var(--primary-color);
  color: var(--text-on-primary);
  border-color: var(--primary-color);
  transform: scale(1.1);
}
.action-btn i {
  font-size: var(--font-size-sm);
  line-height: 1; /* Prevent icon affecting size */
}

/* Accessibility helper class */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive Container & Base Font */
@media (max-width: 1200px) {
  html {
    font-size: 15px;
  } /* Slightly smaller base font */
}
@media (max-width: 992px) {
  html {
    font-size: 14px;
  }
  .container {
    --container-padding: 1rem;
  }
}
@media (max-width: 768px) {
  h1 {
    font-size: var(--font-size-2xl);
  }
  h2 {
    font-size: var(--font-size-xl);
  }
  h3 {
    font-size: var(--font-size-lg);
  }
  .section {
    padding-top: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
  }
  .container {
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
  }
}
@media (max-width: 576px) {
  h1 {
    font-size: 2rem;
  }
  h2 {
    font-size: 1.6rem;
  }
  h3 {
    font-size: 1.3rem;
  }
  .container {
    --container-padding: 0.75rem;
  }
}

/* Import custom colors if available (will override default colors) */

/* Custom Color Overrides */
:root {
  /* Brand Colors - User Customized */
  --primary-color: #bfa183;
  --secondary-color: #2d2d2d;
  --accent-color: #c99b6b;

  /* Text Colors */
  --text-primary: #333333;
  --text-secondary: #777777;
  --text-light: #ffffff;
  --text-on-primary: #ffffff;

  /* Background Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f8f8;
  --bg-dark: #2d2d2d;

  /* Border Color */
  --border-color: #e0e0e0;

  /* Primary color RGB variable for focus ring and transparency effects */
  --primary-color-rgb: 191, 161, 131;
}
