/* Variables — Light mode (default) */

:root {
  /* Brand colors (unchanged across themes) — Kadrella rose */
  --purple1: #ff7aac;
  --purple2: #e0447e;
  --brand-soft: #ffe7f0; /* light rose tint — active/selected states */
  --red: #ff3636;
  --yellow: #e2dd3a;
  --confirm: #00c853;
  --confirm-hover: #00b74a;
  --cancel: #ff3636;
  --cancel-hover: #e02f2f;

  /* Semantic status colors — light. `-soft` = badge/banner bg, `-solid` = filled
     button bg (pairs with white text). Base = text/icon/border. */
  --success: #15803d;
  --success-soft: #dcfce7;
  --success-solid: #16a34a;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --danger-solid: #dc2626;
  --warning: #b45309;
  --warning-soft: #ffedd5;
  --warning-solid: #ea580c;
  --info: #1d4ed8;
  --info-soft: #dbeafe;
  --info-solid: #2563eb;

  /* Literal colors — NEVER swap these */
  --white: #ffffff;
  --black: #000000;

  /* Semantic colors — light mode (Kadrella warm paper/ink) */
  --bg-page: #fbf7f4;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f6edf0;
  --bg-elevated: #ffffff;
  --bg-input: #ffffff;
  --bg-overlay: rgba(26, 17, 20, 0.35);
  --bg-card: #ffffff;
  --bgHeader: #ffffff;
  --bgDefault: #fbf7f4;

  --text-primary: #17101a;
  --text-secondary: #3a333e;
  --text-muted: #575059;
  --text-on-primary: #ffffff;

  --border-color: #e2d3db;
  --border-color-subtle: #ece0e6;

  --scrollbar-track: #f4ecef;
  --scrollbar-thumb: #d8c8ce;
  --scrollbar-thumb-hover: #c0aeb5;

  --disabled: #eee1e7;
  --fontGray1: #6b6067;
  --fontGray2: #a89ba0;

  /* Legacy dark-N vars mapped to light equivalents */
  --dark0: #f4ebef;
  --dark1: #f6edf0;
  --dark2: #eee1e7;
  --dark3: #e3d3da;
  --dark4: #c9b8bf;
  --dark5: #a89ba0;
  --dark6: #6b6067;
  --dark7: #3a3035;

  color-scheme: light;
}

/* Dark mode overrides — Kadrella warm rose-tinted neutrals */
.dark {
  --bg-page: #140d10;
  --bg-surface: #1c1418;
  --bg-surface-hover: #271d22;
  --bg-elevated: #271d22;
  --bg-input: #271d22;
  --bg-overlay: rgba(0, 0, 0, 0.75);
  --bg-card: #1c1418;
  --bgHeader: #1c1418;
  --bgDefault: #140d10;

  --text-primary: #fbf7f4;
  --text-secondary: #d9cdce;
  --text-muted: #a89ba0;
  --text-on-primary: #ffffff;

  --border-color: #3a2d33;
  --border-color-subtle: #271d22;
  --brand-soft: #3a222c; /* muted dark rose — active/selected states */

  /* Semantic status colors — dark */
  --success: #4ade80;
  --success-soft: #0e2a18;
  --success-solid: #16a34a;
  --danger: #f87171;
  --danger-soft: #35151a;
  --danger-solid: #dc2626;
  --warning: #fb923c;
  --warning-soft: #35230f;
  --warning-solid: #ea580c;
  --info: #60a5fa;
  --info-soft: #12233d;
  --info-solid: #2563eb;

  --scrollbar-track: #140d10;
  --scrollbar-thumb: #4a3a41;
  --scrollbar-thumb-hover: #63505a;

  --disabled: #271d22;
  --fontGray1: #a89ba0;
  --fontGray2: #7d7076;

  --dark0: #140d10;
  --dark1: #1c1418;
  --dark2: #271d22;
  --dark3: #271d22;
  --dark4: #3a2d33;
  --dark5: #7d7076;
  --dark6: #a89ba0;
  --dark7: #d9cdce;

  color-scheme: dark;
}

/* Common styles */
::-webkit-scrollbar-corner {
  background: transparent;
}

div.page-wrapper {
  display: flex;
  height: calc(100% - 170px);
}

.main-content {
  padding: 24px;
  width: calc(100% - 48px);
  overflow-y: auto;
}

#root {
  min-height: 100vh;
  width: 100%;
}

#root > * {
  min-height: 100vh;
}

main.public {
  min-height: calc(100svh - 200px);
  margin: 0 auto;
}

main.public > * {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: center;
  gap: 24px;
}

/* Reset CSS */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  color: var(--text-primary) !important;
  background: var(--bg-page) !important;
  height: 100%;
}

body {
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  font-family:
    'Hanken Grotesk', Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input[type='button'],
input[type='submit'] {
  cursor: pointer;
}

select * {
  color: var(--fontGray1);
  background-color: var(--bgDefault);
}

input:focus,
button:focus,
textarea:focus,
select:focus {
  color: var(--text-primary);
}

.section-container {
  max-width: 1096px;
  margin: 0 auto;
  padding: 0 8px;
  width: 100%;
}

.button-container {
  display: flex;
  gap: 8px;
  justify-content: end;
}

.button-container > .button {
  display: inline-block;
  width: fit-content;
}

/* "Edit Panels Styles" */
.panel-popup {
  &.fixed {
    position: fixed;
    width: 80%;
    z-index: 10000;
    padding: 10px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0 auto;
    background-color: var(--bgHeader);
    border-radius: 5px;
    box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.15);
  }

  & .row {
    display: flex;
    justify-content: space-between;
    padding: 3px;
    gap: 5px;
  }

  h3 {
    margin-top: 15px;
  }
}

/* Toaster Styles */

.toasterContainer {
  z-index: 99999 !important;
}

/* "Edit Panels Styles" */

.edit-panel .actions {
  position: absolute;
  top: 10px;
  right: 50px;
  display: flex;
  gap: 10px;
  z-index: 1001;

  &.left {
    left: 10px;
    right: auto;
  }

  & > button {
    padding: inherit 10px;
  }
}

.edit-panel h1 {
  font-size: 32px;
  text-align: center;
  margin-bottom: 20px;
}

/** ******************************/
/** Begin Scroll bar
/** ******************************/

/* width */
::-webkit-scrollbar {
  width: 10px;
}

/* Track */
::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

/* Handle */
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 10px;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

/** ******************************/
/** End Scroll bar
/** ******************************/

@media (max-width: 768px) {
  main.public > * {
    padding: 0 24px;
  }

  .button-container {
    flex-wrap: wrap;
    justify-content: center;
    & > #ExpandableInput {
      width: 40%;
    }
  }
}

/** Mantine overrides */

.mantine-Group-root button {
  width: unset;
}

.mantine-Input-rightSection {
  width: calc((1.5rem + 0.0625rem) * 2);
  & > * {
    flex-direction: row;
  }
}

.mantine-Button-root[data-disabled] {
  background-color: var(--disabled);
  color: var(--fontGray1);
  cursor: not-allowed;
  opacity: 0.5;
}

input[type='color']::-moz-color-swatch {
  border: none;
}

input[type='color']::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 0;
}

input[type='color']::-webkit-color-swatch {
  border: none;
}

.highlight-help {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px #3b82f6;
  background-color: rgba(37, 99, 235, 0.1);
}
