/* ============================================
   E&M IMMOBILIER - CUSTOM PREMIUM STYLES
   Bootstrap 5 + Modern Animations
   ============================================ */

/* ========== ROOT VARIABLES ========== */
:root {
  /* Brand Colors */
  --primary-color: #0d6efd;
  --primary-dark: #0a58ca;
  --primary-light: #6ea8fe;
  --secondary-color: #6c757d;
  --accent-color: #20c997;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-hero: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
  --gradient-overlay: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.7) 100%);
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 40px rgba(0,0,0,0.15);
  --shadow-hover: 0 15px 35px rgba(0,0,0,0.12);
  
  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
  
  /* Border Radius */
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-xl: 2rem;
}

/* ========== GLOBAL STYLES ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  background: #fff;
  overflow-x: hidden;
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: #1a1a1a;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

p {
  margin-bottom: 1rem;
  color: #555;
}

/* ========== NAVBAR ========== */
.navbar {
  padding: 1rem 0;
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: blur(20px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.05);
  transition: all var(--transition-base);
}

.navbar-toggler {
  border: 1px solid rgba(0,0,0,0.1);
  padding: 0.25rem 0.5rem;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833, 37, 41, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  width: 1.5em;
  height: 1.5em;
}

.navbar.scrolled {
  padding: 0.5rem 0;
  box-shadow: 0 4px 30px rgba(0,0,0,0.1);
}

.navbar-brand {
  font-size: 1.75rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all var(--transition-fast);
}

.navbar-brand:hover {
  transform: translateY(-2px);
}

.nav-link {
  font-weight: 600;
  color: #333 !important;
  padding: 0.5rem 1rem !important;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: all var(--transition-base);
  transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 80%;
}

.nav-link:hover {
  color: var(--primary-color) !important;
  transform: translateY(-2px);
}

.dropdown-menu {
  border: none;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  margin-top: 0.5rem;
  animation: dropdownFadeIn var(--transition-base);
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--gradient-primary);
  color: white !important;
  transform: translateX(5px);
}

/* ========== BUTTONS ========== */
.btn {
  font-weight: 600;
  padding: 0.75rem 2rem;
  border-radius: var(--radius-md);
  border: none;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s;
  z-index: -1;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: var(--gradient-primary);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.btn-outline-primary {
  border: 2px solid;
  border-image: var(--gradient-primary) 1;
  color: var(--primary-color);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--gradient-primary);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-lg {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
}

/* ========== HERO SECTION ========== */
.hero-section {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  overflow: hidden;
  padding: 4rem 0;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.hero-content {
  position: relative;
  z-index: 2;
  animation: heroFadeIn 1s ease;
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-title {
  color: white;
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  margin-bottom: 1.5rem;
  text-shadow: 0 4px 20px rgba(0,0,0,0.2);
  animation: titleSlideIn 0.8s ease;
}

@keyframes titleSlideIn {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.hero-subtitle {
  color: rgba(255,255,255,0.95);
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  margin-bottom: 2rem;
  line-height: 1.6;
  animation: subtitleSlideIn 1s ease 0.2s both;
}

@keyframes subtitleSlideIn {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.hero-search {
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  animation: searchFadeIn 1s ease 0.4s both;
}

@keyframes searchFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== CARDS ========== */
.card {
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  height: 100%;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
}

.card-img-top {
  height: 250px;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.card:hover .card-img-top {
  transform: scale(1.1);
}

.card-img-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--gradient-primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: var(--shadow-md);
  z-index: 2;
}

.card-body {
  padding: 1.5rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: #1a1a1a;
}

.card-text {
  color: #666;
  margin-bottom: 1rem;
}

.card-price {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.card-features {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  font-size: 0.875rem;
  color: #666;
}

.card-features span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ========== SECTIONS ========== */
section {
  padding: 3rem 0;
  position: relative;
}

.section-title {
  text-align: center;
  margin-bottom: 2rem;
  animation: fadeInUp 0.8s ease;
}

.section-title h2 {
  margin-bottom: 0.75rem;
}

.section-title p {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 0;
}

.bg-light-gradient {
  background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
}

/* ========== EMPTY CONTAINER FIXES ========== */
#featured-properties:empty,
#quartiers-grid:empty,
#properties-container:empty,
#posts-container:empty {
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
}

#featured-properties:empty::before,
#quartiers-grid:empty::before,
#properties-container:empty::before,
#posts-container:empty::before {
  content: 'Chargement...';
  color: #999;
  font-size: 1rem;
  font-style: italic;
}

/* Reduce spacing for empty rows */
.row:empty {
  display: none;
}

/* Ensure sections don't have excessive padding when content is loading */
section:has(#featured-properties:empty),
section:has(#quartiers-grid:empty) {
  padding-bottom: 1rem;
}

/* ========== ANIMATION UTILITIES ========== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* ========== PROPERTY CARD (Bootstrap Enhanced) ========== */
.property-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  background: white;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.property-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.property-image {
  position: relative;
  height: 250px;
  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.08);
}

.property-status {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--gradient-primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: var(--shadow-md);
  z-index: 2;
}

.property-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.property-price {
  font-size: 1.75rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.75rem;
}

.property-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

.property-location {
  color: #666;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.property-features {
  display: flex;
  gap: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e9ecef;
  margin-top: auto;
}

.property-feature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #666;
  font-size: 0.9rem;
}

/* ========== QUARTIER CARDS ========== */
.quartier-card {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 200px;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  cursor: pointer;
}

.quartier-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: var(--shadow-xl);
}

.quartier-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.quartier-card:hover img {
  transform: scale(1.15);
}

.quartier-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-overlay);
  z-index: 1;
}

