/* ============================================
   A Vendre Algerie - Styles
   ============================================ */

/* --- Variables --- */
:root {
  --navy: #1a3a5c;
  --navy-light: #2a5a8c;
  --navy-dark: #0f2440;
  --gold: #c49a3c;
  --gold-light: #d4b060;
  --gold-dark: #a07a2c;
  --white: #ffffff;
  --off-white: #f8f6f2;
  --gray-100: #f5f5f5;
  --gray-200: #e8e8e8;
  --gray-300: #d0d0d0;
  --gray-600: #666666;
  --gray-800: #333333;
  --text: #2c2c2c;
  --shadow: rgba(0, 0, 0, 0.12);
  --shadow-lg: rgba(0, 0, 0, 0.2);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: 0.3s ease;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: Georgia, "Times New Roman", serif;
  --header-height: 70px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: var(--font);
  color: var(--text);
  line-height: 1.6;
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--navy);
  text-decoration: none;
}

ul {
  list-style: none;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.2;
  color: var(--navy);
}

h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }

.section-title {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--gold);
  margin: 0.8rem auto 0;
  border-radius: 2px;
}

/* --- Layout --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

section {
  padding: 5rem 0;
}

section:nth-child(even) {
  background: var(--off-white);
}

/* ============================================
   HEADER / NAV
   ============================================ */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: background var(--transition), box-shadow var(--transition);
  height: var(--header-height);
}

.header--transparent {
  background: transparent;
}

.header--solid {
  background: var(--navy);
  box-shadow: 0 2px 10px var(--shadow);
}

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

.logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--white);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.logo span {
  color: var(--gold);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gold);
  transition: width var(--transition);
}

.nav-links a:hover::after {
  width: 100%;
}

.lang-switcher {
  display: flex;
  gap: 0.5rem;
  margin-left: 1rem;
  padding-left: 1rem;
  border-left: 1px solid rgba(255,255,255,0.3);
}

.lang-switcher a {
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  transition: color var(--transition);
}

.lang-switcher a:hover,
.lang-switcher a.active {
  color: var(--gold);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 5px;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 2px;
  background: var(--white);
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--white);
  overflow: hidden;
  padding: 0;
  background: var(--navy-dark);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(15, 36, 64, 0.4) 0%,
    rgba(15, 36, 64, 0.2) 40%,
    rgba(15, 36, 64, 0.5) 100%
  );
  z-index: 1;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  padding: 0 1.5rem;
}

.hero h1 {
  color: var(--white);
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin-bottom: 1rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.hero .subtitle {
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  margin-bottom: 2.5rem;
  opacity: 0.95;
  font-weight: 300;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}

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

.btn-primary:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(196, 154, 60, 0.4);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}

.btn-outline:hover {
  background: var(--white);
  color: var(--navy);
  transform: translateY(-2px);
}

/* ============================================
   PROPERTY SECTION
   ============================================ */
.property-description {
  text-align: center;
  max-width: 750px;
  margin: 0 auto 3rem;
  font-size: 1.05rem;
  color: var(--gray-600);
  line-height: 1.8;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.feature-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem 1.25rem;
  text-align: center;
  box-shadow: 0 2px 15px var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px var(--shadow-lg);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.feature-card h3 {
  font-family: var(--font);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 0.25rem;
}

.feature-card p {
  color: var(--gray-600);
  font-size: 0.9rem;
}

.price-tag {
  text-align: center;
  margin-top: 2rem;
}

.price-tag .price {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--gold-dark);
  font-weight: 700;
}

.price-tag .price-label {
  font-size: 0.95rem;
  color: var(--gray-600);
}

/* ============================================
   LEVELS SECTION
   ============================================ */
.levels-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.level-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 2px 15px var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform var(--transition);
}

.level-card:hover {
  transform: translateY(-3px);
}

.level-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--gold);
}

.level-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.level-badge {
  background: var(--navy);
  color: var(--white);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.level-badge--wip {
  background: var(--gold);
}

.level-card h3 {
  font-family: var(--font);
  color: var(--navy);
}

.level-card ul {
  padding-left: 0;
}

.level-card li {
  padding: 0.3rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--gray-600);
  font-size: 0.95rem;
}

.level-card li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--gold);
  font-weight: 700;
}

.extras {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.extra-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 1px 8px var(--shadow);
}

.extra-icon {
  font-size: 1.5rem;
}

.extra-item span {
  font-size: 0.9rem;
  color: var(--gray-600);
}

