/* 
 * D O'BRIEN ELECTRICAL LIMITED - Responsive Stylesheet
 * Mobile-first responsive design
 */

/* Tablet Landscape (1024px and below) */
@media screen and (max-width: 1024px) {
  .container {
    padding: 0 30px;
  }

  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.2rem;
  }

  section {
    padding: 4rem 0;
  }

  .services-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }

  .why-choose-content {
    gap: 3rem;
  }
}

/* Tablet Portrait / Large Mobile (768px and below) */
@media screen and (max-width: 768px) {
  /* Typography adjustments */
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.8rem;
  }

  h3 {
    font-size: 1.3rem;
  }

  /* Section spacing */
  section {
    padding: 3rem 0;
  }

  /* Navigation */
  .nav-links {
    position: fixed;
    top: 78px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 78px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.95) 100%);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 2rem;
    gap: 0.5rem;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    z-index: 999;
  }

  .nav-links.active {
    left: 0;
  }

  .nav-links li {
    width: 100%;
    animation: slideIn 0.3s ease forwards;
    opacity: 0;
  }

  .nav-links.active li:nth-child(1) { animation-delay: 0.1s; }
  .nav-links.active li:nth-child(2) { animation-delay: 0.15s; }
  .nav-links.active li:nth-child(3) { animation-delay: 0.2s; }
  .nav-links.active li:nth-child(4) { animation-delay: 0.25s; }
  .nav-links.active li:nth-child(5) { animation-delay: 0.3s; }

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

  .nav-links a {
    display: block;
    padding: 1.25rem 1.5rem;
    width: 100%;
    border-radius: 12px;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    border: 2px solid transparent;
  }

  .nav-links a:hover {
    background-color: rgba(255, 215, 0, 0.15);
    border-color: rgba(255, 215, 0, 0.3);
    transform: translateX(5px);
  }

  .nav-links a.active {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--dark-gold) 100%);
    color: var(--primary-black);
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    border-color: var(--dark-gold);
  }

  .phone-btn {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

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

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

  /* Hero section */
  .hero {
    min-height: 80vh;
    padding-top: 70px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

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

  .hero-buttons .btn {
    width: 100%;
    justify-content: center;
  }

  .feature-badges {
    gap: 1rem;
  }

  .badge {
    flex: 1;
    min-width: 100px;
  }

  .badge i {
    font-size: 1.5rem;
  }

  .badge span {
    font-size: 0.8rem;
  }

  /* Trust badges */
  .trust-badges-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .trust-badge i {
    font-size: 2rem;
  }

  /* Service cards */
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .card {
    padding: 2rem;
  }

  /* Why choose us */
  .why-choose-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

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

  .icon-box {
    padding: 1.5rem;
  }

  .icon-box i {
    font-size: 2rem;
  }

  /* Service areas */
  .areas-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Reviews */
  .reviews-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .review-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-links {
    flex-direction: column;
    gap: 1rem;
  }

  /* Contact CTA */
  .contact-cta p {
    font-size: 1rem;
  }
}

/* Mobile Landscape (480px and below) */
@media screen and (max-width: 480px) {
  .container {
    padding: 0 15px;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  h3 {
    font-size: 1.2rem;
  }

  section {
    padding: 2.5rem 0;
  }

  /* Logo */
  .logo {
    font-size: 1rem;
  }

  .logo i {
    font-size: 1.5rem;
  }

  /* Buttons */
  .btn {
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
  }

  /* Trust badges */
  .trust-badges {
    padding: 2rem 0;
  }

  .trust-badges-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* Cards */
  .card {
    padding: 1.5rem;
  }

  .card i {
    font-size: 2.5rem;
  }

  /* Icon grid */
  .icon-grid {
    grid-template-columns: 1fr;
  }

  /* Service areas */
  .area-card {
    padding: 1.5rem;
  }

  /* Reviews */
  .review-card {
    padding: 1.5rem;
  }

  /* Footer */
  .footer {
    padding: 3rem 0 1.5rem;
  }
}

/* Mobile Portrait (320px - minimum width) */
@media screen and (max-width: 320px) {
  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  .hero-content {
    padding: 1rem;
  }

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

  .feature-badges {
    flex-direction: column;
  }
}

/* Form Specific Responsive Styles */
@media screen and (max-width: 768px) {
  .contact-form {
    padding: 2rem 1.5rem;
  }

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

  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Gallery Page Responsive */
@media screen and (max-width: 768px) {
  .filter-buttons {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .filter-btn {
    flex: 1 1 calc(50% - 0.5rem);
    min-width: 120px;
  }

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

/* About Page Responsive */
@media screen and (max-width: 768px) {
  .company-story {
    grid-template-columns: 1fr;
  }

  .stats-overlay {
    position: static;
    margin-top: 2rem;
  }

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

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

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

@media screen and (max-width: 480px) {
  .standards-grid {
    grid-template-columns: 1fr;
  }
}

/* Services Pages Responsive */
@media screen and (max-width: 768px) {
  .service-card {
    padding: 2rem;
  }

  .process-timeline {
    padding-left: 1rem;
  }

  .timeline-item::before {
    left: -1rem;
  }

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

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

@media screen and (max-width: 480px) {
  .industries-grid {
    grid-template-columns: 1fr;
  }
}

/* Contact Page Responsive */
@media screen and (max-width: 768px) {
  .contact-methods {
    grid-template-columns: 1fr;
  }

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

  .emergency-banner {
    padding: 1rem;
    font-size: 0.9rem;
  }
}

/* Thank You Page Responsive */
@media screen and (max-width: 768px) {
  .thank-you-content {
    padding: 2rem 1rem;
  }

  .checkmark-icon {
    font-size: 4rem;
  }
}

/* Print Styles */
@media print {
  .header,
  .footer,
  .hamburger,
  .phone-btn,
  .btn,
  .contact-cta {
    display: none;
  }

  body {
    color: #000;
    background: #fff;
  }

  a {
    text-decoration: underline;
  }

  section {
    page-break-inside: avoid;
  }
}

/* High Resolution Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Optimize for retina displays if needed */
  .logo i {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
}

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

/* Dark Mode Support (optional - can be enabled later) */
@media (prefers-color-scheme: dark) {
  /* Dark mode styles can be added here if needed */
  /* Currently not implemented per brand guidelines */
}

/* Landscape Orientation */
@media screen and (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: 100vh;
    padding-top: 70px;
  }

  .nav-links {
    height: calc(100vh - 70px);
    overflow-y: auto;
  }
}

/* Large Desktop (1440px and above) */
@media screen and (min-width: 1440px) {
  .container {
    max-width: 1400px;
  }

  h1 {
    font-size: 4rem;
  }

  h2 {
    font-size: 3rem;
  }

  section {
    padding: 6rem 0;
  }
}

/* Extra Large Desktop (1920px and above) */
@media screen and (min-width: 1920px) {
  .container {
    max-width: 1600px;
  }

  h1 {
    font-size: 4.5rem;
  }

  h2 {
    font-size: 3.5rem;
  }
}
