/* styles.css */
/* CSS Lengkap untuk Landing Page Roti Gembong Raja Mahakam */

/* ===== GLOBAL & BASE STYLES ===== */
html {
  scroll-behavior: smooth;
}

/* Mengurangi animasi untuk user yang prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal,
  .reveal-up,
  .reveal-left,
  .reveal-right {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .card-advantage,
  .card-package {
    transition: none !important;
    transform: none !important;
  }
}

/* Scroll margin untuk section dengan sticky header */
section[id] {
  scroll-margin-top: 80px;
}

/* ===== NAVIGATION ACTIVE STATE ===== */
.nav-link {
  position: relative;
  padding-bottom: 5px;
  transition: color 0.3s;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: #d97706; /* amber-600 */
  transition: width 0.3s ease;
}

.nav-link.active {
  color: #b45309; /* amber-700 */
  font-weight: 600;
}

.nav-link.active::after {
  width: 100%;
}

/* Untuk mobile menu link */
.nav-link-mobile.active {
  background-color: #fef3c7; /* amber-100 */
  color: #92400e; /* amber-800 */
  font-weight: 600;
}

/* ===== REVEAL ANIMATION CLASSES ===== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active,
.reveal-up.active,
.reveal-left.active,
.reveal-right.active {
  opacity: 1;
  transform: translate(0);
}

/* Delay utilities */
.delay-75 {
  transition-delay: 75ms;
}
.delay-150 {
  transition-delay: 150ms;
}
.delay-225 {
  transition-delay: 225ms;
}
.delay-300 {
  transition-delay: 300ms;
}
.delay-375 {
  transition-delay: 375ms;
}
.delay-450 {
  transition-delay: 450ms;
}
.delay-525 {
  transition-delay: 525ms;
}

/* ===== COMPONENT STYLES ===== */

/* Hero Background */
.hero-bg {
  background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.5)),
    url("images/hero-roti.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-color: #92400e; /* Fallback color amber-800 */
  min-height: 600px;
}

@media (max-width: 768px) {
  .hero-bg {
    background-attachment: scroll;
    min-height: 500px;
  }
}

