/*
 * MAC Locações - Responsive Styles
 * Mobile First Approach
 */

/* ===========================
   HERO SECTION
   =========================== */
.hero {
  position: relative;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  background-image: url('../assets/images/hero-bg.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  margin-top: 72px;
  padding: 2rem 0;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.9) 0%, rgba(30, 58, 138, 0.95) 100%);
  z-index: 1;
}

.hero .container {
  position: relative;
  z-index: 2;
}

.hero-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.hero-title {
  color: white;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.125rem;
  margin-bottom: 2rem;
  line-height: 1.6;
}

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

/* ===========================
   SERVICES SECTION
   =========================== */
.services {
  padding: 4rem 0;
  background-color: var(--color-light);
}

/* ===========================
   CTA SECTION
   =========================== */
.cta {
  padding: 4rem 0;
  text-align: center;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

.cta-content {
  max-width: 700px;
  margin: 0 auto;
}

.cta-title {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.cta-subtitle {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  opacity: 0.95;
}

/* ===========================
   BACK TO TOP BUTTON
   =========================== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background-color: var(--color-secondary);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base) ease;
  z-index: var(--z-fixed);
}

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

.back-to-top:hover {
  background-color: var(--color-secondary-dark);
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

/* ===========================
   TABLET (640px+)
   =========================== */
@media (min-width: 640px) {
  /* Typography */
  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.25rem;
  }

  /* Cards */
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Sections */
  section {
    padding: 4rem 0;
  }

  .services {
    padding: 5rem 0;
  }

  .cta {
    padding: 5rem 0;
  }

  /* Hero */
  .hero {
    min-height: 500px;
  }

  .hero-content {
    padding: 3rem 1.5rem;
  }
}

/* ===========================
   TABLET LARGE (768px+)
   =========================== */
@media (min-width: 768px) {
  /* Container */
  .container {
    padding: 0 2rem;
  }

  /* Typography */
  h1 {
    font-size: 3rem;
  }

  h2 {
    font-size: 2.5rem;
  }

  h3 {
    font-size: 2rem;
  }

  .hero-title {
    font-size: 3rem;
  }

  .cta-title {
    font-size: 2.5rem;
  }

  /* Hero */
  .hero {
    min-height: 550px;
  }

  /* Back to top */
  .back-to-top {
    bottom: 2.5rem;
    right: 2.5rem;
  }
}

/* ===========================
   DESKTOP (1024px+)
   =========================== */
@media (min-width: 1024px) {
  /* Typography */
  .hero-title {
    font-size: 3.5rem;
  }

  .hero-subtitle {
    font-size: 1.5rem;
  }

  /* Cards */
  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Hero */
  .hero {
    min-height: 600px;
  }

  .hero-content {
    padding: 4rem 2rem;
  }

  /* Sections */
  .services {
    padding: 6rem 0;
  }

  .cta {
    padding: 6rem 0;
  }

  /* Hover effects (only on desktop) */
  .card:hover {
    transform: translateY(-8px);
  }

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

/* ===========================
   LARGE DESKTOP (1280px+)
   =========================== */
@media (min-width: 1280px) {
  /* Container */
  .container {
    max-width: 1280px;
  }

  /* Typography */
  .hero-title {
    font-size: 4rem;
  }

  /* Cards - 4 columns for service cards */
  .services .card-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Hero */
  .hero {
    min-height: 650px;
  }
}

/* ===========================
   EXTRA LARGE (1536px+)
   =========================== */
@media (min-width: 1536px) {
  .container {
    max-width: 1400px;
  }

  .hero-title {
    font-size: 4.5rem;
  }
}

/* ===========================
   SMALL MOBILE (max 480px)
   =========================== */
@media (max-width: 480px) {
  .hero-title {
    font-size: 1.75rem;
  }

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

  .hero-buttons {
    flex-direction: column;
  }

  .btn-lg {
    width: 100%;
  }

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

  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 45px;
    height: 45px;
    font-size: 1.25rem;
  }

  section {
    padding: 2.5rem 0;
  }

  .services {
    padding: 3rem 0;
  }

  .cta {
    padding: 3rem 0;
  }

  .cta-title {
    font-size: 1.5rem;
  }

  .cta-subtitle {
    font-size: 1rem;
  }
}

/* ===========================
   LANDSCAPE MOBILE
   =========================== */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: 400px;
  }

  .hero-content {
    padding: 1.5rem 1rem;
  }

  .hero-title {
    font-size: 2rem;
    margin-bottom: 1rem;
  }

  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 1rem;
  }
}

