/**
 * Homepage Styles for Travelgram
 * 
 * This file contains styles specific to the homepage including:
 * - Hero section with background image and parallax effect
 * - Featured destinations grid layout
 * - Gallery preview styling
 * - Map preview section
 * - Quote and contact sections
 * - Responsive design for mobile devices
 * 
 * @author Admir Bjelic
 * @version 1.0
 */

/* Hero Section - Full viewport height with background image */
.hero {
  position: relative;
  height: 100vh; /* Full viewport height */
  height: calc(var(--vh, 1vh) * 100); /* Use JavaScript-calculated viewport height */
  height: 100dvh; /* Dynamic viewport height for iOS Safari */
  min-height: 600px; /* Minimum height for smaller screens */
  display: flex;
  align-items: center;
  overflow: hidden; /* Hide overflow for parallax effect */
  background-color: var(--bg);
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  background-image: url("/assets/Home/View_From_Eiffel_Tower.jpeg?v=2");
  background-size: cover;
  background-position: center;
  background-attachment: fixed; /* Fixed for desktop browsers */
  filter: brightness(0.7);
  transform: translateZ(0);
  will-change: transform;
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
  .hero-background {
    background-attachment: scroll;
    -webkit-background-size: cover;
    background-size: cover;
    transform: translate3d(0, 0, 0);
  }

  .hero {
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    height: -webkit-fill-available;
  }

  /* Fix for iOS Safari viewport issues */
  .hero-content {
    transform: translateY(-20%);
  }
}

.hero-background::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgb(0 0 0 / 50%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 3;
  width: 100%;
  color: white;
  text-align: center;
  transform: translateY(-30%);
}

.hero-content p {
  color: white !important;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: white;
  text-shadow: 2px 2px 6px rgb(0 0 0 / 70%);
  animation: fade-in-up 1s ease-out;
}

.hero-subtitle {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: white !important;
  text-shadow: 2px 2px 6px rgb(0 0 0 / 70%);
  opacity: 0.9;
  animation: fade-in-up 1s ease-out 0.2s both;
}

.hero-description {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  color: white !important;
  text-shadow: 2px 2px 6px rgb(0 0 0 / 70%);
  opacity: 0.8;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  animation: fade-in-up 1s ease-out 0.4s both;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: fade-in-up 1s ease-out 0.6s both;
}

/* Button Styles */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: #fff;
  color: #2d6cdf;
  border-color: #fff;
  box-shadow: 0 4px 12px rgb(0 0 0 / 20%);
}

.btn-primary:hover {
  background: #f8f9fa;
  color: #1e5bb8;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgb(0 0 0 / 30%);
}

.btn-secondary {
  background: rgb(255 255 255 / 90%);
  color: #2d6cdf;
  border-color: rgb(255 255 255 / 90%);
  box-shadow: 0 4px 12px rgb(0 0 0 / 20%);
}

.btn-secondary:hover {
  background: #fff;
  color: #1e5bb8;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgb(0 0 0 / 30%);
}

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

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

/* About Teaser */
.about-teaser {
  padding: 5rem 0;
  background: white;
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  align-items: center;
}

.about-image img {
  width: 100%;
  max-width: 300px;
  border-radius: 50%;
  box-shadow: 0 8px 24px rgb(0 0 0 / 10%);
  transition: transform 0.3s ease;
}

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

.about-text h2 {
  margin-bottom: 1rem;
  color: var(--primary);
}

.about-text p {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  color: #555;
}

/* Featured Destinations */
.featured-destinations {
  padding: 5rem 0;
  background: var(--bg);
}

.featured-destinations h2 {
  text-align: center;
  margin-bottom: 3rem;
  color: var(--primary);
}

.destinations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.destination-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgb(0 0 0 / 10%);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  cursor: pointer;
}

.destination-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgb(0 0 0 / 15%);
}

.destination-image {
  height: 200px;
  overflow: hidden;
}

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

.destination-card:hover .destination-image img {
  transform: scale(1.1);
}

.destination-content {
  padding: 1.5rem;
}

.destination-content h3 {
  margin-bottom: 0.3rem;
  color: var(--primary);
  font-size: 1.3rem;
}

.destination-country {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
  font-weight: 500;
}

.destination-excerpt {
  color: #666;
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.destination-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: #888;
  flex-wrap: wrap;
}

.destination-year,
.destination-continent {
  background: #f8f9fa;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  border: 1px solid #e9ecef;
}

.section-footer {
  text-align: center;
}

/* Map Preview */
.map-preview {
  padding: 5rem 0;
  background: white;
}

.map-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.map-text h2 {
  margin-bottom: 1rem;
  color: var(--primary);
}

.map-text p {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  color: #555;
}

.map-container {
  position: relative;
}

.map-placeholder {
  height: 300px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.map-overlay {
  z-index: 2;
  position: relative;
}

.map-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}

/* Gallery Preview */
.gallery-preview {
  padding: 5rem 0;
  background: var(--bg);
}

.gallery-preview h2 {
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.section-subtitle {
  text-align: center;
  color: #666;
  margin-bottom: 3rem;
  font-size: 1.1rem;
}

.gallery-thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}

.gallery-thumbnail {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease;
}

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

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

