/* static/css/theme.css */

@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/Vazirmatn/fonts/webfonts/Vazirmatn[wght].woff2') format('woff2 supports variations'),
       url('../fonts/Vazirmatn/fonts/webfonts/Vazirmatn[wght].woff2') format('woff2-variations');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

html[data-theme="dark"] {
  --bg-dark: oklch(0.1 0 20);
  --bg: oklch(0.15 0 20);
  --bg-light: oklch(0.2 0 20);
  --text: oklch(0.96 0 20);
  --text-muted: oklch(0.76 0 20);
  --highlight: oklch(0.5 0 20);
  --border: oklch(0.4 0 20);
  --border-muted: oklch(0.3 0 20);
  --primary: oklch(0.76 0.1 20);
  --secondary: oklch(0.76 0.1 200);
  --danger: oklch(0.7 0.05 30);
  --warning: oklch(0.7 0.05 100);
  --success: oklch(0.7 0.05 160);
  --info: oklch(0.7 0.05 260);
}

html[data-theme="light"] {
  --bg-dark: oklch(0.92 0 20);
  --bg: oklch(0.96 0 20);
  --bg-light: oklch(1 0 20);
  --text: oklch(0.15 0 20);
  --text-muted: oklch(0.4 0 20);
  --highlight: oklch(1 0 20);
  --border: oklch(0.6 0 20);
  --border-muted: oklch(0.7 0 20);

  --primary: oklch(0.4 0.1 20);
  --secondary: oklch(0.4 0.1 200);
  --danger: #b00020;
  --warning: oklch(0.5 0.05 100);
  --success: oklch(0.5 0.05 160);
  --info: oklch(0.5 0.05 260);
}

@media (prefers-color-scheme: light) {
  html[data-theme="auto"] {
    --bg-dark: oklch(0.92 0 20);
    --bg: oklch(0.96 0 20);
    --bg-light: oklch(1 0 20);
    --text: oklch(0.15 0 20);
    --text-muted: oklch(0.4 0 20);
    --highlight: oklch(1 0 20);
    --border: oklch(0.6 0 20);
    --border-muted: oklch(0.7 0 20);

    --primary: oklch(0.4 0.1 20);
    --secondary: oklch(0.4 0.1 200);
    --danger: #b00020;
    --warning: oklch(0.5 0.05 100);
    --success: oklch(0.5 0.05 160);
    --info: oklch(0.5 0.05 260);
  }
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg-dark: oklch(0.1 0 20);
    --bg: oklch(0.15 0 20);
    --bg-light: oklch(0.2 0 20);
    --text: oklch(0.96 0 20);
    --text-muted: oklch(0.76 0 20);
    --highlight: oklch(0.5 0 20);
    --border: oklch(0.4 0 20);
    --border-muted: oklch(0.3 0 20);
    --primary: oklch(0.76 0.1 20);
    --secondary: oklch(0.76 0.1 200);
    --danger: oklch(0.7 0.05 30);
    --warning: oklch(0.7 0.05 100);
    --success: oklch(0.7 0.05 160);
    --info: oklch(0.7 0.05 260);
  }
}

/* ----------------- RESET ----------------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

* {
  -webkit-tap-highlight-color: transparent !important;
}


body, input, button, a {
  font-family: 'Vazirmatn', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
a {
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
ul { list-style: none; }

body {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.8;
  color: var(--text);
  background-color: var(--bg);
}
@media (max-width: 768px) {
  body {
    background-color: var(--bg-dark);
  }
  
}

/* directions */

/* Only affects the main content, not the navbar */
.rtl-content {
    direction: rtl;
    text-align: right;
}

.rtl-content p,
.rtl-content h1,
.rtl-content h2,
.rtl-content h3,
.rtl-content h4,
.rtl-content h5,
.rtl-content h6,
.rtl-content span,
.rtl-content div {
    direction: rtl;
    text-align: right;
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

/* ── Toast Messages ── */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--bg-light);
    background: var(--text);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateY(10px);
    animation: toast-in 0.3s ease forwards;
    pointer-events: auto;
    white-space: nowrap;
}

.toast--success {
    background: var(--success);
}

.toast--error {
    background: var(--danger);
}

.toast--warning {
    background: var(--warning);
}

.toast--info {
    background: var(--primary);
}

.toast.removing {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(10px);
    }
}