/* =============================================================================
   HOME APP SPECIFIC STYLES
   Extensions and customizations for the homepage
   Built on top of the global Maxalarmanlage Design System
   ============================================================================= */

/* =============================================================================
   HOME-SPECIFIC COMPONENT EXTENSIONS
   ============================================================================= */

/* Hero Section Customizations */
.hero-home {
  /* More balanced gradient - less overwhelming blue */
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  position: relative;
  overflow: visible;
  /* Background image settings */
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  min-height: 80vh;
  display: flex;
  align-items: center;
}

/* Hero Grid Layout */
.hero-grid {
  grid-template-columns: 3fr 2fr;
}

@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

/* Background image via data attribute */
.hero-with-bg-image[data-bg-image] {
  background-image: attr(data-bg-image url);
}

/* Hero Grid Layout
   Using 3fr 2fr ratio (60/40) instead of 1fr 1fr (50/50) to give text content more breathing room
   This prevents text from feeling cramped while maintaining form visibility
   Responsive overrides ensure mobile/tablet use single column layout */

/* Dark overlay for better text readability over the family image */
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg, 
    rgba(102, 126, 234, 0.8) 0%, 
    rgba(118, 75, 162, 0.7) 50%, 
    rgba(240, 147, 251, 0.6) 100%
  );
  z-index: 1;
}

/* Ensure content appears above the overlay */
.hero-home .container {
  position: relative;
  z-index: 50; /* Higher z-index to ensure all hero content is above overlays */
}

/* Ensure hero content area has proper positioning */
.hero-home .hero-content {
  position: relative;
  z-index: 60; /* Ensure text content is above everything */
}

/* Ensure no pseudo-elements interfere with hero content */
.hero-home .hero-content::before,
.hero-home .hero-content::after,
.hero-home .hero-content h1::before,
.hero-home .hero-content h1::after {
  display: none !important;
  content: none !important;
}

/* Hero Overlay Image (Security System, etc.) */
.hero-overlay-image {
  position: absolute;
  bottom: -180px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5; /* Lowered significantly to ensure it's below hero content container (z-index 11) */
  filter: drop-shadow(0 15px 40px rgba(0, 0, 0, 0.2));
  pointer-events: none;
}

.hero-overlay-image .overlay-img,
.hero-overlay-image picture img {
  max-width: 450px;
  width: 40vw;
  height: auto;
  border-radius: 12px;
  transition: all 0.3s ease;
}

/* Hover effect for overlay image - subtle */
.hero-overlay-image:hover {
  transform: translateX(-50%) scale(1.02);
  filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.25));
}

.hero-home::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="security-pattern" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="white" opacity="0.08"/></pattern></defs><rect width="100" height="100" fill="url(%23security-pattern)"/></svg>');
  pointer-events: none;
  z-index: 1;
}

/* Hero Image Responsive Styling */
.hero-image {
  margin-top: var(--space-8);
}

.hero-img,
.hero-image picture img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  transition: all var(--transition-base);
}

.hero-img:hover,
.hero-image picture img:hover {
  transform: scale(1.02);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

/* Home-specific contact form enhancements */
.contact-form-home {
  /* Enhanced styling for the home page contact form - Made more compact */
  position: relative;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  max-width: 350px; /* Smaller to fit better at right edge */
  width: 100%;
  margin-left: auto; /* Align to the right side */
  margin-right: 20px; /* Closer to edge - move as far right as possible */
  transform: none; 
  z-index: 1000; /* Ensure form is always above overlay image */
}

/* Reduce padding inside the form */
.contact-form-home .card-body {
  padding: var(--space-6) var(--space-5); /* Reduced from default padding */
}

/* Make form title smaller */
.contact-form-home h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
}

/* Reduce form group spacing */
.contact-form-home .form-group {
  margin-bottom: var(--space-4); /* Reduced spacing between fields */
}

/* Make form inputs more compact */
.contact-form-home .form-input,
.contact-form-home .form-textarea {
  padding: var(--space-3) var(--space-4); /* Reduced padding inside inputs */
  font-size: var(--text-sm);
  resize: none !important; /* Remove resize handle from form elements */
}

/* Make textarea smaller */
.contact-form-home .form-textarea {
  rows: 3; /* Will be applied via template */
  min-height: 80px; /* Reduced minimum height */
  resize: none !important; /* Disable resize handle */
  max-height: 120px; /* Prevent excessive expansion */
}

/* Button styling is now handled by global common/css/contact-form.css */

/* Explicitly remove any potential pseudo-elements that might create lines */
.contact-form-home::before,
.contact-form-home::after {
  display: none !important;
  content: none !important;
}

/* Ensure no top border */
.contact-form-home {
  border-top: none !important;
}

/* Disable resize on ALL form elements within contact form */
.contact-form-home input,
.contact-form-home textarea,
.contact-form-home select {
  resize: none !important;
  -webkit-resize: none !important;
  -moz-resize: none !important;
}

/* Home-specific testimonial enhancements - Fixed quotation marks */
.testimonials-home {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  position: relative;
  z-index: 1;
  padding-top: 220px; /* Increased padding for clearance over hero-overlay-image */
}

