/* Default */
:root {
  /* 🌞 Light Color theme*/
  color-scheme: light;

  /* Text Colors */
  --text-primary: #1A1A1A;
  --text-secondary: #4D4D4D;
  --text-muted: #666666;
  /* Improved contrast */
  --text-inverse: #FFFFFF;

  /* Background Colors */
  /* --bg-primary: Body, main container */
  /* --bg-secondary: Sections, cards, sidebars, dividers */
  /* --bg-surface: Elevated elements like modals, dropdowns, popups */
  /* --bg-accent: Used for important UI elements */
  /* --bg-muted: Subtle sections like footers, inactive elements, disabled UI */
  /* --bg-inverse: Used for contrasting elements */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F5F5F5;
  --bg-surface: #FFFFFF;
  --bg-accent: #EAE6FF;
  --bg-muted: #E0E0E0;
  --bg-inverse: #1A1A1A;

  /* Elevation (Shadows) */
  /* --elevation-1: Small shadows for subtle depth */
  /* --elevation-2: Medium shadows for prominent cards */
  /* --elevation-3: Stronger shadows for modal or popovers */
  --elevation-1: 0px 1px 3px rgba(0, 0, 0, 0.1);
  --elevation-2: 0px 3px 6px rgba(0, 0, 0, 0.15);
  --elevation-3: 0px 5px 10px rgba(0, 0, 0, 0.2);

  /* Borders */
  /* --border-primary: Default border color */
  /* --border-secondary: Subtle border color for dividers */
  --border-primary: #D9D9D9;
  --border-secondary: #BFBFBF;
  --border-radius-small: 4px;
  --border-radius-medium: 8px;
  --border-radius-large: 16px;

  /* Spacing (Base) */
  --space-xxs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-xxl: 40px;

  /* States */
  --state-hover: rgba(0, 0, 0, 0.05);
  --state-focus: #4D90FE;
  --state-disabled: rgba(0, 0, 0, 0.2);

  /* Typography */
  --font-family: 'Inter', sans-serif;
  --font-size-xs: 12px;
  --font-size-sm: 14px;
  --font-size-md: 16px;
  --font-size-lg: 20px;
  --font-size-xl: 24px;
  --font-size-xxl: 32px;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 700;
  --line-height-tight: 1.2;
  --line-height-normal: 1.5;
  --line-height-loose: 1.75;

  /* HR */
  --hr-height: 1;

  /* Colors */
  --color-primary: #0199fe;
  --color-secondary: #ffff00;
  --offset-white: rgba(255, 255, 0, 0.1);

  --highlight: #3367d1;
  --highlight-text: #ffffff;

  --color-blue: #0056B3;
  --color-red: #B22222;
  --color-orange: #A45F00;
  --color-green: #1B5E20;
  --color-cyan: #007A99;
  --color-purple: #5A189A;
  --color-brown: #654321;
  --color-yellow: #81771E;
  --color-indigo: #3F2B96;
  --color-mint: #007F5F;
  --color-grey: hsl(0, 0%, 20%);
}

/* 🌙 Dark Theme */
[data-theme="dark"] {
  color-scheme: dark;

  --text-primary: #E0E0E0;
  --text-secondary: #B3B3B3;
  --text-muted: #A0A0A0;
  /* Improved contrast */
  --text-inverse: #1A1A1A;

  --bg-primary: #111111;
  --bg-secondary: #222222;
  --bg-surface: #1A1A1A;
  --bg-accent: #372d65;
  --bg-muted: #333333;
  --bg-inverse: #FFFFFF;

  --elevation-1: 0px 1px 3px rgba(0, 0, 0, 0.3);
  --elevation-2: 0px 3px 6px rgba(0, 0, 0, 0.4);
  --elevation-3: 0px 5px 10px rgba(0, 0, 0, 0.5);

  --border-primary: #444444;
  --border-secondary: #666666;

  --state-hover: rgba(255, 255, 255, 0.1);
  --state-focus: #4D90FE;
  --state-disabled: rgba(255, 255, 255, 0.2);

  --highlight: #0337a1;
  --highlight-text: #ffffff;

  --color-blue: #66B2FF;
  --color-red: #FF6655;
  --color-orange: #FF9800;
  --color-green: #66CC66;
  --color-cyan: #4DD0E1;
  --color-purple: #BB86FC;
  --color-brown: #C19A6B;
  --color-yellow: #FFD700;
  --color-indigo: #8A7BFF;
  --color-mint: #6AFFC3;
  --color-grey: hsl(0, 0%, 80%);
}


