/* MapleKeys Real Estate - Main Stylesheet */

/* CSS Variables - Brand Colors & Design System */
:root {
  /* Brand Colors */
  --brand-base: #2e3022;
  --brand-base-light: #3a3f2a;
  --brand-base-dark: #1f221a;
  
  /* Gold/Amber Accents */
  --accent-gold-1: #f2b844;
  --accent-gold-2: #e8a317;
  --accent-gold-3: #b67b22;
  --accent-gold-gradient: linear-gradient(135deg, var(--accent-gold-1), var(--accent-gold-2));
  
  /* Neutral Colors */
  --white: #ffffff;
  --cream: #faf9f6;
  --light-cream: #f7f3ec;
  --warm-gray: #f5f2ed;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  
  /* Text Colors */
  --text-primary: #1a1a1a;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --text-light: var(--white);
  
  /* Spacing System */
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  
  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  
  /* Font Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --card-radius: 14px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Layout */
  --container-max-width: 1200px;
  --header-height: 80px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-md);
  color: var(--brand-base);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

a {
  color: var(--accent-gold-2);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-gold-3);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* Header */
.header {
  background: var(--brand-base);
  color: var(--white);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  box-shadow: var(--shadow-md);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-brand .brand-link {
  color: var(--white);
  text-decoration: none;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo-icon {
  width: 40px;
  height: 40px;
  color: var(--accent-gold-1);
  transition: transform var(--transition-normal);
}

.logo:hover .logo-icon {
  transform: scale(1.05) rotate(5deg);
}

.brand-text {
  font-size: var(--text-2xl);
  font-weight: 700;
  font-family: var(--font-serif);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
}

.nav-list {
  display: flex;
  list-style: none;
  gap: var(--space-xl);
  margin: 0;
}

.nav-link {
  color: var(--white);
  font-weight: 500;
  padding: var(--space-sm) 0;
  position: relative;
  transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-gold-1);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gold-gradient);
  border-radius: 1px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
}

.hamburger-line {
  width: 24px;
  height: 2px;
  background: var(--white);
  margin: 2px 0;
  transition: all var(--transition-fast);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  font-size: var(--text-base);
  font-weight: 600;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-gold-gradient);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-gold-2), var(--accent-gold-3));
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: var(--white);
}

.btn-secondary {
  background: var(--white);
  color: var(--brand-base);
  border: 2px solid var(--gray-300);
}

.btn-secondary:hover {
  background: var(--gray-100);
  border-color: var(--accent-gold-2);
  color: var(--brand-base);
}

.btn-outline {
  background: transparent;
  color: var(--accent-gold-2);
  border: 2px solid var(--accent-gold-2);
}

.btn-outline:hover {
  background: var(--accent-gold-2);
  color: var(--white);
}

.btn-lg {
  padding: var(--space-lg) var(--space-2xl);
  font-size: var(--text-lg);
}

.btn-sm {
  padding: var(--space-xs) var(--space-md);
  font-size: var(--text-sm);
}

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--gray-200);
}

.card-body {
  padding: var(--space-lg);
}

.card-footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--gray-200);
  background: var(--gray-100);
}

/* Property Cards */
.property-card {
  background: var(--white);
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  text-decoration: none;
  color: inherit;
}

.property-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  color: inherit;
}

.property-image {
  position: relative;
  width: 100%;
  height: 240px;
  overflow: hidden;
}

.property-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.property-card:hover .property-image img {
  transform: scale(1.05);
}

.property-status {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  padding: var(--space-xs) var(--space-sm);
  background: var(--accent-gold-gradient);
  color: var(--white);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.property-content {
  padding: var(--space-lg);
}

.property-price {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--brand-base);
  margin-bottom: var(--space-sm);
}

.property-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
  line-height: 1.3;
}

