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

/* Skip to Main Content Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000;
  color: #fff;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 10000;
  font-weight: 500;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid #007bff;
  outline-offset: 2px;
}

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

.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  padding: inherit;
  margin: inherit;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Global Focus Styles for Keyboard Navigation */
*:focus {
  outline: 3px solid #007bff;
  outline-offset: 2px;
}

/* Only show outline for keyboard users, not mouse clicks */
*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 3px solid #007bff;
  outline-offset: 2px;
}

/* Enhanced focus for buttons */
button:focus-visible {
  outline: 3px solid #007bff;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
}

/* Enhanced focus for links */
a:focus-visible {
  outline: 3px solid #007bff;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Enhanced focus for form inputs */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #007bff;
  outline-offset: 0;
  border-color: #007bff;
}

:root {
  --color-primary: #0A6FA2;
  --color-primary-dark: #0284C7;
  --color-accent: #F5E6D3;
  --color-accent-dark: #D4A574;
  --color-bg: #FFFFFF;
  --color-bg-light: #F8FAFC;
  --color-text: #1E293B;
  --color-text-medium: #64748B;
  --color-success: #096056;
  --color-whatsapp: #1FAD55;
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-sm);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

.price {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
}

/* Content Thumbnails */
.content-thumbnail {
  max-width: 180px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.content-thumbnail:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.content-thumbnail img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Large thumbnails - 200px mobile, 400px desktop */
.content-thumbnail-large {
  max-width: 200px;
}

@media (min-width: 769px) {
  .content-thumbnail-large {
    max-width: 400px;
  }
}

/* 400px on mobile, 700px on desktop (rccbackground) */
.content-thumbnail-mobile-large {
  max-width: 400px;
}

@media (min-width: 769px) {
  .content-thumbnail-mobile-large {
    max-width: 700px;
  }
}

@media (max-width: 768px) {
  .content-thumbnail {
    max-width: 140px;
  }

  /* Override for rccbackground - combined selector has higher specificity (0,0,2,0) */
  .content-thumbnail.content-thumbnail-mobile-large {
    max-width: 400px !important;
  }
}

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* Header/Navigation */
.header {
  background: var(--color-bg);
  border-bottom: 1px solid #e5e7eb;
  padding: 0.5rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.95);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--spacing-sm);
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: opacity 0.2s;
}

.nav-logo:hover {
  opacity: 0.8;
}

.nav-logo img {
  max-height: 120px;
  width: auto;
  display: block;
  max-width: 350px;
  object-fit: contain;
}

@media (max-width: 768px) {
  .nav-logo img {
    max-height: 80px;
    max-width: 220px;
  }

  .nav-logo {
    font-size: 1.25rem;
    margin-left: -15px;
  }

  .nav {
    align-items: flex-start;
  }

  .nav-links {
    flex-direction: column;
    align-items: flex-end;
    gap: 0.375rem;
    margin-right: -15px;
  }

  .nav-links a {
    font-size: 0.875rem;
    padding: 0.125rem 0.25rem;
  }

  .nav.container {
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .nav-logo img {
    max-height: 60px;
    max-width: 180px;
  }

  .nav-logo {
    margin-left: -15px;
  }

  .nav {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }

  .nav-links {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    margin: 0;
    margin-right: -15px;
  }

  .nav-links li:nth-child(4) {
    /* Remove special styling for About Us */
    flex-basis: auto;
    text-align: right;
  }

  .nav-links a {
    font-size: 0.8125rem;
    padding: 0.125rem 0.25rem;
  }

  .nav.container {
    gap: 0.5rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
}

.nav-links {
  display: flex;
  gap: var(--spacing-md);
  list-style: none;
}

.nav-links a {
  color: var(--color-text);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--color-primary);
}

/* Hero Section */
.hero {
  position: relative;
  height: 70vh;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  overflow: hidden;
}

.hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.25);
  z-index: 1;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
  z-index: 0;
}

.hero-content {
  position: relative;
  text-align: center;
  color: white;
  z-index: 2;
  max-width: 800px;
  padding: var(--spacing-lg);
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: var(--spacing-lg);
  opacity: 0.95;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.875rem 2rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.btn-primary {
  background: var(--color-primary);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(14, 165, 233, 0.3);
}

.btn-whatsapp {
  background: var(--color-whatsapp);
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-whatsapp:hover {
  background: #1A9448;
}

.btn-directions {
  background: var(--color-text-medium);
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-directions:hover {
  background: var(--color-text);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Property Cards */
.property-card {
  background: white;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: all 0.3s;
  cursor: pointer;
  position: relative;
}

.property-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

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

.property-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

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

.property-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: white;
  padding: var(--spacing-md);
}

.property-card-price {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.property-card-title {
  font-size: 1rem;
  margin-bottom: 0.5rem;
  opacity: 0.95;
}

.property-card-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  opacity: 0.9;
}

.property-card-badge {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  background: var(--color-success);
  color: #FFFFFF;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

/* Property Grid */
.property-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}

/* Filters */
.filters {
  display: flex;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border: 2px solid #e5e7eb;
  background: white;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.filter-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.filter-btn:hover {
  border-color: var(--color-primary);
}

/* Map Styles */
#map {
  width: 100%;
  height: 600px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.map-info-window {
  max-width: 200px;
}

.map-info-image {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}

/* WhatsApp Floating Button */
.whatsapp-float {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--color-whatsapp);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  z-index: 1000;
  text-decoration: none;
  transition: all 0.3s;
  animation: pulse 2s infinite;
}

.whatsapp-float:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.6);
}

.whatsapp-float svg {
  width: 32px;
  height: 32px;
  fill: white;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  }
  50% {
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.7);
  }
}