@media (max-width: 768px) {
  :root {
    /* 📱 Responsive Typography */
    --font-size-xs: 10px;
    --font-size-sm: 12px;
    --font-size-md: 14px;
    --font-size-lg: 18px;
    --font-size-xl: 20px;
    --font-size-xxl: 28px;

    /* 📱 Responsive Spacing */
    --space-xxs: 2px;
    --space-xs: 6px;
    --space-sm: 10px;
    --space-md: 14px;
    --space-lg: 20px;
    --space-xl: 28px;
    --space-xxl: 36px;
  }
}

@media (min-width: 1200px) {
  :root {
    --space-xxs: 6px;
    --space-xs: 10px;
    --space-sm: 14px;
    --space-md: 20px;
    --space-lg: 28px;
    --space-xl: 40px;
    --space-xxl: 50px;
  }
}

/* Box sizing border-box for all elements */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  min-width: 0;
  min-height: 0;
}

/* Set base font size and height */
html {
  font-size: 100%;
  height: 100%;
}


/* Remove default styles for block elements */
body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-size: var(--font-size-md);
}

/* Default list styles */
ul,
ol {
  list-style: disc;
  padding-left: var(--space-md);
  margin-bottom: var(--space-sm);
}

/* Add vertical space inside list items */
ul li,
ol li {
  padding: var(--space-xxs) 0;
}

/* Better text readability for multiline list items*/
li {
  line-height: 1.6;
}

/* Remove anchor text decoration */
a {
  text-decoration: none;
  color: var(--color-blue);
  cursor: pointer;
}

/* Visited links */
a:visited {
  color: var(--color-purple);
}

/* Remove default button styles */
button,
input,
textarea,
select {
  font: inherit;
  border: none;
  background: none;
}

/* Ensure images are responsive */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Reset tables */
table {
  border-collapse: collapse;
  width: 100%;
}

/* Set a consistent cursor for buttons */
button {
  cursor: pointer;
  border-radius: var(--border-radius-small);
  padding: var(--space-xs) var(--space-sm);
  background-color: var(--color-grey);
  color: var(--text-inverse);
  position: relative;
  width: fit-content;
  border: 1px solid var(--border-primary);
  display: flex;
  align-items: center;
}

/* Button overlay */
button:before {
  content: "";
  border-radius: var(--border-radius-small);
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  transition: background-color .3s;
}

/* Round button */
button.round {
  border-radius: 50%;
}

/* Round button overlay */
button.round::before {
  border-radius: 50%;
}

/* Button hover effect */
button:hover::before {
  background-color: var(--state-hover);
}

/* Active: Slightly scales down for a pressed effect */
button:active {
  transform-origin: center;
  transform: scale(0.98);
}

/* Change outline for all focusable elements */
*:focus-visible {
  outline: 2px solid var(--state-focus);
  box-shadow: 0 0 5px var(--state-focus);
}

/* Ensure consistent heading styles */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
}

/* Remove extra spacing at beginning */
h1:first-child {
  margin-top: var(--space-xs);
}

/* Prevent form elements from overflowing */
input,
textarea,
select {
  width: 100%;
}

/* Forms */
form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* Input */
select,
input {
  padding: var(--space-xs);
  font-size: var(--font-size-md);
  border: 2px solid var(--border-primary);
  border-radius: var(--border-radius-small);
  background-color: transparent;
  color: var(--text-primary);
}

/* Autofill Normalization */
input:-webkit-autofill {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  box-shadow: 0 0 0px 1000px var(--bg-secondary) inset !important;
}

/* Placeholder Styling */
input::placeholder {
  color: var(--text-muted);
  font-size: var(--font-size-md);
}

/* Disabled Input */
input:disabled {
  background-color: var(--bg-muted);
  cursor: not-allowed;
}

/* Error State */
input.error {
  border-color: var(--color-red);
  box-shadow: 0 0 var(--space-xxs) var(--color-red);
}

/* Label */
label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}

/* Style hr elements with responsive margins */
hr {
  border: none;
  border-top: var(--hr-height) solid var(--border-secondary);
  margin: var(--space-md) 0;
}

/* Space between repeated elements */
p+p {
  margin-top: var(--space-sm);
}