/* ============================================
   GALLERY
   ============================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: pointer;
  aspect-ratio: 4/3;
}

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

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

.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(26, 58, 92, 0);
  transition: background var(--transition);
}

.gallery-item:hover::after {
  background: rgba(26, 58, 92, 0.2);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius);
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--white);
  font-size: 2rem;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--transition);
}

.lightbox-close:hover {
  opacity: 0.7;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255,255,255,0.3);
}

.lightbox-prev {
  left: 1.5rem;
}

.lightbox-next {
  right: 1.5rem;
}

.lightbox-counter {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
}

/* ============================================
   LOCATION
   ============================================ */
.location-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.location-text p {
  color: var(--gray-600);
  margin-bottom: 1rem;
  line-height: 1.8;
}

.location-text ul {
  padding: 0;
}

.location-text li {
  padding: 0.4rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--gray-600);
}

.location-text li::before {
  content: "\2022";
  position: absolute;
  left: 0;
  color: var(--gold);
  font-weight: 700;
  font-size: 1.2rem;
}

.map-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 20px var(--shadow);
}

.map-container iframe {
  width: 100%;
  height: 400px;
  border: 0;
}

/* ============================================
   CONTACT
   ============================================ */
.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.contact-info h3 {
  margin-bottom: 1rem;
}

.contact-info p {
  color: var(--gray-600);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gold-dark);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.contact-email:hover {
  color: var(--gold);
}

.contact-form {
  background: var(--white);
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px var(--shadow);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--navy);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: border-color var(--transition);
  background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(196, 154, 60, 0.15);
}

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

.form-group input.error,
.form-group textarea.error {
  border-color: #e74c3c;
}

.form-error {
  color: #e74c3c;
  font-size: 0.8rem;
  margin-top: 0.3rem;
  display: none;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.btn-submit {
  width: 100%;
  padding: 0.9rem;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}

.btn-submit:hover {
  background: var(--navy-light);
  transform: translateY(-2px);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.7);
  padding: 2.5rem 0;
  text-align: center;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer p {
  font-size: 0.85rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  transition: color var(--transition);
}

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

/* Back to top */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  z-index: 500;
  box-shadow: 0 2px 10px var(--shadow);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--gold);
  transform: translateY(-3px);
}

/* ============================================
   SCROLL REVEAL
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .location-content {
    grid-template-columns: 1fr;
  }

  .map-container iframe {
    height: 350px;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 60px;
  }

  .hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--navy);
    flex-direction: column;
    padding: 1.5rem;
    gap: 1rem;
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition), opacity var(--transition);
    box-shadow: 0 4px 15px var(--shadow);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .lang-switcher {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.2);
    justify-content: center;
    width: 100%;
  }

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

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-content {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  section {
    padding: 3.5rem 0;
  }

  .hero {
    min-height: 500px;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

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

  .lightbox-prev,
  .lightbox-next {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  .lightbox-prev {
    left: 0.75rem;
  }

  .lightbox-next {
    right: 0.75rem;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .features-grid {
    grid-template-columns: 1fr;
  }

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

  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 280px;
    text-align: center;
  }

  .price-tag .price {
    font-size: 2rem;
  }
}

/* ============================================
   RTL (Arabic)
   ============================================ */
[dir="rtl"] {
  --font: "Segoe UI", Tahoma, Arial, sans-serif;
  --font-heading: "Segoe UI", Tahoma, Arial, sans-serif;
}

[dir="rtl"] .nav-links a::after {
  left: auto;
  right: 0;
}

[dir="rtl"] .lang-switcher {
  margin-left: 0;
  margin-right: 1rem;
  padding-left: 0;
  padding-right: 1rem;
  border-left: none;
  border-right: 1px solid rgba(255,255,255,0.3);
}

[dir="rtl"] .level-card::before {
  left: auto;
  right: 0;
}

[dir="rtl"] .level-card li {
  padding-left: 0;
  padding-right: 1.5rem;
}

[dir="rtl"] .level-card li::before {
  left: auto;
  right: 0;
}

[dir="rtl"] .location-text li {
  padding-left: 0;
  padding-right: 1.5rem;
}

[dir="rtl"] .location-text li::before {
  left: auto;
  right: 0;
}

[dir="rtl"] .back-to-top {
  right: auto;
  left: 2rem;
}

[dir="rtl"] .lightbox-prev {
  left: auto;
  right: 1.5rem;
}

[dir="rtl"] .lightbox-next {
  right: auto;
  left: 1.5rem;
}

@media (max-width: 768px) {
  [dir="rtl"] .lang-switcher {
    margin-right: 0;
    padding-right: 0;
    border-right: none;
  }

  [dir="rtl"] .lightbox-prev {
    right: 0.75rem;
  }

  [dir="rtl"] .lightbox-next {
    left: 0.75rem;
  }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .gallery-item img {
    transition: none;
  }
}
