
/* =====================================================
   KALORIKU - MODERN FITNESS UI
   Main Stylesheet
===================================================== */

/* =====================================================
   1. IMPORTS
===================================================== */
@import url("./dashboard.css");
@import url("./food-edit-modal.css");
@import url("./history-page.css");
@import url("./profile-page.css");
@import url("./statistics-page.css");
@import url("./navigation.css");
@import url("./login.css");

/* =====================================================
   2. DESIGN SYSTEM - LIGHT MODE
===================================================== */

:root {
  /* BRAND */
  --brand: #16865b;
  --brand-dark: #106b49;
  --brand-light: #dff7e9;
  --accent: #b8ed63;

  /* BACKGROUND */
  --app-bg: #f3f7f4;
  --surface: #ffffff;
  --surface-soft: #eaf2ed;

  /* TEXT */
  --text-primary: #172b21;
  --text-secondary: #728278;
  --text-muted: #9aa79e;

  /* STATUS */
  --success: #16a36a;
  --warning: #f2a93b;
  --danger: #e45d5d;
  --info: #459bd8;

  /* BORDER */
  --border: #e3ebe5;

  /* SHADOW */
  --shadow-sm: 0 3px 12px rgba(22, 65, 43, .05);
  --shadow-md: 0 8px 25px rgba(22, 65, 43, .08);
  --shadow-lg: 0 15px 40px rgba(22, 65, 43, .12);

  /* RADIUS */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  /* TRANSITION */
  --transition: 300ms cubic-bezier(.22, 1, .36, 1);
}


/* =====================================================
   3. DARK MODE
===================================================== */

html[data-theme="dark"] {
  color-scheme: dark;

  --brand: #42d68c;
  --brand-dark: #20ad70;
  --brand-light: #173c2c;
  --accent: #c1f36c;

  --app-bg: #0d1712;
  --surface: #17231c;
  --surface-soft: #202e25;

  --text-primary: #edf7f0;
  --text-secondary: #a1b2a6;
  --text-muted: #718579;

  --success: #42d68c;
  --warning: #f5bc55;
  --danger: #ff7474;
  --info: #62b9ed;

  --border: #2a3b30;

  --shadow-sm: 0 3px 12px rgba(0, 0, 0, .16);
  --shadow-md: 0 8px 25px rgba(0, 0, 0, .22);
  --shadow-lg: 0 15px 40px rgba(0, 0, 0, .30);
}


/* =====================================================
   4. GLOBAL FOUNDATION
===================================================== */

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

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

html[data-theme="dark"] {
  color-scheme: dark;
}

html,
body {
  min-height: 100%;
}

body {
  padding-bottom: 85px;
  font-family: Arial, sans-serif;
  background: var(--app-bg);
  color: var(--text-primary);
  transition:
    background var(--transition),
    color var(--transition);
}

/* Elemen hidden harus tetap tersembunyi */
[hidden] {
  display: none !important;
}

/* Seleksi teks */
::selection {
  background: var(--brand-light);
  color: var(--text-primary);
}

/* Focus accessibility */
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}

button {
  font-family: inherit;
}


/* =====================================================
   5. MAIN LAYOUT
===================================================== */

main {
  width: 100%;
  max-width: 600px;
  margin: auto;
  padding: 20px;
}

h3 {
  font-size: 17px;
  margin-bottom: 14px;
  color: var(--text-primary);
}







/* =====================================================
   18. FOOTER
===================================================== */

footer {
  padding: 25px;

  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

footer small {
  display: block;
  margin-top: 5px;
}


/* =====================================================
   19. PAGE TRANSITIONS
===================================================== */

.page-enter {
  animation: pageEnter 420ms cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes foodPanelEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* =====================================================
   20. RESPONSIVE
===================================================== */

@media (max-width: 480px) {
  .detected-food-item {
    gap: 10px;
  }
}

@media (max-width: 380px) {
  .nutrition-grid {
    gap: 7px;
  }

  .nutrition-card {
    padding: 13px 9px;
  }

  .nutrition-card > strong {
    font-size: 17px;
  }

  .calorie-number strong {
    font-size: 42px;
  }

  .scan-section {
    padding: 16px;
  }

  .photo-button {
    min-height: 145px;
  }

  .food-form {
    padding: 15px;
  }
}

@media (max-width: 350px) {
  .result-actions {
    grid-template-columns: 1fr 1.2fr;
  }

  .result-actions button {
    padding-inline: 8px;
    font-size: 12px;
  }
}


/* =====================================================
   21. REDUCED MOTION
===================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .topbar,
  .topbar h1,
  .topbar p,
  .avatar,
  .calorie-card #progressBar,
  .nutrition-card,
  .nutrition-progress-track > div,
  .food-suggestions,
  .result-card,
  .nav-indicator,
  .nav-item,
  .nav-icon,
  .nav-label,
  .page-enter {
    animation: none !important;
    transition: none !important;
  }
}

