/**
 * JapanTravel Mega Menu - React Styles
 * Matches the React prototype exactly
 */

/* =====================================================
   BASE STYLES
   ===================================================== */

.jtmm-react {
  font-family: 'Noto Sans TC', 'PingFang TC', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px !important;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Reset all headings inside mega menu */
.jtmm-react h1,
.jtmm-react h2,
.jtmm-react h3,
.jtmm-react h4,
.jtmm-react h5,
.jtmm-react h6 {
  font-size: inherit !important;
  font-weight: inherit !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: inherit !important;
}

.jtmm-react * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.jtmm-react a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

.jtmm-react a:hover {
  color: var(--region-color, #E53935);
}

/* =====================================================
   DESKTOP MENU BAR
   ===================================================== */

.jtmm-desktop-nav {
  background: white;
}

.jtmm-menu-bar {
  max-width: 1200px;
  margin: 0 auto;
}

.jtmm-menu-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.jtmm-menu-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: #333;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.jtmm-menu-button:hover,
.jtmm-menu-button.active {
  color: var(--region-color, #E53935);
  background: #fafafa;
  border-bottom-color: var(--region-color, #E53935);
}

.jtmm-menu-emoji {
  font-size: 16px;
  font-style: normal;
}

.jtmm-menu-arrow {
  font-size: 10px;
  opacity: 0.5;
  transition: transform 0.2s ease;
}

.jtmm-menu-button.active .jtmm-menu-arrow,
.jtmm-menu-button:hover .jtmm-menu-arrow {
  transform: rotate(180deg);
}

/* =====================================================
   DROPDOWN PANEL
   ===================================================== */

.jtmm-dropdown {
  position: fixed;
  left: 0;
  right: 0;
  top: auto;
  background: white;
  border-top: 3px solid var(--region-color, #E53935);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 99999;
  animation: jtmmFadeIn 0.2s ease;
}

@keyframes jtmmFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.jtmm-dropdown-inner {
  display: grid;
  grid-template-columns: 220px 1fr 180px;
  gap: 32px;
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

/* =====================================================
   LEFT COLUMN - Featured + Quick Links
   ===================================================== */

.jtmm-col-left {
  /* No border - clean design */
}

.jtmm-section {
  margin-bottom: 24px;
}

.jtmm-section:last-child {
  margin-bottom: 0;
}

.jtmm-section-title {
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #333 !important;
  margin: 0 0 12px 0 !important;
  padding: 0 !important;
  line-height: 1.4 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

/* Featured Links */
.jtmm-featured-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 14px;
  color: #333;
}

.jtmm-featured-link:hover {
  color: var(--region-color, #E53935);
}

.jtmm-featured-link:hover .jtmm-featured-text {
  text-decoration: underline;
}

/* Tags */
.jtmm-tag {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.jtmm-tag-hot {
  background: #FFF3E0;
  color: #E65100;
}

.jtmm-tag-new {
  background: #E8F5E9;
  color: #2E7D32;
}

.jtmm-tag-default {
  background: #E3F2FD;
  color: #1976D2;
}

/* Quick Links Pills */
.jtmm-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.jtmm-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: #f5f5f5;
  border-radius: 16px;
  font-size: 13px;
  color: #555;
  transition: background 0.2s ease;
}

.jtmm-pill:hover {
  background: #eee;
  color: #333;
}

.jtmm-pill-emoji {
  font-size: 14px;
  font-style: normal;
}

/* =====================================================
   CENTER COLUMN - Categories
   ===================================================== */

.jtmm-col-center {
  min-width: 0;
}

.jtmm-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 24px;
  align-content: start;
}

.jtmm-category-group {
  min-width: 0;
}

.jtmm-category-title {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #333 !important;
  margin: 0 0 12px 0 !important;
  padding: 0 0 8px 0 !important;
  border-bottom: 2px solid #f0f0f0 !important;
  line-height: 1.4 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
}

.jtmm-category-group.is-subregion .jtmm-category-title {
  color: #E65100;
  border-bottom-color: #FFE0B2;
}

.jtmm-category-all {
  font-size: 11px;
  color: #888;
  font-weight: 400;
}

.jtmm-category-all:hover {
  color: #E65100;
}

.jtmm-category-list {
  list-style: none;
}

.jtmm-category-list li {
  margin: 0;
}

.jtmm-category-list a {
  display: block;
  padding: 6px 0;
  font-size: 13px;
  color: #444;
  line-height: 1.4;
}

.jtmm-category-list a:hover {
  color: var(--region-color, #E53935);
}

.jtmm-link-title {
  display: flex;
  align-items: center;
  gap: 6px;
}

.jtmm-link-subtitle {
  display: block;
  font-size: 11px;
  color: #888;
  margin-top: 2px;
}

.jtmm-hub-link {
  font-weight: 600;
}

.jtmm-hub-arrow {
  color: var(--region-color, #E53935);
  margin-left: 4px;
}

.jtmm-new-badge {
  font-size: 9px;
  background: #E8F5E9;
  color: #2E7D32;
  padding: 1px 4px;
  border-radius: 3px;
  margin-right: 4px;
}

/* =====================================================
   RIGHT COLUMN - CTA Card
   ===================================================== */

.jtmm-col-cta {
  /* No left border - clean design */
}

.jtmm-cta-card {
  background: linear-gradient(135deg, 
    color-mix(in srgb, var(--cta-color, #E53935) 15%, white),
    color-mix(in srgb, var(--cta-color, #E53935) 5%, white)
  );
  border-radius: 12px;
  padding: 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.jtmm-cta-content {
  flex: 1;
}

.jtmm-cta-emoji {
  font-size: 32px;
  margin-bottom: 8px;
  font-style: normal;
}

.jtmm-cta-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
}

.jtmm-cta-text {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
}

.jtmm-cta-button {
  display: block;
  margin-top: 16px;
  padding: 10px 16px;
  background: var(--cta-color, #E53935);
  color: white !important;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  transition: all 0.2s ease;
}

.jtmm-cta-button:hover {
  color: white !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* =====================================================
   MOBILE STYLES
   ===================================================== */

.jtmm-mobile-nav {
  display: none;
}

@media (max-width: 1024px) {
  .jtmm-desktop-nav {
    display: none;
  }

  .jtmm-mobile-nav {
    display: block;
    background: white;
  }

  .jtmm-mobile-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: white;
    border: none;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: #333;
  }

  .jtmm-hamburger {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 20px;
  }

  .jtmm-hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: #333;
    border-radius: 1px;
  }

  .jtmm-mobile-menu {
    background: white;
    border-bottom: 1px solid #eee;
    max-height: 70vh;
    overflow-y: auto;
  }

  .jtmm-mobile-item {
    border-bottom: 1px solid #eee;
  }

  .jtmm-mobile-region-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    font-weight: 500;
    color: #333;
  }

  .jtmm-mobile-region-toggle.expanded {
    color: var(--region-color, #E53935);
    background: color-mix(in srgb, var(--region-color, #E53935) 5%, white);
  }

  .jtmm-mobile-region-info {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .jtmm-mobile-arrow {
    font-size: 10px;
    transition: transform 0.2s ease;
  }

  .jtmm-mobile-content {
    padding: 0 16px 16px;
  }

  .jtmm-mobile-featured {
    margin-bottom: 12px;
  }

  .jtmm-mobile-featured-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    margin-bottom: 4px;
    background: #FFF8E1;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
  }

  .jtmm-mobile-featured-link:hover {
    background: #FFECB3;
    color: #333;
  }

  .jtmm-mobile-section {
    margin-bottom: 12px;
  }

  .jtmm-mobile-section-title {
    font-size: 12px;
    color: #888;
    padding: 0 8px;
    margin-bottom: 8px;
  }

  .jtmm-mobile-link {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    color: #333;
  }

  .jtmm-mobile-link:hover {
    color: var(--region-color, #E53935);
  }

  .jtmm-mobile-subtitle {
    color: #888;
    margin-left: 8px;
    font-size: 12px;
  }

  .jtmm-mobile-view-all {
    display: block;
    text-align: center;
    padding: 12px;
    font-size: 14px;
    font-weight: 500;
  }

  .jtmm-mobile-view-all:hover {
    background: color-mix(in srgb, var(--region-color, #E53935) 10%, white);
    border-radius: 8px;
  }
}

/* =====================================================
   WORDPRESS THEME OVERRIDES
   ===================================================== */

/* Ensure our styles take precedence */
.jtmm-react,
.jtmm-react * {
  font-family: 'Noto Sans TC', 'PingFang TC', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

.jtmm-react a,
.jtmm-react a:link,
.jtmm-react a:visited {
  text-decoration: none !important;
}

.jtmm-react ul,
.jtmm-react li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Elementor compatibility */
.elementor-section .jtmm-react,
.elementor-container .jtmm-react,
.elementor-widget-shortcode .jtmm-react {
  overflow: visible !important;
}
