/* 
 * Global Design System and Reset
 * Replaces tailwind base and defines variables
 */

:root {
  /* Colors */
  --color-primary: #38bdf8;
  --color-primary-hover: #0ea5e9;
  
  /* Slate palette for grays */
  --color-slate-50: #f8fafc;
  --color-slate-100: #f1f5f9;
  --color-slate-200: #e2e8f0;
  --color-slate-300: #cbd5e1;
  --color-slate-400: #94a3b8;
  --color-slate-500: #64748b;
  --color-slate-600: #475569;
  --color-slate-700: #334155;
  --color-slate-800: #1e293b;
  --color-slate-900: #0f172a;

  /* Semantic Colors */
  --bg-body: var(--color-slate-50);
  --text-body: var(--color-slate-900);
  --bg-card: #ffffff;
  --border-color: var(--color-slate-200);

  /* Alert colors */
  --color-error-bg: #fee2e2;
  --color-error-text: #b91c1c;
  --color-success-bg: #dcfce7;
  --color-success-text: #15803d;

  --app-header-height: 6rem;
}

html.dark {
  --bg-body: var(--color-slate-900);
  --text-body: var(--color-slate-100);
  --bg-card: var(--color-slate-800);
  --border-color: var(--color-slate-700);

  --color-error-bg: rgba(127, 29, 29, 0.3);
  --color-error-text: #f87171;
  --color-success-bg: rgba(20, 83, 45, 0.3);
  --color-success-text: #4ade80;
}

@media (max-width: 767px) {
  :root {
    --app-header-height: 9rem;
  }
}

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

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: 100%;
}

img {
  max-width: 100%;
  display: block;
  /* ---- Image Protection: prevent selection, drag, and mobile callout ---- */
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-drag: none;
}

/* Protection for elements with background images */
[style*="background-image"] {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Common Layout Utilities */
.page-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

.layout-container {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  height: 100%;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: calc(var(--app-header-height) + 1rem) 1rem 2rem 1rem;
}

@media (min-width: 1024px) {
  .main-content {
    padding-left: 2.5rem; /* lg:px-10 */
    padding-right: 2.5rem;
  }
}

/* Buttons */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background-color: var(--color-primary);
  color: #ffffff;
  padding: 0 1.5rem;
  height: 2.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
}

.btn-primary:disabled,
.btn-primary.cursor-not-allowed {
  opacity: 0.9;
  cursor: not-allowed;
}

/* Material Icons */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Hidden Utility */
.hidden {
  display: none !important;
}