/* Button Styles */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  background: linear-gradient(to right, #d97706, #b45309);
  color: white;
  font-weight: 600;
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.btn-primary:hover {
  background: linear-gradient(to right, #b45309, #92400e);
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.btn-primary:focus {
  outline: 2px solid #fbbf24;
  outline-offset: 2px;
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none !important;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  background-color: white;
  color: #92400e;
  font-weight: 600;
  border-radius: 0.75rem;
  border: 2px solid #d97706;
  transition: all 0.3s ease;
  text-decoration: none;
  cursor: pointer;
}

.btn-secondary:hover {
  background-color: #fef3c7;
  transform: translateY(-2px);
}

/* Card Advantage (Keunggulan) */
.card-advantage {
  background-color: white;
  padding: 2rem;
  border-radius: 1.5rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05),
    0 8px 10px -6px rgba(0, 0, 0, 0.01);
  border: 1px solid #fde68a;
  height: 100%;
  transition: all 0.4s ease;
}

.card-advantage:hover {
  transform: translateY(-10px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
  border-color: #fbbf24;
}

/* Card Package (Yang Didapat) */
.card-package {
  background-color: white;
  padding: 2.5rem 2rem;
  border-radius: 1.5rem;
  border: 1px solid #e5e7eb;
  height: 100%;
  transition: all 0.3s ease;
}

.card-package:hover {
  border-color: #f59e0b;
  box-shadow: 0 20px 40px -15px rgba(245, 158, 11, 0.15);
}

/* Form Input */
.form-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.75rem;
  font-size: 1rem;
  transition: all 0.3s;
  background-color: white;
  font-family: inherit;
}

.form-input:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.form-input.error {
  border-color: #dc2626;
  background-color: #fef2f2;
}

/* FAQ Component */
.faq-question {
  transition: background-color 0.3s, border-radius 0.3s;
  cursor: pointer;
  border: none;
  font-family: inherit;
  text-align: left;
}

.faq-question:hover {
  background-color: #fef3c7 !important;
}

.faq-question[aria-expanded="true"] {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background-color: #fef3c7;
  border-bottom: 1px solid #fde68a;
}

.faq-question[aria-expanded="true"] .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.faq-answer.open {
  max-height: 500px;
}

.rotate-180 {
  transform: rotate(180deg);
}

/* ===== GAMBAR RESPONSIF ===== */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Image containers */
.image-container {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
}

.image-container img {
  transition: transform 0.5s ease;
}

.image-container:hover img {
  transform: scale(1.05);
}

/* Logo styling */
header img {
  height: 48px;
  width: auto;
}

@media (max-width: 640px) {
  header img {
    height: 40px;
  }
}

/* ===== ROI SECTION STYLES ===== */
.roi-chart-container {
  position: relative;
  height: 240px;
  background: linear-gradient(to bottom, #fef3c7, #fffbeb);
  border-radius: 1rem;
  padding: 1.5rem;
}

.roi-chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 160px;
  margin-bottom: 2rem;
  padding: 0 1rem;
}

.roi-chart-bar {
  width: 60px;
  background: linear-gradient(
    to top,
    var(--bar-color),
    color-mix(in srgb, var(--bar-color) 80%, white)
  );
  border-radius: 0.5rem 0.5rem 0 0;
  transition: height 1s ease-in-out;
  position: relative;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.roi-chart-bar::after {
  content: attr(data-value);
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 600;
  color: #374151;
  white-space: nowrap;
}

.roi-chart-bar.omzet {
  --bar-color: #10b981;
}
.roi-chart-bar.laba-kotor {
  --bar-color: #f59e0b;
}
.roi-chart-bar.laba-bersih {
  --bar-color: #3b82f6;
}
.roi-chart-bar.roi {
  --bar-color: #8b5cf6;
}

.roi-chart-labels {
  display: flex;
  justify-content: space-around;
  text-align: center;
  margin-top: 1rem;
}

.roi-chart-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
}

/* ROI Calculator Inputs */
.roi-input-group {
  margin-bottom: 1.5rem;
}

.roi-input-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #374151;
}

.roi-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.roi-input:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.roi-result-card {
  padding: 1.5rem;
  border-radius: 1rem;
  margin-bottom: 1rem;
  transition: transform 0.3s ease;
}

.roi-result-card:hover {
  transform: translateY(-5px);
}

.roi-result-value {
  font-size: 1.875rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes growBar {
  from {
    height: 0;
    opacity: 0;
  }
  to {
    height: var(--target-height);
    opacity: 1;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* ===== IMAGE FALLBACK STYLES ===== */
.image-fallback {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #92400e;
  font-weight: 600;
}

.image-fallback svg {
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
  color: #d97706;
}

/* ===== COOKIE BANNER ===== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(17, 24, 39, 0.95);
  color: white;
  padding: 1.5rem;
  z-index: 1000;
  backdrop-filter: blur(10px);
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.cookie-banner.show {
  transform: translateY(0);
}

/* ===== PRINT STYLES ===== */
@media print {
  .no-print {
    display: none !important;
  }

  .hero-bg {
    background: none !important;
    background-color: #fef3c7 !important;
  }

  .btn-primary,
  .btn-secondary {
    background: none !important;
    color: black !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
  }
}

/* ===== ACCESSIBILITY ===== */
.using-keyboard *:focus {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
}

.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: #d97706;
  color: white;
  padding: 0.5rem 1rem;
  text-decoration: none;
  z-index: 1001;
}

.skip-to-content:focus {
  top: 0;
}

/* Screen reader only text */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
  .roi-chart-bars {
    height: 120px;
  }

  .roi-chart-bar {
    width: 40px;
  }

  .roi-result-value {
    font-size: 1.5rem;
  }

  .card-advantage,
  .card-package {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 640px) {
  .hero-bg h1 {
    font-size: 2.25rem !important;
  }

  .hero-bg p {
    font-size: 1rem !important;
  }

  .btn-primary,
  .btn-secondary {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
  }

  .faq-question {
    padding: 1rem 1.25rem;
    font-size: 1rem;
  }
}

/* ===== UTILITY CLASSES ===== */
.text-balance {
  text-wrap: balance;
}

.bg-blur {
  backdrop-filter: blur(10px);
}

.shadow-soft {
  box-shadow: 0 10px 40px -15px rgba(0, 0, 0, 0.1);
}

.gradient-text {
  background: linear-gradient(135deg, #d97706, #92400e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== FORM SUCCESS ANIMATION ===== */
@keyframes checkmark {
  0% {
    stroke-dashoffset: 100;
  }
  100% {
    stroke-dashoffset: 0;
  }
}

.checkmark-animated {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: checkmark 0.5s ease-in-out forwards;
}

/* ===== LOADING SKELETON ===== */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ===== CUSTOM SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #fef3c7;
}

::-webkit-scrollbar-thumb {
  background: #d97706;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #b45309;
}

/* ===== BACK TO TOP BUTTON ===== */
#backToTop {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#backToTop:hover {
  transform: translateY(-5px);
}

/* ===== STICKY HEADER ===== */
header.sticky {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

/* ===== ROI CHART ANIMATION TRIGGERS ===== */
.roi-chart-bar {
  --target-height: 0;
}

.roi-chart-bar.animated {
  animation: growBar 1s ease-out forwards;
}

/* ===== FORM VALIDATION STYLES ===== */
.validation-error {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: block;
}

.validation-success {
  color: #10b981;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: block;
}

/* ===== WHATSAPP BUTTON PULSE EFFECT ===== */
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.whatsapp-pulse {
  animation: pulse 2s infinite;
}

/* ===== HAMBURGER MENU ANIMATION ===== */
#menuIcon {
  transition: transform 0.3s ease;
}

#menuIcon.active {
  transform: rotate(90deg);
}

/* ===== ROI SECTION SPECIFIC ===== */
.roi-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .roi-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.roi-input-group input[type="range"] {
  width: 100%;
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
}

.roi-input-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: #d97706;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.roi-input-group input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: #d97706;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* ===== DISCLAIMER BOXES ===== */
.disclaimer-box {
  border-left: 4px solid;
  padding: 1rem;
  margin: 1rem 0;
  background: #fffbeb;
  border-radius: 0 0.5rem 0.5rem 0;
}

.disclaimer-box.warning {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.disclaimer-box.danger {
  border-left-color: #dc2626;
  background: #fef2f2;
}

.disclaimer-box.info {
  border-left-color: #3b82f6;
  background: #eff6ff;
}

/* ===== COUNTER ANIMATION ===== */
.counter {
  font-variant-numeric: tabular-nums;
}

/* ===== SMOOTH TRANSITIONS ===== */
.transition-all {
  transition-property: all;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 300ms;
}

/* ===== MOBILE MENU ANIMATION ===== */
#mobileMenu {
  transition: max-height 0.3s ease-out;
  max-height: 0;
  overflow: hidden;
}

#mobileMenu:not(.hidden) {
  max-height: 500px;
}

/* ===== CARD HOVER SHADOWS ===== */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.15);
}