/* Quote Section */
.quote-section {
  padding: 5rem 0;
  background: linear-gradient(135deg, var(--primary) 0%, #1e5bb8 100%);
  color: white;
}

.quote-card {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  padding: 3rem;
  background: rgb(255 255 255 / 10%);
  border-radius: 16px;
  backdrop-filter: blur(10px);
}

.quote-card blockquote {
  font-size: 2rem;
  font-style: italic;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.quote-card cite {
  font-size: 1.1rem;
  opacity: 0.8;
}

/* Contact Teaser */
.contact-teaser {
  padding: 5rem 0;
  background: white;
  text-align: center;
}

.contact-content h2 {
  margin-bottom: 1rem;
  color: var(--primary);
}

.contact-content p {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  color: #555;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

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

/* Footer */
.footer {
  background: #2c3e50;
  color: white;
  padding: 3rem 0 1rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3,
.footer-section h4 {
  margin-bottom: 1rem;
  color: white;
}

.footer-section p {
  color: #bdc3c7;
  line-height: 1.6;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section ul li a {
  color: #bdc3c7;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-section ul li a:hover {
  color: white;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-link {
  color: #bdc3c7;
  text-decoration: none;
  transition: color 0.2s;
}

.social-link:hover {
  color: white;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid #34495e;
  color: #bdc3c7;
}

/* Animations */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll Animations */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive Design */
@media (width <= 768px) {
  .hero-title {
    font-size: 2.5rem;
    text-shadow: 1px 1px 4px rgb(0 0 0 / 80%);
  }

  .hero-subtitle {
    font-size: 1.2rem;
    text-shadow: 1px 1px 4px rgb(0 0 0 / 80%);
  }

  .hero-description {
    text-shadow: 1px 1px 4px rgb(0 0 0 / 80%);
  }

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

  .about-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

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

  .contact-buttons {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }

  .quote-card blockquote {
    font-size: 1.5rem;
  }

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

  .gallery-thumbnails {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

/* iPhone 15 Pro Max and iPhone 14 Pro Max specific fixes */
@media only screen and (device-width = 430px) and (device-height = 932px) {
  .hero {
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    height: -webkit-fill-available;
    min-height: -webkit-fill-available;
  }

  .hero-content {
    transform: translateY(-15%);
  }

  .hero-title {
    font-size: 2.2rem;
    text-shadow: 1px 1px 4px rgb(0 0 0 / 80%);
  }

  .hero-subtitle {
    font-size: 1.1rem;
    text-shadow: 1px 1px 4px rgb(0 0 0 / 80%);
  }

  .hero-description {
    font-size: 0.95rem;
    text-shadow: 1px 1px 4px rgb(0 0 0 / 80%);
    margin-bottom: 1.5rem;
  }

  .hero-buttons {
    gap: 0.75rem;
  }

  .btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
  }
}

@media (width <= 480px) {
  .hero-title {
    font-size: 2rem;
    text-shadow: 1px 1px 3px rgb(0 0 0 / 90%);
  }

  .hero-subtitle {
    text-shadow: 1px 1px 3px rgb(0 0 0 / 90%);
  }

  .hero-description {
    font-size: 1rem;
    text-shadow: 1px 1px 3px rgb(0 0 0 / 90%);
  }

  .quote-card {
    padding: 2rem 1rem;
  }

  .quote-card blockquote {
    font-size: 1.3rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: left;
  }
}

/* Loading States */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--primary);
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* iOS Safari specific fixes for better rendering */
@supports (-webkit-touch-callout: none) {
  /* Fix for iOS Safari rendering issues */
  .hero-background {
    /* stylelint-disable-next-line property-no-vendor-prefix */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    /* stylelint-disable-next-line property-no-vendor-prefix */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }

  /* Fix for iOS Safari text rendering */
  .hero-title,
  .hero-subtitle,
  .hero-description {
    /* stylelint-disable-next-line property-no-vendor-prefix */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  /* Fix for iOS Safari button rendering */
  .btn {
    /* stylelint-disable-next-line property-no-vendor-prefix */
    -webkit-appearance: none;
    appearance: none;
    /* stylelint-disable-next-line property-no-vendor-prefix */
    -webkit-tap-highlight-color: transparent;
  }
}

/* Dark Mode Styles for Home Page */
[data-theme="dark"] .hero-title {
  color: white !important;
}

[data-theme="dark"] .about-teaser {
  background: #2d2d2d;
}

[data-theme="dark"] .about-text h2 {
  color: var(--primary-dark);
}

[data-theme="dark"] .about-text p {
  color: var(--text-dark);
}

[data-theme="dark"] .featured-destinations h2 {
  color: var(--primary-dark);
}

[data-theme="dark"] .destination-card {
  background: var(--card-bg-dark);
  box-shadow: var(--shadow-dark);
}

[data-theme="dark"] .destination-content h3 {
  color: var(--primary-dark);
}

[data-theme="dark"] .destination-country {
  color: #a0a0a0;
}

[data-theme="dark"] .destination-excerpt {
  color: #c0c0c0;
}

[data-theme="dark"] .destination-year,
[data-theme="dark"] .destination-continent {
  background: var(--border-dark);
  border: 1px solid #505050;
  color: var(--text-dark);
}

[data-theme="dark"] .map-preview {
  background: #2d2d2d;
}

[data-theme="dark"] .map-text h2 {
  color: var(--primary-dark);
}

[data-theme="dark"] .map-text p {
  color: var(--text-dark);
}

[data-theme="dark"] .gallery-preview h2 {
  color: var(--primary-dark);
}

[data-theme="dark"] .section-subtitle {
  color: #a0a0a0;
}

[data-theme="dark"] .quote-section {
  background: #2d2d2d;
}

[data-theme="dark"] .contact-teaser {
  background: #2d2d2d;
}

[data-theme="dark"] .contact-content h2 {
  color: var(--primary-dark);
}

[data-theme="dark"] .contact-content p {
  color: var(--text-dark);
}
