/* 
  Main CSS Variables & Design System
  Based on the project requirements:
  - Dark Primary: #21242B
  - Accent Blue: #13B5F3
  - Dark Secondary: #121418
  - Background: White/Light off-white
*/

:root {
  /* Premium Dark Theme Palette */
  --primary-color: #21242b;
  --accent-color: #13b5f3;
  --secondary-color: #121418;
  --bg-color: #0f1115; /* Deeper dark for better contrast */
  --surface-color: #1a1c22;
  --white: #ffffff;
  --text-primary: #ededed;
  --text-secondary: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.08); /* Sophisticated thin border */
  --error-color: #ff5252;
  --success-color: #00e676;

  --font-main: "Tajawal", sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Global responsiveness safety net:
 * - max-width: 100% on every replaced element prevents an oversized
 *   image / video / iframe from forcing horizontal scroll on phones.
 * - height: auto keeps the aspect ratio whenever an `<img>` has only
 *   width or only height attributes (or none) and we constrain it
 *   via CSS later.
 * Marketing site has its own reset (`site/css/reset.css`); this
 * mirrors that policy inside the dashboard SPA. */
img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
  height: auto;
}
canvas,
iframe {
  /* Keep canvas/iframe explicit `height` attribute when JS sets it
   * (e.g. Chart.js). The `height: auto` above only applies if no
   * inline height is present. */
  display: block;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-primary);
  direction: rtl; /* Mandatory RTL */
  overflow-x: hidden;
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition-smooth);
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
  font-family: var(--font-main);
}

input,
select,
textarea {
  font-family: var(--font-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  outline: none;
  transition: var(--transition-smooth);
  width: 100%;
}

input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(19, 181, 243, 0.1);
}

/* Base utility classes */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hidden {
  display: none !important;
}

/* Custom Scrollbar for a modern look */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

/* Hide number input arrows */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Snackbar / Toast Notifications */
#snackbar-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 9999;
}

.snackbar {
  background: var(--surface-color);
  color: var(--text-primary);
  padding: 14px 24px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 320px;
  max-width: 90vw;
  animation: snackbar-in 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  transition: var(--transition-smooth);
}

.snackbar.success {
  border-left: 4px solid var(--success-color);
}

.snackbar.error {
  border-left: 4px solid var(--error-color);
}

.snackbar.info {
  border-left: 4px solid var(--accent-color);
}

.snackbar.fade-out {
  animation: snackbar-out 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes snackbar-in {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes snackbar-out {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(20px);
    opacity: 0;
  }
}