.testimonials-home .testimonial-card {
  /* Enhanced testimonial cards for homepage */
  transition: all var(--transition-base);
  cursor: pointer;
  position: relative;
  padding: var(--space-8) var(--space-8) var(--space-8) var(--space-12);
}

/* Fixed quotation mark positioning */
.testimonials-home .testimonial-card::before {
  content: '"';
  position: absolute;
  top: var(--space-2);
  left: var(--space-4);
  font-size: var(--text-4xl);
  color: #cbd5e1;
  font-weight: var(--font-bold);
  line-height: 1;
  z-index: 1;
}

.testimonials-home .testimonial-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Security features showcase (home-specific) */
.security-features {
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  padding: var(--space-20) 0;
  position: relative;
}

.security-features::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
}

.security-feature-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  text-align: center;
  transition: all var(--transition-base);
  border: 1px solid #e2e8f0;
}

.security-feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  border-color: #667eea;
}

.security-feature-card h3 {
  word-wrap: break-word;
  hyphens: auto;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: var(--leading-tight);
}

.security-feature-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  color: white;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* Home-specific call-to-action styling - REDESIGNED */
.cta-home {
  /* Much more elegant and less overwhelming */
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: white;
  padding: var(--space-20) 0;
  text-align: center;
  position: relative;
}

.cta-home::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="cta-pattern" width="40" height="40" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1" fill="white" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23cta-pattern)"/></svg>');
  pointer-events: none;
}

.cta-home .container {
  position: relative;
  z-index: 1;
}

.cta-home h2 {
  color: white;
  margin-bottom: var(--space-6);
}

.cta-home p {
  color: #cbd5e1;
  margin-bottom: var(--space-8);
}