/* Property Detail Page */
.property-detail {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-lg);
}

.property-gallery {
  margin-bottom: var(--spacing-xl);
}

.gallery-main {
  width: 100%;
  height: 500px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: var(--spacing-md);
  cursor: pointer;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-thumbnails {
  display: flex;
  gap: var(--spacing-sm);
  overflow-x: auto;
  padding-bottom: var(--spacing-sm);
}

.gallery-thumb {
  width: 100px;
  height: 80px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.gallery-thumb:hover,
.gallery-thumb.active {
  opacity: 1;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.property-info-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--spacing-lg);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  margin-bottom: var(--spacing-lg);
}

.property-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--spacing-md);
  margin: var(--spacing-lg) 0;
}

.stat-item {
  text-align: center;
  padding: var(--spacing-md);
  background: var(--color-bg-light);
  border-radius: var(--radius-md);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--color-text-medium);
}

.features-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-sm);
  margin: var(--spacing-md) 0;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--color-bg-light);
  border-radius: var(--radius-sm);
}

.feature-icon {
  color: var(--color-success);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: white;
  color: black;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .hero {
    min-height: 400px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .hero-video {
    /* Maintain video on mobile but allow for potential performance considerations */
    min-height: 100%;
  }

  .property-grid {
    grid-template-columns: 1fr;
  }

  .gallery-main {
    height: 300px;
  }

  .nav-links {
    gap: var(--spacing-sm);
  }

  .nav-links a {
    font-size: 0.875rem;
  }
}

/* Mobile-specific optimizations for slower connections */
@media (max-width: 480px) {
  .hero {
    min-height: 350px;
  }
}

/* Loading State */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* RCC Gallery Styles */
.rcc-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 0 auto;
  max-width: 1200px;
}

.rcc-gallery-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  aspect-ratio: 4/3;
}

.rcc-gallery-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(14, 165, 233, 0.2);
}

.rcc-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.rcc-gallery-item:hover img {
  transform: scale(1.05);
}

/* Responsive RCC Gallery */
@media (max-width: 768px) {
  .rcc-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .rcc-gallery {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Share Button and Notification */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  min-height: 44px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.3s, transform 0.1s;
}

.share-btn:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
}

.share-btn:active {
  transform: translateY(0);
}

.share-btn:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

.share-btn svg {
  flex-shrink: 0;
}

/* Share Notification */
.share-notification {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-success);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.share-notification.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .share-btn {
    width: 100%;
    justify-content: center;
  }

  .share-notification {
    bottom: 20px;
    left: 20px;
    right: 20px;
    transform: none;
  }
}

/* Gallery Navigation - Arrows, Counter, and Keyboard Support */
.gallery-main {
  position: relative;
}

.gallery-main-image {
  width: 100%;
  height: auto;
  display: block;
}

/* Navigation Arrows */
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  width: 48px;
  height: 48px;
  min-height: 48px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.gallery-nav:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: translateY(-50%) scale(1.1);
}

.gallery-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.gallery-nav:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

.gallery-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.gallery-nav-prev {
  left: 20px;
}

.gallery-nav-next {
  right: 20px;
}

/* Image Counter */
.gallery-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  backdrop-filter: blur(4px);
  user-select: none;
  z-index: 10;
}

/* Keyboard hint */
.gallery-keyboard-hint {
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
  color: var(--color-text-medium);
}

/* Animation for image changes */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.gallery-main-image.changing {
  animation: fadeIn 0.3s ease;
}

/* Gallery thumbnails accessibility */
.gallery-thumb {
  cursor: pointer;
  transition: transform 0.2s, border-color 0.3s;
  border: 3px solid transparent;
}

.gallery-thumb:hover {
  transform: scale(1.05);
}

.gallery-thumb:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

.gallery-thumb.active {
  border-color: var(--color-primary);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
  .gallery-nav {
    display: none; /* Hide arrows on mobile, swipe gestures preferred */
  }

  .gallery-counter {
    bottom: 12px;
    font-size: 13px;
    padding: 6px 12px;
  }

  /* Hide keyboard hint on mobile */
  .gallery-keyboard-hint {
    display: none;
  }
}
