/* Fix for Header and Mobile Navigation Issues */

/* 1. Fix duplicate header display */

@media (max-width: 900px) {
  .header-container {
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    padding: 10px 15px;
  }
  .logo {
    order: 1;
    flex-shrink: 0;
  }
  nav {
    order: 2;
    display: none !important;
  }
  .mobile-menu-toggle {
    display: flex !important;
    order: 3;
    margin-left: 0;
    flex-shrink: 0;
  }
  .tablet-menu-toggle {
    display: none !important;
  }
  .auth-buttons {
    display: none !important;
  }
}

/* 2. Fix alur pendaftaran horizontal layout on mobile */

@media (max-width: 768px) {
  .flow {
    padding: 20px 0;
  }
  .flow-image-container {
    padding: 0 15px;
    text-align: center;
  }
  .flow-image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  }
}

/* 3. Ensure mobile navigation works properly */

@media (max-width: 480px) {
  .mobile-nav {
    width: 100%;
    right: -100%;
  }
  .flow-image-container {
    padding: 0 10px;
  }
}

/* 4. Quick Links Tablet Responsive Fix */

@media (max-width: 1024px) and (min-width: 769px) {
  /* Override inline styles with maximum specificity */
  .quick-links,
  html body .quick-links,
  section.quick-links,
  html body section.quick-links {
    text-align: center !important;
    display: block !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  .quick-links .container,
  html body .quick-links .container,
  section.quick-links .container,
  html body section.quick-links .container {
    width: 90% !important;
    max-width: 90% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
    text-align: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .quick-links .links-grid,
  html body .quick-links .links-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
    justify-content: center !important;
    justify-items: center !important;
    align-items: stretch !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: grid !important;
  }
  /* Override all link-card styles including inline */
  .quick-links .link-card,
  .quick-links .links-grid .link-card,
  .quick-links .links-grid > .link-card,
  div.quick-links div.link-card,
  html body .quick-links .link-card,
  html body .quick-links .links-grid .link-card,
  html body .quick-links .links-grid > .link-card,
  html body div.quick-links div.link-card {
    min-height: 160px !important;
    aspect-ratio: 1/1 !important;
    height: 160px !important;
    padding: 20px !important;
    border-radius: 20px 20px 0 0 !important;
  }
  .quick-links .link-card img,
  .quick-links .links-grid .link-card img,
  .quick-links .links-grid > .link-card img,
  div.quick-links div.link-card img,
  html body .quick-links .link-card img,
  html body .quick-links .links-grid .link-card img,
  html body .quick-links .links-grid > .link-card img,
  html body div.quick-links div.link-card img {
    width: 90% !important;
    height: auto !important;
    max-height: 90% !important;
    object-fit: contain !important;
    margin-bottom: 8px !important;
  }
  .quick-links .link-card h3,
  .quick-links .links-grid .link-card h3,
  .quick-links .links-grid > .link-card h3,
  div.quick-links div.link-card h3,
  html body .quick-links .link-card h3,
  html body .quick-links .links-grid .link-card h3,
  html body .quick-links .links-grid > .link-card h3,
  html body div.quick-links div.link-card h3 {
    font-size: 13px !important;
    line-height: 1.2 !important;
    margin: 0 !important;
  }
  .quick-links .link-card span,
  .quick-links .links-grid .link-card span,
  .quick-links .links-grid > .link-card span,
  div.quick-links div.link-card span,
  html body .quick-links .link-card span,
  html body .quick-links .links-grid .link-card span,
  html body .quick-links .links-grid > .link-card span,
  html body div.quick-links div.link-card span {
    font-size: 13px !important;
    line-height: 1.2 !important;
  }
}

/* 5. Quick Links Mobile Responsive Fix */

@media (max-width: 768px) {
  /* Ultra-specific overrides for inline styles */
  section.quick-links .links-grid > div[style*="min-height: 198px"],
  section.quick-links .links-grid > div[style*="height: 198px"],
  div[style*="min-height: 198px"][style*="height: 198px"],
  .quick-links div[style*="min-height: 198px"],
  .quick-links div[style*="height: 198px"] {
    min-height: 100px !important;
    max-height: 100px !important;
    height: 100px !important;
    aspect-ratio: 1/1 !important;
    padding: 8px !important;
    border-radius: 10px 10px 0 0 !important;
  }
  /* Override images with ultra-specific selectors */
  section.quick-links .links-grid > div[style*="min-height: 198px"] img[style*="width: 168px"],
  section.quick-links .links-grid > div[style*="height: 198px"] img[style*="width: 168px"],
  section.quick-links .links-grid > div[style*="min-height: 198px"] img[style*="height: 168px"],
  section.quick-links .links-grid > div[style*="height: 198px"] img[style*="height: 168px"],
  img[style*="width: 168px"][style*="height: 168px"] {
    width: 90% !important;
    height: auto !important;
    max-width: 90% !important;
    max-height: 90% !important;
    object-fit: contain !important;
    margin-bottom: 2px !important;
  }
  /* Disable hover effects on mobile devices */
  .quick-links .link-card:hover,
  .quick-links .links-grid .link-card:hover,
  .quick-links .links-grid > .link-card:hover,
  div.quick-links div.link-card:hover,
  html body .quick-links .link-card:hover,
  html body .quick-links .links-grid .link-card:hover,
  html body .quick-links .links-grid > .link-card:hover,
  html body div.quick-links div.link-card:hover {
    transform: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    background: white !important;
    color: inherit !important;
  }
  .quick-links .link-card:hover img,
  .quick-links .links-grid .link-card:hover img,
  .quick-links .links-grid > .link-card:hover img,
  div.quick-links div.link-card:hover img,
  html body .quick-links .link-card:hover img,
  html body .quick-links .links-grid .link-card:hover img,
  html body .quick-links .links-grid > .link-card:hover img,
  html body div.quick-links div.link-card:hover img {
    transform: none !important;
    filter: none !important;
  }
  .quick-links .link-card:hover h3,
  .quick-links .links-grid .link-card:hover h3,
  .quick-links .links-grid > .link-card:hover h3,
  div.quick-links div.link-card:hover h3,
  html body .quick-links .link-card:hover h3,
  html body .quick-links .links-grid .link-card:hover h3,
  html body .quick-links .links-grid > .link-card:hover h3,
  html body div.quick-links div.link-card:hover h3 {
    color: #333 !important;
  }
  .quick-links .link-card:hover span,
  .quick-links .links-grid .link-card:hover span,
  .quick-links .links-grid > .link-card:hover span,
  div.quick-links div.link-card:hover span,
  html body .quick-links .link-card:hover span,
  html body .quick-links .links-grid .link-card:hover span,
  html body .quick-links .links-grid > .link-card:hover span,
  html body div.quick-links div.link-card:hover span {
    color: #333 !important;
  }
  /* Disable hover overlay on mobile */
  .quick-links .link-card:hover .hover-overlay,
  .quick-links .links-grid .link-card:hover .hover-overlay,
  .quick-links .links-grid > .link-card:hover .hover-overlay,
  div.quick-links div.link-card:hover .hover-overlay,
  html body .quick-links .link-card:hover .hover-overlay,
  html body .quick-links .links-grid .link-card:hover .hover-overlay,
  html body .quick-links .links-grid > .link-card:hover .hover-overlay,
  html body div.quick-links div.link-card:hover .hover-overlay {
    opacity: 0 !important;
    display: none !important;
  }
  /* Override inline styles with maximum specificity */
  .quick-links .container,
  html body .quick-links .container,
  section.quick-links .container,
  html body section.quick-links .container {
    width: 90% !important;
    max-width: 90% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
    text-align: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .quick-links .links-grid,
  html body .quick-links .links-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    justify-items: center !important;
  }
  /* Override all link-card styles including inline */
  .quick-links .link-card,
  .quick-links .links-grid .link-card,
  .quick-links .links-grid > .link-card,
  div.quick-links div.link-card,
  html body .quick-links .link-card,
  html body .quick-links .links-grid .link-card,
  html body .quick-links .links-grid > .link-card,
  html body div.quick-links div.link-card,
  div[style*="min-height: 198px"],
  div[style*="height: 198px"] {
    min-height: 90px !important;
    aspect-ratio: 1/1 !important;
    height: 90px !important;
    padding: 6px !important;
    border-radius: 10px 10px 0 0 !important;
  }
  .quick-links .link-card img,
  .quick-links .links-grid .link-card img,
  .quick-links .links-grid > .link-card img,
  div.quick-links div.link-card img,
  html body .quick-links .link-card img,
  html body .quick-links .links-grid .link-card img,
  html body .quick-links .links-grid > .link-card img,
  html body div.quick-links div.link-card img,
  img[style*="width: 168px"],
  img[style*="height: 168px"] {
    width: 90% !important;
    height: auto !important;
    max-height: 90% !important;
    object-fit: contain !important;
    margin-bottom: 3px !important;
  }
  .quick-links .link-card h3,
  .quick-links .links-grid .link-card h3,
  .quick-links .links-grid > .link-card h3,
  div.quick-links div.link-card h3,
  html body .quick-links .link-card h3,
  html body .quick-links .links-grid .link-card h3,
  html body .quick-links .links-grid > .link-card h3,
  html body div.quick-links div.link-card h3 {
    font-size: 7px !important;
    line-height: 1 !important;
    margin: 0 !important;
  }
  .quick-links .link-card span,
  .quick-links .links-grid .link-card span,
  .quick-links .links-grid > .link-card span,
  div.quick-links div.link-card span,
  html body .quick-links .link-card span,
  html body .quick-links .links-grid .link-card span,
  html body .quick-links .links-grid > .link-card span,
  html body div.quick-links div.link-card span {
    font-size: 7px !important;
    line-height: 1 !important;
  }
}

/* 6. Small Mobile Quick Links Fix */

@media (max-width: 480px) {
  /* Disable hover effects on small mobile devices */
  .quick-links .link-card:hover,
  .quick-links .links-grid .link-card:hover,
  .quick-links .links-grid > .link-card:hover,
  div.quick-links div.link-card:hover,
  html body .quick-links .link-card:hover,
  html body .quick-links .links-grid .link-card:hover,
  html body .quick-links .links-grid > .link-card:hover,
  html body div.quick-links div.link-card:hover {
    transform: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    background: white !important;
    color: inherit !important;
  }
  .quick-links .link-card:hover img,
  .quick-links .links-grid .link-card:hover img,
  .quick-links .links-grid > .link-card:hover img,
  div.quick-links div.link-card:hover img,
  html body .quick-links .link-card:hover img,
  html body .quick-links .links-grid .link-card:hover img,
  html body .quick-links .links-grid > .link-card:hover img,
  html body div.quick-links div.link-card:hover img {
    transform: none !important;
    filter: none !important;
  }
  .quick-links .link-card:hover h3,
  .quick-links .links-grid .link-card:hover h3,
  .quick-links .links-grid > .link-card:hover h3,
  div.quick-links div.link-card:hover h3,
  html body .quick-links .link-card:hover h3,
  html body .quick-links .links-grid .link-card:hover h3,
  html body .quick-links .links-grid > .link-card:hover h3,
  html body div.quick-links div.link-card:hover h3 {
    color: #333 !important;
  }
  .quick-links .link-card:hover span,
  .quick-links .links-grid .link-card:hover span,
  .quick-links .links-grid > .link-card:hover span,
  div.quick-links div.link-card:hover span,
  html body .quick-links .link-card:hover span,
  html body .quick-links .links-grid .link-card:hover span,
  html body .quick-links .links-grid > .link-card:hover span,
  html body div.quick-links div.link-card:hover span {
    color: #333 !important;
  }
  /* Disable hover overlay on small mobile */
  .quick-links .link-card:hover .hover-overlay,
  .quick-links .links-grid .link-card:hover .hover-overlay,
  .quick-links .links-grid > .link-card:hover .hover-overlay,
  div.quick-links div.link-card:hover .hover-overlay,
  html body .quick-links .link-card:hover .hover-overlay,
  html body .quick-links .links-grid .link-card:hover .hover-overlay,
  html body .quick-links .links-grid > .link-card:hover .hover-overlay,
  html body div.quick-links div.link-card:hover .hover-overlay {
    opacity: 0 !important;
    display: none !important;
  }
  /* Override inline styles with maximum specificity */
  .quick-links .container,
  html body .quick-links .container,
  section.quick-links .container,
  html body section.quick-links .container {
    width: 90% !important;
    max-width: 90% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
    text-align: center !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .quick-links .links-grid,
  html body .quick-links .links-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  /* Override all link-card styles including inline */
  .quick-links .link-card,
  .quick-links .links-grid .link-card,
  .quick-links .links-grid > .link-card,
  div.quick-links div.link-card,
  html body .quick-links .link-card,
  html body .quick-links .links-grid .link-card,
  html body .quick-links .links-grid > .link-card,
  html body div.quick-links div.link-card {
    min-height: 110px !important;
    aspect-ratio: 1/1 !important;
    height: 110px !important;
    padding: 10px !important;
    border-radius: 12px 12px 0 0 !important;
  }
  .quick-links .link-card img,
  .quick-links .links-grid .link-card img,
  .quick-links .links-grid > .link-card img,
  div.quick-links div.link-card img,
  html body .quick-links .link-card img,
  html body .quick-links .links-grid .link-card img,
  html body .quick-links .links-grid > .link-card img,
  html body div.quick-links div.link-card img {
    width: 90% !important;
    height: auto !important;
    max-height: 90% !important;
    object-fit: contain !important;
    margin-bottom: 4px !important;
  }
  .quick-links .link-card h3,
  .quick-links .links-grid .link-card h3,
  .quick-links .links-grid > .link-card h3,
  div.quick-links div.link-card h3,
  html body .quick-links .link-card h3,
  html body .quick-links .links-grid .link-card h3,
  html body .quick-links .links-grid > .link-card h3,
  html body div.quick-links div.link-card h3 {
    font-size: 7px !important;
    line-height: 1 !important;
    margin: 0 !important;
  }
  .quick-links .link-card span,
  .quick-links .links-grid .link-card span,
  .quick-links .links-grid > .link-card span,
  div.quick-links div.link-card span,
  html body .quick-links .link-card span,
  html body .quick-links .links-grid .link-card span,
  html body .quick-links .links-grid > .link-card span,
  html body div.quick-links div.link-card span {
    font-size: 7px !important;
    line-height: 1 !important;
  }
}

/* 7. General Quick Links Container Centering - All Screen Sizes */

.quick-links .container,
html body .quick-links .container,
section.quick-links .container,
html body section.quick-links .container {
  margin-left: auto !important;
  margin-right: auto !important;
  display: block !important;
  text-align: center !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

@media (max-width: 1024px) {
  section.why-umbk .container,
  html body section.why-umbk .container {
    width: 90% !important;
    max-width: 90% !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
  section.why-umbk .why-content,
  html body section.why-umbk .why-content {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 30px !important;
    align-items: start !important;
  }
  section.why-umbk .feature-item p,
  html body section.why-umbk .feature-item p {
    text-align: justify !important;
  }
}

/* Landing Page - additional responsive fixes */

/* All containers 95% width */

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

/* Hero container specific */

.hero-container {
  display: block;
  width: 95% !important;
  height: auto !important;
  min-height: 200px !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 auto !important;
  overflow: visible !important;
  text-align: center;
}

.hero-image {
  width: 100% !important;
  height: auto !important;
  text-align: center;
  display: block;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  border-radius: 30px !important;
}

.hero-image img {
  width: 100% !important;
  height: auto !important;
  object-fit: cover !important;
  object-position: center center !important;
  display: block !important;
  max-width: none !important;
  max-height: none !important;
  transform: scale(1) !important;
}

/* Header container */

.header-container {
  width: 95% !important;
  max-width: none !important;
}

/* Footer container */

.footer-grid {
  width: 95% !important;
  max-width: none !important;
}

/* Header buttons styling */

.auth-buttons .btn-outline {
  background-color: white !important;
  color: #af0000 !important;
  border: 2px solid white !important;
  padding: 10px 20px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  transition: all 0.3s ease !important;
  font-size: 16px !important;
}

.auth-buttons .btn-outline:hover {
  background-color: #f8f8f8 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.auth-buttons .btn-primary {
  background-color: #af0000 !important;
  color: white !important;
  border: 2px solid #af0000 !important;
  padding: 10px 20px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  transition: all 0.3s ease !important;
  font-size: 16px !important;
}

.auth-buttons .btn-primary:hover {
  background-color: white !important;
  color: #af0000 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(160, 0, 0, 0.3) !important;
}

/* Responsive untuk mobile */

@media (max-width: 768px) {
  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    font-size: 1.5em !important;
  }
  p,
  span,
  div {
    font-size: 0.9em !important;
  }
  /* Header spacing */
  header {
    margin-bottom: 5px !important;
  }
  /* Hero image mobile adjustments */
  .hero-container {
    min-height: 200px !important;
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .hero-image {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .hero-image img {
    width: 100% !important;
    height: auto !important;
    max-width: none !important;
    transform: scale(1) !important;
    border: none !important;
    padding: 0 !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }
  /* Sembunyikan auth buttons inline di mobile */
  .auth-buttons-inline {
    display: none !important;
  }
}

/* Responsive untuk tablet */

@media (min-width: 769px) and (max-width: 1024px) {
  .hero-container {
    width: 95% !important;
    min-height: 300px !important;
    display: block !important;
    padding: 0 !important;
    margin: 0 auto !important;
  }
  .hero-image {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .hero-image img {
    width: 100% !important;
    height: auto !important;
    max-width: none !important;
    transform: scale(1) !important;
    padding: 0 !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 auto !important;
    border-radius: 20px !important;
    box-shadow: 0 0 0 3px #af0000 !important;
    clip-path: inset(0 round 20px) !important;
    -webkit-clip-path: inset(0 round 20px) !important;
  }
}
