/* ========================================
   RECHANCE Corporate Site - Responsive Styles
   ======================================== */

/* Tablet (768px and below) */
@media screen and (max-width: 768px) {
  :root {
    --font-size-h1: 36px;
    --font-size-h2: 28px;
    --font-size-h3: 24px;
    --font-size-h4: 20px;
    --section-padding: 60px;
  }

  /* Header */
  .nav-links {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: var(--white);
    flex-direction: column;
    justify-content: flex-start;
    padding: 40px 20px;
    gap: 20px;
    box-shadow: 0 2px 10px var(--shadow);
    transition: left 0.3s ease;
    overflow-y: auto;
  }

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

  .menu-toggle {
    display: flex;
  }

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

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

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

  .nav {
    gap: 15px;
  }

  /* Hero */
  .hero {
    padding: 140px 0 80px;
  }

  .hero-title {
    font-size: 36px;
  }

  .hero-subtitle {
    font-size: 18px;
  }

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

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

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

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

  /* Section Title */
  .section-title h2 {
    font-size: var(--font-size-h2);
  }

  /* Cards */
  .card {
    padding: 25px;
  }

  /* CTA Section */
  .cta-buttons {
    flex-direction: column;
  }

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

  /* Stats */
  .stats {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .stat-number {
    font-size: 40px;
  }

  /* Page Header */
  .page-header {
    padding: 100px 0 50px;
    margin-top: 60px;
  }

  .page-header h1 {
    font-size: var(--font-size-h2);
  }

  /* Buttons */
  .btn-large {
    padding: 16px 32px;
    font-size: var(--font-size-base);
  }

  /* Dropdown Menu */
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    padding: 10px 0 10px 20px;
    display: none;
  }

  .dropdown.active .dropdown-menu {
    display: block;
  }

  /* News Items - Mobile */
  .news-item-meta {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  /* Article Images */
  article img {
    height: auto !important;
    min-height: 200px;
  }

  /* Services Grid - Special Layout */
  div[style*="grid-template-columns: 1fr 2fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  div[style*="grid-template-columns: 1fr 2fr 1fr"] > div:first-child,
  div[style*="grid-template-columns: 1fr 2fr 1fr"] > div:last-child {
    display: none;
  }

  /* Client Carousel */
  .client-logo {
    min-width: 150px;
  }

  /* Tables */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Dify Chatbot Mobile Optimization */
  #dify-chatbot-bubble-window {
    width: calc(100vw - 40px) !important;
    height: calc(100vh - 120px) !important;
    right: 20px !important;
    bottom: 80px !important;
  }

  #dify-chatbot-bubble-button {
    right: 20px !important;
    bottom: 20px !important;
  }
}

/* Mobile (480px and below) */
@media screen and (max-width: 480px) {
  :root {
    --font-size-base: 15px;
    --font-size-h1: 28px;
    --font-size-h2: 24px;
    --font-size-h3: 20px;
    --font-size-h4: 18px;
    --section-padding: 50px;
  }

  .container {
    padding: 0 15px;
  }

  .section {
    padding: var(--section-padding) 0;
  }

  .logo {
    font-size: 24px;
  }

  .hero {
    padding: 120px 0 60px;
  }

  .hero-title {
    font-size: 28px;
    margin-bottom: 20px;
  }

  .hero-subtitle {
    font-size: 16px;
    margin-bottom: 30px;
  }

  .btn {
    padding: 12px 24px;
    font-size: 15px;
  }

  .card {
    padding: 20px;
  }

  .card-icon {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }

  .section-title {
    margin-bottom: 40px;
  }

  .section-title::after {
    width: 50px;
    height: 3px;
  }

  .stat-number {
    font-size: 36px;
  }

  .form-input,
  .form-textarea,
  .form-select {
    padding: 12px 14px;
    font-size: 15px;
  }

  .footer {
    padding: 40px 0 20px;
  }

  .footer-content {
    gap: 25px;
  }

  .footer-links {
    flex-direction: column;
    gap: 10px;
  }

  .page-header {
    padding: 90px 0 40px;
  }

  /* Article Content - Mobile */
  article h1 {
    font-size: 28px !important;
  }

  article h2 {
    font-size: 22px !important;
  }

  article h3 {
    font-size: 18px !important;
  }

  /* Breadcrumb - Mobile */
  .breadcrumb-list {
    flex-wrap: wrap;
  }

  /* News/Media Cards - Mobile Spacing */
  .card-title {
    font-size: 18px !important;
  }

  .card-description {
    font-size: 14px !important;
  }

  /* Dify Chatbot Mobile Optimization */
  #dify-chatbot-bubble-window {
    width: calc(100vw - 20px) !important;
    height: calc(100vh - 100px) !important;
    right: 10px !important;
    bottom: 70px !important;
  }

  #dify-chatbot-bubble-button {
    right: 10px !important;
    bottom: 10px !important;
    width: 50px !important;
    height: 50px !important;
  }

  /* Tags - Mobile */
  .tags {
    flex-wrap: wrap;
  }

  .tag {
    font-size: 12px !important;
    padding: 4px 10px !important;
  }

  /* Hero Buttons - Mobile Full Width */
  .hero-buttons a {
    width: 100%;
    text-align: center;
  }

  /* Footer - Mobile Text Size */
  .footer h3 {
    font-size: 16px;
  }

  .footer-nav a {
    font-size: 14px;
  }
}

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

/* Print Styles */
@media print {
  .header,
  .footer,
  .cta-section,
  .btn,
  .menu-toggle {
    display: none;
  }

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

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

  a {
    text-decoration: underline;
  }
}