.quartier-card-content {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  z-index: 2;
  color: white;
}

.quartier-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
  margin: 0;
}

/* ========== SERVICE CARDS ========== */
.service-card {
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  border: 2px solid transparent;
  height: 100%;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-color);
}

.service-icon {
  width: 70px;
  height: 70px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: white;
  font-size: 2rem;
  transition: all var(--transition-base);
}

.service-card:hover .service-icon {
  transform: scale(1.1) rotate(5deg);
}

/* ========== TESTIMONIALS ========== */
.testimonial-card {
  padding: 2rem;
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  border-left: 4px solid var(--primary-color);
  height: 100%;
}

.testimonial-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.testimonial-stars {
  color: #ffc107;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.testimonial-text {
  font-style: italic;
  color: #555;
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.testimonial-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.25rem;
}

/* ========== CTA SECTION ========== */
.cta-section {
  background: var(--gradient-primary);
  color: white;
  padding: 5rem 0;
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}

.cta-section::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
}

.cta-content {
  position: relative;
  z-index: 2;
}

/* ========== FOOTER ========== */
footer {
  background: #1a1a1a;
  color: rgba(255,255,255,0.8);
  padding: 4rem 0 2rem;
}

footer h5 {
  color: white;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

footer a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: all var(--transition-fast);
  display: block;
  margin-bottom: 0.75rem;
}

footer a:hover {
  color: white;
  transform: translateX(5px);
}

.footer-brand {
  font-size: 1.75rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  margin-right: 0.75rem;
  transition: all var(--transition-base);
}

.social-links a:hover {
  background: var(--gradient-primary);
  transform: translateY(-5px);
}

/* ========== FORM STYLES ========== */
.form-control,
.form-select {
  border-radius: var(--radius-sm);
  border: 2px solid #e9ecef;
  padding: 0.75rem 1rem;
  transition: all var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.form-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #333;
}

/* ========== LOADING SPINNER ========== */
.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255,255,255,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner-border-custom {
  width: 4rem;
  height: 4rem;
  border: 0.4rem solid #f3f3f3;
  border-top: 0.4rem solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ========== OVERRIDE BOOTSTRAP PADDING ========== */
section.py-5 {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  section {
    padding: 2rem 0;
  }
  
  .hero-section {
    min-height: 60vh;
    padding: 2rem 0;
  }
  
  .section-title {
    margin-bottom: 1.5rem;
  }
  
  .card-img-top,
  .property-image {
    height: 200px;
  }
  
  .quartier-card {
    height: 150px;
  }
  
  .btn {
    padding: 0.65rem 1.5rem;
  }
}

/* ========== SCROLL TO TOP BUTTON ========== */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
  opacity: 0;
  visibility: hidden;
  z-index: 1000;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

/* ========== UTILITIES ========== */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-gradient-primary {
  background: var(--gradient-primary) !important;
}

.shadow-custom {
  box-shadow: var(--shadow-lg) !important;
}

.rounded-custom {
  border-radius: var(--radius-lg) !important;
}


