/* LeafMate Tools - Mobile Responsive CSS */

/* Mobile First Approach - Base styles for mobile devices */

/* Extra Small Devices (phones, 480px and down) */
@media only screen and (max-width: 480px) {
  
  /* Container */
  .container {
    padding: 0 0.75rem;
  }
  
  /* Header */
  .header {
    padding: 0.5rem 0;
  }
  
  .nav-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .logo {
    height: 40px;
  }
  
  .nav-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
  }
  
  .nav-menu.active {
    display: flex;
  }
  
  .nav-link {
    padding: 12px 16px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 0.5rem;
  }
  
  .mobile-menu-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
  }
  
  /* Hero Section */
  .hero {
    min-height: 80vh;
    padding: 2rem 0;
  }
  
  .hero-content {
    padding-top: 100px;
    text-align: center;
  }
  
  .hero-title {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 1rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .hero-buttons {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }
  
  .glass-button,
  .glass-button-secondary {
    width: 100%;
    max-width: 280px;
    text-align: center;
    padding: 14px 20px;
  }
  
  /* Sections */
  .section {
    padding: 40px 0;
  }
  
  .section-title {
    font-size: 1.75rem;
    margin-bottom: 1rem;
  }
  
  .section-subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
  }
  
  /* Service Cards */
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .service-card {
    padding: 1.5rem;
  }
  
  .service-icon {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }
  
  .service-title {
    font-size: 1.25rem;
  }
  
  /* Contact Form */
  .contact-form {
    padding: 2rem 1.5rem;
    margin: 1rem 0;
  }
  
  .form-input,
  .form-textarea {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 14px 16px;
  }
  
  .form-textarea {
    min-height: 100px;
  }
  
  .checkbox-label {
    font-size: 0.85rem;
  }
  
  /* Gallery */
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .gallery-image {
    height: 200px;
  }
  
  .gallery-content {
    padding: 1rem;
  }
  
  /* Footer */
  .footer {
    padding: 2rem 0 1rem;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    text-align: center;
  }
  
  .social-icons {
    justify-content: center;
  }
  
  /* About Page */
  .about-content {
    flex-direction: column;
    gap: 2rem;
  }
  
  .about-text,
  .about-image {
    width: 100%;
  }
  
  /* Contact Page */
  .contact-info {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
  }
  
  .contact-card {
    padding: 1.5rem;
  }
  
  /* Breadcrumbs */
  .breadcrumbs {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
}

/* Small Devices (tablets, 768px and down) */
@media only screen and (max-width: 768px) {
  
  .container {
    padding: 0 1rem;
  }
  
  /* Header */
  .nav-container {
    flex-wrap: wrap;
  }
  
  .nav-menu {
    order: 3;
    flex-basis: 100%;
    margin-top: 1rem;
  }
  
  .mobile-menu-toggle {
    display: block;
    order: 2;
  }
  
  /* Hero */
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.1rem;
  }
  
  /* Services Grid */
  .services-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
  }
  
  /* Contact Layout */
  .contact-layout {
    flex-direction: column;
    gap: 3rem;
  }
  
  .contact-info,
  .contact-form-container {
    width: 100%;
  }
  
  /* Gallery */
  .gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

/* Medium Devices (small laptops, 992px and down) */
@media only screen and (max-width: 992px) {
  
  .hero-title {
    font-size: 3rem;
  }
  
  .services-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
  
  .contact-layout {
    flex-direction: column;
  }
  
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Large Devices (desktops, 1200px and down) */
@media only screen and (max-width: 1200px) {
  
  .container {
    max-width: 1000px;
  }
  
  .hero-title {
    font-size: 3.25rem;
  }
  
  .services-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  
  /* Increase touch targets */
  .nav-link {
    padding: 12px 20px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .glass-button,
  .glass-button-secondary {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .form-input,
  .form-textarea {
    min-height: 48px;
  }
  
  .social-icon {
    width: 48px;
    height: 48px;
  }
  
  /* Remove hover effects on touch devices */
  .service-card:hover,
  .gallery-item:hover,
  .glass-card:hover {
    transform: none;
  }
  
  .nav-link:hover {
    background: rgba(22, 163, 74, 0.1);
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  
  :root {
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-light: #9ca3af;
  }
  
  body {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: var(--text-primary);
  }
  
  .glass-nav {
    background: rgba(31, 41, 55, 0.95);
  }
  
  .form-input {
    background: rgba(31, 41, 55, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
  }
  
  .form-input:focus {
    background: rgba(31, 41, 55, 0.5);
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .float-animation {
    animation: none;
  }
  
  .spinner {
    animation: none;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  
  .glass,
  .glass-card,
  .glass-nav {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #000;
  }
  
  .glass-button {
    background: #000;
    color: #fff;
    border: 2px solid #000;
  }
  
  .nav-link:hover,
  .nav-link.active {
    background: #000;
    color: #fff;
  }
}

/* Print Styles */
@media print {
  
  .header,
  .footer,
  .contact-form,
  .glass-button,
  .glass-button-secondary {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .glass,
  .glass-card {
    background: white !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
  }
  
  .section {
    padding: 20px 0;
  }
  
  .hero {
    min-height: auto;
    padding: 20px 0;
  }
  
  .hero-title {
    font-size: 2rem;
    color: black !important;
  }
}

/* Landscape Orientation for Mobile */
@media only screen and (max-width: 768px) and (orientation: landscape) {
  
  .hero {
    min-height: 60vh;
  }
  
  .hero-content {
    padding-top: 80px;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .section {
    padding: 30px 0;
  }
}

/* Very Small Devices (320px and below) */
@media only screen and (max-width: 320px) {
  
  .container {
    padding: 0 0.5rem;
  }
  
  .hero-title {
    font-size: 1.75rem;
  }
  
  .service-card {
    padding: 1rem;
  }
  
  .contact-form {
    padding: 1.5rem 1rem;
  }
  
  .gallery-content {
    padding: 0.75rem;
  }
  
  .footer {
    padding: 1.5rem 0 1rem;
  }
}

/* Mobile Menu JavaScript Support */
.mobile-menu-toggle {
  display: none;
}

@media only screen and (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }
  
  .nav-menu {
    display: none;
  }
  
  .nav-menu.show {
    display: flex;
  }
}

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

/* Focus Styles for Better Accessibility */
.nav-link:focus,
.glass-button:focus,
.glass-button-secondary:focus,
.form-input:focus,
.social-icon:focus {
  outline: 2px solid var(--primary-green);
  outline-offset: 2px;
}

/* Skip to Content Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-green);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 4px;
  z-index: 9999;
}

.skip-link:focus {
  top: 6px;
}

/* Loading States for Mobile */
.mobile-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  flex-direction: column;
  gap: 1rem;
}

/* Mobile Form Improvements */
@media only screen and (max-width: 768px) {
  
  .form-group {
    margin-bottom: 1.25rem;
  }
  
  .form-label {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
  }
  
  .form-checkbox {
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .form-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 0.125rem;
  }
}

/* Enhanced Touch Feedback */
@media (hover: none) and (pointer: coarse) {
  
  .glass-button:active,
  .glass-button-secondary:active {
    transform: scale(0.98);
  }
  
  .nav-link:active {
    background: rgba(22, 163, 74, 0.2);
  }
  
  .service-card:active,
  .gallery-item:active {
    transform: scale(0.98);
  }
}