.property-location {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.property-details {
  display: flex;
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
}

.property-detail-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.property-detail-icon {
  width: 16px;
  height: 16px;
  color: var(--accent-gold-2);
}

/* Grid Layouts */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-2xl);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Forms */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  transition: border-color var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-gold-2);
  box-shadow: 0 0 0 3px rgba(242, 184, 68, 0.1);
}

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

/* Flash Messages */
.flash-messages {
  position: fixed;
  top: calc(var(--header-height) + var(--space-md));
  right: var(--space-md);
  z-index: 1050;
  max-width: 400px;
}

.flash-message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  animation: slideInRight var(--transition-normal);
}

.flash-message.flash-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.flash-message.flash-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.flash-message.flash-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.flash-close {
  background: none;
  border: none;
  font-size: var(--text-xl);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.flash-close:hover {
  opacity: 1;
}

/* Footer */
.footer {
  background: var(--brand-base);
  color: var(--white);
  margin-top: var(--space-4xl);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-2xl);
  padding: var(--space-4xl) 0 var(--space-2xl);
}

.footer-section {
  display: flex;
  flex-direction: column;
}

.footer-brand .logo {
  margin-bottom: var(--space-lg);
}

.footer-tagline {
  color: var(--gray-300);
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

.footer-title {
  color: var(--accent-gold-1);
  font-size: var(--text-lg);
  margin-bottom: var(--space-lg);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: var(--space-sm);
}

.footer-links a {
  color: var(--gray-300);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--accent-gold-1);
}

.social-links {
  display: flex;
  gap: var(--space-md);
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: var(--white);
  transition: all var(--transition-fast);
}

.social-link:hover {
  background: var(--accent-gold-2);
  transform: translateY(-2px);
  color: var(--white);
}

.social-link svg {
  width: 20px;
  height: 20px;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--gray-300);
}

.contact-item a {
  color: var(--gray-300);
  transition: color var(--transition-fast);
}

.contact-item a:hover {
  color: var(--accent-gold-1);
}

.contact-icon {
  width: 20px;
  height: 20px;
  color: var(--accent-gold-1);
  flex-shrink: 0;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--space-2xl) 0;
}

.footer-bottom-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-lg);
}

.copyright {
  color: var(--gray-400);
  margin: 0;
}

.footer-bottom-links {
  display: flex;
  gap: var(--space-lg);
}

.footer-bottom-links a {
  color: var(--gray-400);
  font-size: var(--text-sm);
  transition: color var(--transition-fast);
}

.footer-bottom-links a:hover {
  color: var(--accent-gold-1);
}

/* Main Content */
.main {
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

/* Animations */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.fade-in {
  animation: fadeIn var(--transition-slow);
}

.slide-in-up {
  animation: slideInUp var(--transition-slow);
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

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

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

.hidden { display: none; }
.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 Design */
@media (max-width: 1024px) {
  .container {
    padding: 0 var(--space-md);
  }
  
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --text-5xl: 2.5rem;
    --text-4xl: 2rem;
    --text-3xl: 1.75rem;
    --header-height: 70px;
  }
  
  .container {
    padding: 0 var(--space-md);
  }
  
  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--brand-base);
    flex-direction: column;
    padding: var(--space-lg);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-lg);
  }
  
  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .nav-list {
    flex-direction: column;
    width: 100%;
    gap: var(--space-md);
  }
  
  .nav-toggle {
    display: flex;
  }
  
  .nav-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .nav-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
  }
  
  .nav-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  
  .footer-bottom-content {
    flex-direction: column;
    text-align: center;
  }
  
  .grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
  
  .property-details {
    flex-wrap: wrap;
    gap: var(--space-md);
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-md);
  }
  
  .btn-lg {
    padding: var(--space-md) var(--space-lg);
    font-size: var(--text-base);
  }
  
  .property-image {
    height: 200px;
  }
  
  .flash-messages {
    left: var(--space-md);
    right: var(--space-md);
    max-width: none;
  }
}