.cta-home .btn {
  min-width: 250px;
  font-weight: var(--font-bold);
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.cta-home .btn:hover {
  background: linear-gradient(135deg, #5a67d8, #6b46c1);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.cta-home .btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.6s ease;
}

.cta-home .btn:hover::before {
  left: 100%;
}

/* Responsive adjustments for home */
@media (max-width: 768px) {
  .hero-home {
    padding: var(--space-12) 0;
    text-align: center; /* Center all content on mobile */
  }
  
  /* Override inline grid styles for mobile - single column */
  .hero-home .grid[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  
  /* Center hero text on mobile */
  .hero-home h1,
  .hero-home h2,
  .hero-home p {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    max-width: 90%;
  }
  
  /* Hide overlay image on mobile - better UX practice */
  .hero-overlay-image {
    display: none;
  }
  
  /* Fix testimonials on mobile */
  .testimonials-home {
    padding-top: var(--space-16);
    padding-bottom: var(--space-16);
  }
  
  /* Make testimonials single column on mobile */
  .testimonials-grid {
    display: block !important;
  }
  
  .testimonial-card {
    margin-bottom: var(--space-6);
    width: 100% !important;
  }
  
  .contact-form-home {
    margin-top: var(--space-8);
    margin-right: auto; /* Center the form */
    max-width: 90%; /* Responsive width on mobile */
    margin-left: auto; /* Center the form */
    transform: none; /* Remove transform on mobile */
  }
  
  /* Make security features single column on mobile */
  .security-features .grid {
    display: block !important;
  }
  
  .security-feature-card {
    margin-bottom: var(--space-6);
    max-width: 100%;
  }
  
  .security-features {
    padding: var(--space-12) 0;
  }
  
  .cta-home {
    padding: var(--space-16) 0;
  }
  
  .testimonials-home .testimonial-card::before {
    font-size: var(--text-3xl);
    top: var(--space-1);
  }
  
  .testimonials-home .testimonial-card {
    padding: var(--space-6) var(--space-6) var(--space-6) var(--space-10);
  }

  /* Fix text overflow in security feature cards */
  .security-feature-card h3 {
    font-size: var(--text-lg);
    word-wrap: break-word;
    hyphens: auto;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  
  .security-feature-card p {
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    word-wrap: break-word;
    hyphens: auto;
  }
}

/* Medium screens */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero-home {
    text-align: center; /* Center content on tablets too */
  }
  
  /* Override inline grid styles for tablets - single column */
  .hero-home .grid[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  
  /* Center hero text on tablets */
  .hero-home h1,
  .hero-home h2,
  .hero-home p {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    max-width: 80%;
  }
  
  /* Hide overlay on tablets too */
  .hero-overlay-image {
    display: none;
  }
  
  .testimonials-home {
    padding-top: 80px; /* Reduced since no overlay */
  }
  
  .contact-form-home {
    margin-right: auto; /* Center the form */
    margin-left: auto; /* Center the form */
    max-width: 420px;
    transform: none; /* Remove transform on tablets */
  }
}

/* Small desktop screens - careful positioning */
@media (min-width: 1025px) and (max-width: 1280px) {
  .hero-home {
    text-align: left; /* Left align on desktop */
  }
  
  /* Left align hero text on desktop */
  .hero-home h1,
  .hero-home h2,
  .hero-home p {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
    max-width: 60%; /* Increased from 45% to give text more space */
  }
  
  .contact-form-home {
    max-width: 340px; /* Even smaller form for better fit */
    margin-right: 15px; /* Much closer to edge */
  }
}

/* Medium desktop screens */
@media (min-width: 1281px) and (max-width: 1440px) {
  .hero-home {
    text-align: left;
  }
  
  .hero-home h1,
  .hero-home h2,
  .hero-home p {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
    max-width: 65%; /* Increased from 50% to give text more space */
  }
  
  .contact-form-home {
    max-width: 340px; /* Reduced even more for better fit */
    margin-right: 15px; /* Much closer to edge */
  }
}

/* Large screens */
@media (min-width: 1441px) and (max-width: 1920px) {
  .hero-home {
    text-align: left;
  }
  
  .hero-home h1,
  .hero-home h2,
  .hero-home p {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
    max-width: 65%; /* Increased from 50% to give text more space */
  }
  
  .contact-form-home {
    max-width: 340px; /* Reduced for better fit */
    margin-right: 15px; /* Much closer to edge */
  }
}

/* Ultra wide screens */
@media (min-width: 1921px) {
  .hero-home h1,
  .hero-home h2,
  .hero-home p {
    text-align: left;
    margin-left: 0;
    margin-right: 0;
    /* Removed max-width constraint - let text breathe naturally with 3fr grid space */
  }
  
  .contact-form-home {
    max-width: 340px; /* Reduced for better fit */
    margin-right: 15px; /* Much closer to edge */
  }
}

/* =============================================================================
   HOME-SPECIFIC ANIMATIONS
   ============================================================================= */

/* Staggered animation for security features */
.security-feature-card:nth-child(1) { animation-delay: 0.1s; }
.security-feature-card:nth-child(2) { animation-delay: 0.2s; }
.security-feature-card:nth-child(3) { animation-delay: 0.3s; }

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

/* Enhanced contact form animations */
.contact-form-home .form-group {
  animation: fadeInUp 0.6s ease forwards;
  opacity: 0;
}

.contact-form-home .form-group:nth-child(1) { animation-delay: 0.1s; }
.contact-form-home .form-group:nth-child(2) { animation-delay: 0.2s; }
.contact-form-home .form-group:nth-child(3) { animation-delay: 0.3s; }
.contact-form-home .form-group:nth-child(4) { animation-delay: 0.4s; }
.contact-form-home .btn { animation-delay: 0.5s; }

/* =============================================================================
   HOME-SPECIFIC UTILITIES
   ============================================================================= */

/* Home page specific spacing */
.hero-spacing { margin-bottom: var(--space-20); }
.section-spacing { margin: var(--space-20) 0; }

/* Home page specific text styles */
.hero-title-home {
  /* Simplified approach - just use solid white text to avoid rendering issues */
  color: white !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 100; /* Much higher z-index to ensure it's above all overlays */
  /* Ensure text is always selectable and visible */
  pointer-events: auto;
  /* Remove any background effects that might cause overlap issues */
  background: none !important;
  -webkit-text-fill-color: white !important;
  -webkit-background-clip: unset !important;
  background-clip: unset !important;
}

.testimonial-highlight {
  color: #667eea;
  font-weight: var(--font-semibold);
}

/* Better testimonial text positioning */
.testimonials-home .testimonial-text {
  position: relative;
  z-index: 2;
  font-style: italic;
  margin-bottom: var(--space-6);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-neutral-700);
}

/* =============================================================================
   FORM VALIDATION STYLING
   ============================================================================= */

/* Error message styling */
.field-error-message {
  color: var(--color-error);
  font-size: var(--text-sm);
  margin-top: var(--space-1);
  display: flex;
  align-items: center;
  animation: slideIn 0.3s ease;
}

.field-error-message::before {
  content: '';
  margin-right: 0;
  font-size: var(--text-xs);
}

/* Enhanced form validation states */
.form-input.form-error,
.form-textarea.form-error {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
  animation: shake 0.5s ease-in-out;
}

.form-input.form-success,
.form-textarea.form-success {
  border-color: var(--color-success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-input.form-success::after {
  content: '✓';
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-success);
  font-weight: bold;
  pointer-events: none;
}

/* Form group positioning for validation icons */
.form-group {
  position: relative;
}

/* Animation for validation feedback */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
  20%, 40%, 60%, 80% { transform: translateX(2px); }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =============================================================================
   ENHANCED FORM INTERACTIONS
   ============================================================================= */

/* Phone number input specific styling */
#handynummer {
  font-family: var(--font-family-mono);
  letter-spacing: 0.5px;
}

/* Real-time typing feedback */
.form-input.has-content,
.form-textarea.has-content {
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  border-color: var(--color-primary-300);
}

/* Enhanced focus states */
.form-input:focus,
.form-textarea:focus {
  transform: scale(1.01);
  transition: all 0.2s ease;
}

/* Loading state for submit button */
.btn[type="submit"]:disabled {
  cursor: not-allowed;
  position: relative;
  overflow: hidden;
}

.btn[type="submit"]:disabled::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
} 