/* ========================================
   RESPONSIVE.CSS - Media Queries
   Johan Bruno - Expert Automatisation & No-Code
   ======================================== */

/* ----------------------------------------
   Breakpoints:
   - Mobile: < 640px
   - Tablet: 640px - 1023px
   - Desktop: 1024px - 1279px
   - Large Desktop: 1280px+
   ---------------------------------------- */

/* ----------------------------------------
   Large Desktop (1280px+)
   ---------------------------------------- */
@media (min-width: 1280px) {
  .container {
    padding: 0 var(--space-6);
  }

  .hero-title {
    font-size: var(--text-7xl);
  }

  .grid-xl-5 {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ----------------------------------------
   Desktop (1024px - 1279px)
   ---------------------------------------- */
@media (max-width: 1279px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }

  .footer-grid .footer-col:last-child {
    grid-column: 1 / -1;
    margin-top: var(--space-4);
  }
}

/* ----------------------------------------
   Tablet & Below (< 1024px)
   ---------------------------------------- */
@media (max-width: 1023px) {
  /* Typography scaling */
  h1 { font-size: var(--text-4xl); }
  h2 { font-size: var(--text-3xl); }
  h3 { font-size: var(--text-2xl); }

  /* Hide elements on tablet and below */
  .hidden-mobile {
    display: none !important;
  }

  /* Navigation */
  .nav {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  /* Mobile Navigation */
  .mobile-nav {
    display: block;
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--white);
    padding: var(--space-6);
    transform: translateX(100%);
    transition: transform var(--transition-base);
    overflow-y: auto;
    z-index: var(--z-fixed);
  }

  .mobile-nav.active {
    transform: translateX(0);
  }

  .mobile-nav-link {
    display: block;
    padding: var(--space-4);
    font-size: var(--text-lg);
    font-weight: var(--font-medium);
    color: var(--dark);
    border-bottom: 1px solid var(--light-200);
  }

  .mobile-nav-link:hover {
    color: var(--primary);
  }

  .mobile-nav-dropdown {
    padding-left: var(--space-4);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: var(--light);
  }

  .mobile-nav-dropdown.active {
    max-height: 500px;
  }

  .mobile-nav-dropdown-item {
    display: block;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    color: var(--gray);
  }

  .mobile-nav-dropdown-item:hover {
    color: var(--primary);
    background: var(--light-100);
  }

  .mobile-nav-dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .mobile-nav-dropdown-toggle::after {
    content: '+';
    font-size: var(--text-xl);
    transition: transform 0.3s ease;
  }

  .mobile-nav-dropdown-toggle.active::after {
    content: '-';
  }

  .mobile-nav .btn {
    width: 100%;
    margin-top: var(--space-6);
  }

  /* Hero */
  .hero {
    padding: 120px 0 var(--space-16);
  }

  .hero-with-image {
    padding: 120px 0 var(--space-12);
  }

  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
    text-align: center;
  }

  .hero-with-image .hero-content {
    max-width: 100%;
  }

  .hero-title {
    font-size: var(--text-4xl);
  }

  .hero-subtitle {
    font-size: var(--text-lg);
  }

  .hero-image {
    order: -1;
    margin-bottom: var(--space-6);
  }

  .hero-portrait {
    max-width: 300px;
    margin: 0 auto;
  }

  .hero-actions {
    justify-content: center;
  }

  /* Grid adjustments */
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

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

  /* Two columns layout */
  .two-cols {
    grid-template-columns: 1fr;
    gap: var(--space-12);
  }

  .two-cols-reverse {
    direction: ltr;
  }

  /* Sidebar layout */
  .with-sidebar {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  /* Section */
  .section {
    padding: var(--space-16) 0;
  }

  .section-header {
    margin-bottom: var(--space-12);
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  .footer-brand {
    grid-column: 1 / -1;
    max-width: none;
    text-align: center;
    margin-bottom: var(--space-4);
  }

  .footer-social {
    justify-content: center;
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }

  /* Page header */
  .page-header {
    padding: 120px 0 var(--space-12);
  }

  .page-header-title {
    font-size: var(--text-4xl);
  }

  /* CTA Section */
  .cta-section {
    margin: var(--space-4);
    padding: var(--space-12) var(--space-6);
    border-radius: var(--radius-2xl);
  }
}

/* ----------------------------------------
   Mobile (< 768px)
   ---------------------------------------- */
@media (max-width: 767px) {
  /* Base */
  html {
    font-size: 15px;
  }

  .container {
    padding: 0 var(--space-4);
  }

  /* Header */
  .header-inner {
    height: 70px;
  }

  .header-actions .btn {
    display: none;
  }

  .header-actions .btn-sm {
    display: inline-flex;
  }

  /* Hero */
  .hero {
    padding: 100px 0 var(--space-12);
  }

  .hero-with-image {
    padding: 100px 0 var(--space-8);
  }

  .hero-title {
    font-size: var(--text-3xl);
  }

  .hero-subtitle {
    font-size: var(--text-base);
  }

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

  .hero-actions .btn {
    width: 100%;
  }

  .hero-portrait {
    max-width: 250px;
  }

  /* Grid to single column */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  /* Cards */
  .card-body {
    padding: var(--space-5);
  }

  .service-card {
    padding: var(--space-6);
  }

  /* Stats */
  .stat-number {
    font-size: var(--text-4xl);
  }

  /* Footer */
  .footer {
    padding: var(--space-12) 0 var(--space-6);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-col {
    margin-bottom: var(--space-6);
  }

  .footer-links {
    align-items: center;
  }

  /* Page header */
  .page-header-title {
    font-size: var(--text-3xl);
  }

  /* Testimonial */
  .testimonial {
    padding: var(--space-6);
  }

  .testimonial-quote {
    font-size: var(--text-base);
  }

  /* Accordion */
  .accordion-header {
    padding: var(--space-4);
    font-size: var(--text-base);
  }

  .accordion-body {
    padding: 0 var(--space-4) var(--space-4);
  }

  /* Forms */
  .form-input,
  .form-textarea,
  .form-select {
    padding: var(--space-3);
  }

  /* Buttons */
  .btn {
    padding: var(--space-3) var(--space-5);
  }

  .btn-lg {
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
  }

  /* Mobile utilities */
  .hidden-mobile {
    display: none !important;
  }

  .text-center-mobile {
    text-align: center !important;
  }

  .stack-mobile {
    flex-direction: column !important;
  }

  /* Article content enhanced - mobile adjustments */
  .article-content-enhanced ul,
  .article-content-enhanced ol {
    padding-left: var(--space-6);
  }

  .article-content-enhanced table {
    font-size: var(--text-sm);
  }

  .article-content-enhanced th,
  .article-content-enhanced td {
    padding: var(--space-2) var(--space-3);
  }
}

/* ----------------------------------------
   Small Mobile (< 480px)
   ---------------------------------------- */
@media (max-width: 479px) {
  html {
    font-size: 14px;
  }

  .container {
    padding: 0 var(--space-3);
  }

  /* Typography */
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }

  .hero-title {
    font-size: var(--text-2xl);
  }

  .lead {
    font-size: var(--text-base);
  }

  /* Section */
  .section {
    padding: var(--space-12) 0;
  }

  .section-title {
    font-size: var(--text-2xl);
  }

  /* Badges */
  .badge {
    font-size: 10px;
    padding: var(--space-1) var(--space-2);
  }

  /* Avatar sizes */
  .avatar-xl {
    width: 64px;
    height: 64px;
  }

  /* Cards */
  .tool-card {
    flex-direction: column;
    text-align: center;
  }

  /* Footer */
  .footer-bottom-links {
    flex-direction: column;
    gap: var(--space-2);
  }
}

/* ----------------------------------------
   Tablet Only (640px - 1023px)
   ---------------------------------------- */
@media (min-width: 640px) and (max-width: 1023px) {
  .grid-tablet-2 {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .hidden-tablet {
    display: none !important;
  }
}

/* ----------------------------------------
   Desktop Only (1024px+)
   ---------------------------------------- */
@media (min-width: 1024px) {
  .hidden-desktop {
    display: none !important;
  }

  .mobile-nav {
    display: none !important;
  }
}

/* ----------------------------------------
   Print Styles
   ---------------------------------------- */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  thead {
    display: table-header-group;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  img {
    max-width: 100% !important;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }

  .header,
  .footer,
  .nav,
  .btn,
  .mobile-nav {
    display: none !important;
  }

  .container {
    max-width: 100% !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }
}

/* ----------------------------------------
   Landscape Orientation
   ---------------------------------------- */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    padding: 100px 0 var(--space-8);
    min-height: auto;
  }

  .hero-title {
    font-size: var(--text-3xl);
  }
}

/* ----------------------------------------
   Service & Tool Page Responsive (< 1024px)
   ---------------------------------------- */
@media (max-width: 1023px) {
  .service-hero,
  .tool-hero {
    padding: 120px 0 var(--space-12);
  }

  .service-hero-title,
  .tool-hero-title {
    font-size: var(--text-4xl);
  }

  .service-hero-subtitle,
  .tool-hero-subtitle {
    font-size: var(--text-lg);
  }

  .service-hero-image,
  .tool-hero-image,
  .service-hero .col.hidden-mobile,
  .tool-hero .col.hidden-mobile {
    display: none;
  }

  /* Hide image columns in hero sections */
  .hidden-tablet {
    display: none !important;
  }

  .process-timeline {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
  }

  .process-timeline::before {
    display: none;
  }

  .pricing-card.featured {
    transform: none;
  }

  .use-case-card {
    flex-direction: column;
  }

  .use-case-icon {
    width: 48px;
    height: 48px;
  }
}

/* ----------------------------------------
   Service & Tool Page Responsive Mobile (< 768px)
   ---------------------------------------- */
@media (max-width: 767px) {
  .service-hero,
  .tool-hero {
    padding: 100px 0 var(--space-8);
  }

  .service-hero-title,
  .tool-hero-title {
    font-size: var(--text-3xl);
  }

  .service-hero-subtitle,
  .tool-hero-subtitle {
    font-size: var(--text-base);
  }

  .service-hero-actions,
  .tool-hero-actions {
    flex-direction: column;
  }

  .service-hero-actions .btn,
  .tool-hero-actions .btn {
    width: 100%;
  }

  .service-hero-stats {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }

  .service-hero-stats .stat-item {
    text-align: center;
  }

  .process-timeline {
    grid-template-columns: 1fr;
  }

  .process-step {
    padding: var(--space-4);
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
  }

  .process-number {
    width: 48px;
    height: 48px;
    font-size: var(--text-xl);
  }

  .pricing-card {
    padding: var(--space-6);
  }

  .price-amount {
    font-size: var(--text-3xl);
  }

  .cta-actions {
    flex-direction: column;
  }

  .cta-actions .btn {
    width: 100%;
  }

  .cta-title {
    font-size: var(--text-2xl);
  }

  .cta-text {
    font-size: var(--text-base);
  }

  .use-case-card {
    padding: var(--space-4);
  }

  .icon-box-lg {
    width: 48px;
    height: 48px;
  }

  .article-toc {
    padding: var(--space-4);
  }

  .article-author {
    flex-direction: column;
    text-align: center;
  }

  .article-excerpt {
    font-size: var(--text-lg);
  }

  .article-header {
    padding: 100px 0 var(--space-8);
  }

  .article-header h1 {
    font-size: var(--text-3xl);
  }
}

/* ----------------------------------------
   High Resolution Screens
   ---------------------------------------- */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Use higher resolution images where needed */
}

/* ----------------------------------------
   Dark Mode Support (future)
   ---------------------------------------- */
@media (prefers-color-scheme: dark) {
  /*
  :root {
    --dark: #F9FAFB;
    --light: #1F2937;
    --white: #111827;
    --gray: #9CA3AF;
    ... etc
  }
  */
}

/* ----------------------------------------
   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;
  }

  .animate-float,
  .animate-pulse,
  .animate-bounce,
  .animate-spin {
    animation: none !important;
  }
}