/* ===== GRADIENT BORDERS ===== */
.gradient-border {
  position: relative;
  background: white;
  border-radius: 1rem;
}

.gradient-border::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #d97706, #92400e, #f59e0b);
  border-radius: 1.125rem;
  z-index: -1;
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(5px);
}

/* ===== TOOLTIP ===== */
.tooltip {
  position: relative;
  display: inline-block;
}

.tooltip .tooltip-text {
  visibility: hidden;
  width: 200px;
  background-color: #374151;
  color: white;
  text-align: center;
  border-radius: 0.5rem;
  padding: 0.5rem;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 0.875rem;
}

.tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

.tooltip .tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #374151 transparent transparent transparent;
}

/* ===== RESPONSIVE TYPOGRAPHY ===== */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem !important;
  }

  h2 {
    font-size: 1.75rem !important;
  }

  h3 {
    font-size: 1.5rem !important;
  }
}

/* ===== PRINT OPTIMIZATION ===== */
@media print {
  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  h1,
  h2,
  h3,
  h4 {
    page-break-after: avoid;
  }

  section {
    page-break-inside: avoid;
  }

  .no-break {
    page-break-inside: avoid;
  }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
  .dark\:bg-gray-900 {
    background-color: #111827;
  }

  .dark\:text-white {
    color: white;
  }

  .dark\:text-gray-300 {
    color: #d1d5db;
  }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

/* ===== FOCUS VISIBLE POLYFILL ===== */
.js-focus-visible :focus:not(.focus-visible) {
  outline: none;
}

/* ===== LAST ITEM STYLES ===== */
.last\:mb-0:last-child {
  margin-bottom: 0;
}

.last\:border-b-0:last-child {
  border-bottom: 0;
}

/* ===== IMAGE ZOOM EFFECT ===== */
.image-zoom-container {
  overflow: hidden;
  border-radius: 0.75rem;
}

.image-zoom {
  transition: transform 0.5s ease;
}

.image-zoom-container:hover .image-zoom {
  transform: scale(1.1);
}

/* ===== CUSTOM CHECKBOX ===== */
.custom-checkbox {
  position: relative;
  width: 20px;
  height: 20px;
  border: 2px solid #d1d5db;
  border-radius: 0.375rem;
  transition: all 0.3s;
  cursor: pointer;
}

.custom-checkbox:checked {
  background-color: #d97706;
  border-color: #d97706;
}

.custom-checkbox:checked::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 0.75rem;
  font-weight: bold;
}

/* ===== FINAL TOUCHES ===== */
* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background-color: rgba(217, 119, 6, 0.3);
  color: inherit;
}

/* ===== RESPONSIVE SPACING ===== */
@media (max-width: 640px) {
  .section-padding {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  .container-padding {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ===== GRID GAP UTILITIES ===== */
.gap-responsive {
  gap: 1rem;
}

@media (min-width: 768px) {
  .gap-responsive {
    gap: 2rem;
  }
}

/* ===== END OF STYLES ===== */