/* ===========================
   PRINT STYLES
   =========================== */
@media print {
  /* Hide non-essential elements */
  .header,
  .nav-mobile,
  .mobile-menu-toggle,
  .footer-social,
  .back-to-top,
  .btn,
  .hero-buttons {
    display: none !important;
  }

  /* Reset colors for print */
  body {
    background: white;
    color: black;
  }

  .hero {
    background: none;
    margin-top: 0;
    min-height: auto;
    padding: 2rem 0;
  }

  .hero-overlay {
    display: none;
  }

  .hero-title,
  .hero-subtitle {
    color: black;
  }

  /* Optimize spacing */
  section {
    padding: 1rem 0;
  }

  .footer {
    margin-top: 2rem;
    padding: 1rem 0;
    background: white;
    color: black;
    border-top: 2px solid black;
  }

  .footer-title {
    color: black;
  }

  .footer-text,
  .footer-links a,
  .footer-contact li {
    color: black;
  }

  /* Page breaks */
  h2,
  h3 {
    page-break-after: avoid;
  }

  img {
    max-width: 100% !important;
    page-break-inside: avoid;
  }

  .card {
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ===========================
   DARK MODE (Optional)
   =========================== */
@media (prefers-color-scheme: dark) {
  /* Implementar se necessário */
}

/* ===========================
   REDUCED MOTION
   =========================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ===========================
   HIGH CONTRAST MODE
   =========================== */
@media (prefers-contrast: high) {
  .btn {
    border-width: 3px;
  }

  .nav-link.active {
    outline: 2px solid white;
  }

  .card {
    border: 2px solid var(--color-dark);
  }
}

/* ===========================
   MOBILE OPTIMIZATIONS (max 640px)
   =========================== */
@media (max-width: 640px) {
  /* Blog Post CTA Section */
  section[style*="background: linear-gradient(135deg, #1e3a8a"] h2 {
    font-size: 1.75rem !important;
  }

  section[style*="background: linear-gradient(135deg, #1e3a8a"] p {
    font-size: 1rem !important;
  }

  section[style*="background: linear-gradient(135deg, #1e3a8a"] a {
    flex-direction: column;
    padding: 1rem 1.5rem !important;
    font-size: 1rem !important;
  }

  section[style*="background: linear-gradient(135deg, #1e3a8a"] > div > div[style*="width: 80px"] {
    width: 60px !important;
    height: 60px !important;
  }

  section[style*="background: linear-gradient(135deg, #1e3a8a"] > div > div[style*="width: 80px"] svg {
    width: 30px !important;
    height: 30px !important;
  }

  /* Equipment Cards */
  .mac-equip-card-new {
    margin-bottom: 1rem;
  }

  /* Blog Cards */
  .mac-blog-card {
    margin-bottom: 1.5rem;
  }

  .mac-blog-card-image {
    height: 200px !important;
  }

  /* Admin Panel */
  .admin-form-row {
    grid-template-columns: 1fr !important;
  }

  .admin-stats {
    grid-template-columns: 1fr !important;
  }

  /* Footer Social Icons */
  .mac-social-links {
    justify-content: center;
  }

  /* Ensure text is readable */
  body {
    font-size: 16px;
  }

  /* Adjust padding for mobile */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ===========================
   TABLET OPTIMIZATIONS (641px - 1023px)
   =========================== */
@media (min-width: 641px) and (max-width: 1023px) {
  /* Equipment grid - 2 columns on tablet */
  .mac-equip-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Blog grid - 2 columns on tablet */
  .mac-blog-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Admin table - horizontal scroll */
  .admin-posts-table {
    overflow-x: auto;
  }
}
