/*=========================================================
  SentMailTracker - Responsive Enhancements & Mobile Menu
  Complete responsive layer for all pages
=========================================================*/

/* ====== MOBILE NAVIGATION (Hamburger Menu) ====== */
.hamburger-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s ease;
  z-index: 200;
  position: relative;
}

.hamburger-toggle:hover {
  background: var(--light-gray, #f1f3f4);
}

.hamburger-toggle .bar {
  width: 22px;
  height: 2.5px;
  background: var(--charcoal, #202124);
  border-radius: 3px;
  transition: all 0.3s ease;
  display: block;
}

.hamburger-toggle .bar + .bar {
  margin-top: 5px;
}

/* Hamburger open state */
.hamburger-toggle.active .bar:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

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

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

/* Mobile overlay */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 98;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-overlay.active {
  opacity: 1;
}

/* Mobile nav menu */
.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 85%;
  max-width: 360px;
  height: 100vh;
  background: var(--pure-white, #ffffff);
  z-index: 199;
  padding: 6rem 2rem 2rem;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav.active {
  right: 0;
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-gray, #e5e7eb);
}

.mobile-nav-links {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
}

.mobile-nav-links li {
  margin-bottom: 4px;
}

.mobile-nav-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--charcoal, #202124);
  text-decoration: none;
  transition: all 0.2s ease;
}

.mobile-nav-links a:hover,
.mobile-nav-links a:active {
  background: var(--light-gray, #f1f3f4);
}

.mobile-nav-links a.active {
  background: linear-gradient(135deg, rgba(26, 115, 232, 0.1), rgba(0, 191, 165, 0.08));
  color: var(--primary-blue, #1A73E8);
  font-weight: 600;
}

.mobile-nav-links a .link-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--graphite-gray, #5F6368);
}

.mobile-nav-links a.active .link-icon {
  color: var(--primary-blue, #1A73E8);
}

.mobile-nav-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-gray, #e5e7eb);
}

.mobile-nav-actions .btn {
  width: 100%;
  text-align: center;
  justify-content: center;
  padding: 14px;
  font-size: 1rem;
}

/* ====== MOBILE-FIRST RESPONSIVE BREAKPOINTS ====== */

/* Extra small devices (phones, < 576px) */
@media (max-width: 575px) {
  .container {
    padding: 0 16px;
  }

  .hero {
    padding: 4rem 0 2.5rem;
  }

  .hero-title {
    font-size: 1.75rem !important;
    line-height: 1.25;
  }

  .hero-description {
    font-size: 0.95rem !important;
  }

  .section-title {
    font-size: 1.5rem !important;
  }

  .section-description {
    font-size: 0.9rem !important;
  }

  .pricing-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  .pricing-card {
    padding: 1.5rem !important;
  }

  .plan-price .price-amount {
    font-size: 2.5rem !important;
  }

  .features-grid-about {
    grid-template-columns: 1fr !important;
  }

  .feature-card-large {
    flex-direction: column !important;
    padding: 1.5rem !important;
  }

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

  .comparison-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .comparison-table table {
    min-width: 600px;
  }

  .btn-large {
    padding: 0.875rem 1.5rem !important;
    font-size: 1rem !important;
  }

  .cta-content h2 {
    font-size: 1.5rem !important;
  }

  .cta-content p {
    font-size: 0.95rem !important;
  }

  .about-hero-title {
    font-size: 1.75rem !important;
  }

  .about-stats {
    flex-direction: column;
    gap: 0.75rem;
  }

  .blog-hero-title {
    font-size: 1.75rem !important;
  }

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

  .featured-post {
    flex-direction: column !important;
  }

  .featured-post-image {
    min-height: 200px !important;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }

  .footer-content {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }

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

  .newsletter-input-group {
    flex-direction: column !important;
  }

  .newsletter-input {
    border-radius: 30px !important;
    margin-bottom: 0.5rem;
  }

  .pricing-header-compact .pricing-title {
    font-size: 1.75rem !important;
  }

  .blog-search .search-container {
    flex-direction: column !important;
  }

  .dashboard-title h1 {
    font-size: 1.5rem !important;
  }

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

  .stat-card {
    padding: 1.25rem !important;
  }

  .stat-content h3 {
    font-size: 1.5rem !important;
  }

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

  .contact-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .contact-row-desktop {
    grid-template-columns: 1fr !important;
  }

  .contact-row-pricing {
    grid-template-columns: 1fr !important;
  }

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

  .growth-feature-prompt [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

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

  .mission-values .value-item {
    flex-direction: column !important;
    text-align: center;
  }

  .value-icon {
    margin: 0 auto 1rem;
  }

  .featured-post-content {
    padding: 1.5rem !important;
  }

  .post-card .post-content {
    padding: 1.25rem !important;
  }

  .newsletter-content {
    padding: 2rem 1.25rem !important;
  }

  .final-cta-content {
    padding: 2.5rem 1.25rem !important;
  }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767px) {
  .container {
    padding: 0 20px;
  }

  .hero-title {
    font-size: 2.25rem !important;
  }

  .section-title {
    font-size: 1.75rem !important;
  }

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

  .features-grid-about {
    grid-template-columns: 1fr !important;
  }

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

  .about-stats {
    gap: 1.5rem;
  }

  .categories-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .footer-content {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .contact-row-desktop {
    grid-template-columns: 1fr !important;
  }

  .contact-row-pricing {
    grid-template-columns: 1fr !important;
  }

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

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

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991px) {
  .container {
    padding: 0 24px;
  }

  .pricing-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.25rem;
  }

  .features-grid-about {
    grid-template-columns: 1fr !important;
  }

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

  .categories-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .footer-content {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  .contact-row-desktop {
    grid-template-columns: 1fr 1fr !important;
  }

  .contact-row-pricing {
    grid-template-columns: 1fr !important;
  }

  .about-hero-content {
    flex-direction: column !important;
  }

  .featured-post {
    flex-direction: column !important;
  }

  .featured-post-image {
    min-height: 250px !important;
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199px) {
  .container {
    padding: 0 32px;
  }

  .pricing-grid {
    gap: 1.25rem;
  }

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

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  .container {
    padding: 0 40px;
  }
}

/* ====== LAYOUT & SPACING IMPROVEMENTS ====== */

/* Improved card hover effects */
.pricing-card,
.feature-card-large,
.stat-card,
.post-card,
.contact-card {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Better touch targets for mobile */
@media (max-width: 768px) {
  .nav-link,
  .footer-link,
  .social-link,
  .btn,
  .faq-question,
  .category-card {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .btn {
    padding: 12px 24px;
  }

  select,
  input[type="text"],
  input[type="email"],
  input[type="search"] {
    font-size: 16px !important; /* Prevents iOS zoom */
  }
}

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

/* Better focus styles for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--primary-blue, #1A73E8);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Selection color */
::selection {
  background: var(--primary-blue, #1A73E8);
  color: white;
}

/* ====== RESPONSIVE TABLES ====== */
@media (max-width: 768px) {
  .comparison-table {
    position: relative;
  }

  .comparison-table::after {
    content: '→ Scroll horizontally';
    display: block;
    text-align: center;
    padding: 8px;
    font-size: 0.8rem;
    color: var(--graphite-gray, #5F6368);
    background: var(--light-gray, #f1f3f4);
    border-radius: 0 0 12px 12px;
  }

  .comparison-table th,
  .comparison-table td {
    white-space: nowrap;
    padding: 0.75rem 0.5rem !important;
    font-size: 0.8rem !important;
  }
}

/* ====== RESPONSIVE IMAGES ====== */
img {
  max-width: 100%;
  height: auto;
}

/* ====== PRINT STYLES ====== */
@media print {
  .header,
  .footer,
  .nav-actions,
  .cta-section,
  .final-cta,
  .newsletter-section,
  .mobile-nav,
  .mobile-overlay,
  .hamburger-toggle {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }

  a {
    color: #000 !important;
    text-decoration: underline;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  @page {
    margin: 2cm;
  }
}

/* ====== REDUCED MOTION ====== */
@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;
  }
}
