/* ============================================
   BANDAR AKI APP — Base Styles
   Reset, Typography, Global Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ── Modern CSS Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-primary);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--clr-text-primary);
  background-color: var(--clr-bg-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--clr-primary-400); text-decoration: none; transition: var(--transition-fast); }
a:hover { color: var(--clr-primary-300); }
a:focus-visible { outline: 2px solid var(--clr-primary-500); outline-offset: 2px; border-radius: var(--radius-sm); }

img, picture, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }
table { border-collapse: collapse; border-spacing: 0; width: 100%; }

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  color: var(--clr-text-primary);
  letter-spacing: -0.02em;
}
h1 { font-size: var(--fs-5xl); font-weight: var(--fw-extrabold); letter-spacing: -0.03em; }
h2 { font-size: var(--fs-4xl); }
h3 { font-size: var(--fs-3xl); }
h4 { font-size: var(--fs-2xl); }
h5 { font-size: var(--fs-xl); }
h6 { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
p  { color: var(--clr-text-secondary); line-height: var(--lh-relaxed); }
strong, b { font-weight: var(--fw-semibold); }
small { font-size: var(--fs-sm); }

/* ── Selection & Scrollbar ── */
::selection { background-color: rgba(220, 38, 38, 0.3); color: var(--clr-text-primary); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--clr-dark-600); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--clr-dark-500); }
* { scrollbar-width: thin; scrollbar-color: var(--clr-dark-600) transparent; }

/* ── Focus ── */
:focus-visible { outline: 2px solid var(--clr-primary-500); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

/* ── Utility Classes ── */
.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; }
.container { width: 100%; max-width: var(--container-max); margin-inline: auto; padding-inline: var(--sp-6); }
.container--narrow { max-width: var(--container-narrow); }

.text-gradient { background: var(--gradient-text); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.text-primary   { color: var(--clr-text-primary) !important; }
.text-secondary { color: var(--clr-text-secondary) !important; }
.text-muted     { color: var(--clr-text-muted) !important; }
.text-accent    { color: var(--clr-text-accent) !important; }
.text-success   { color: var(--clr-success) !important; }
.text-warning   { color: var(--clr-warning) !important; }
.text-error     { color: var(--clr-error) !important; }
.text-center    { text-align: center; }
.text-right     { text-align: right; }

.d-none   { display: none !important; }
.d-block  { display: block !important; }
.d-flex   { display: flex !important; }
.d-grid   { display: grid !important; }

.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col     { display: flex; flex-direction: column; }
.flex-wrap    { flex-wrap: wrap; }
.flex-1       { flex: 1; }
.gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); } .gap-6 { gap: var(--sp-6); } .gap-8 { gap: var(--sp-8); }

.mt-2 { margin-top: var(--sp-2); } .mt-4 { margin-top: var(--sp-4); } .mt-6 { margin-top: var(--sp-6); } .mt-8 { margin-top: var(--sp-8); }
.mb-2 { margin-bottom: var(--sp-2); } .mb-4 { margin-bottom: var(--sp-4); } .mb-6 { margin-bottom: var(--sp-6); } .mb-8 { margin-bottom: var(--sp-8); }
.w-full { width: 100%; }
.h-full { height: 100%; }

/* ── Keyframe Animations ── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInLeft { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeInRight { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes slideOutRight { from { transform: translateX(0); } to { transform: translateX(100%); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes glowPulse { 0%, 100% { box-shadow: 0 0 20px rgba(220,38,38,0.2); } 50% { box-shadow: 0 0 40px rgba(220,38,38,0.4); } }

.animate-fade-in    { animation: fadeIn var(--duration-normal) var(--ease-smooth) forwards; }
.animate-fade-in-up { animation: fadeInUp var(--duration-slow) var(--ease-spring) forwards; }
.animate-scale-in   { animation: scaleIn var(--duration-normal) var(--ease-bounce) forwards; }
.animate-spin       { animation: spin 1s linear infinite; }
.animate-pulse      { animation: pulse 2s ease-in-out infinite; }
.animate-float      { animation: float 3s ease-in-out infinite; }
.animate-glow       { animation: glowPulse 2s ease-in-out infinite; }

.delay-1 { animation-delay: 100ms; } .delay-2 { animation-delay: 200ms; }
.delay-3 { animation-delay: 300ms; } .delay-4 { animation-delay: 400ms; }
.delay-5 { animation-delay: 500ms; } .delay-6 { animation-delay: 600ms; }

/* ── Responsive ── */

/* Tablet */
@media (max-width: 768px) {
  .container { padding-inline: var(--sp-4); }
  h1 { font-size: var(--fs-4xl); }
  h2 { font-size: var(--fs-3xl); }
}

/* Mobile */
@media (max-width: 640px) {
  html { font-size: 14px; }
  h1 { font-size: var(--fs-3xl); }
  h2 { font-size: var(--fs-2xl); }
  h3 { font-size: var(--fs-xl); }
  .container { padding-inline: var(--sp-4); }

  /* Prevent horizontal overflow */
  body { overflow-x: hidden; }
  * { overflow-wrap: break-word; word-wrap: break-word; }

  /* Touch-friendly interactive elements */
  button, .btn, a.btn, select, input, textarea {
    min-height: 44px;
  }

  /* Flexible utility overrides */
  .flex-between { flex-wrap: wrap; gap: var(--sp-3); }
  .gap-8 { gap: var(--sp-4); }
  .gap-6 { gap: var(--sp-3); }
}

/* Small mobile */
@media (max-width: 480px) {
  html { font-size: 13px; }
  .container { padding-inline: var(--sp-3); }
  h1 { font-size: var(--fs-2xl); }
  h2 { font-size: var(--fs-xl); }
  h3 { font-size: var(--fs-lg); }
}
