/* ==========================================================================
   main.css — CSS Custom Properties, Reset, Layout, Typography
   UMPortal — Phase 7 Frontend
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties (DESIGN.md Section 8)
   -------------------------------------------------------------------------- */
:root {
  /* Colors */
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-danger: #dc2626;
  --color-danger-hover: #b91c1c;
  --color-success: #16a34a;
  --color-success-hover: #15803d;
  --color-warning: #d97706;
  --color-warning-hover: #b45309;
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #1e293b;
  --color-text-secondary: #64748b;
  --color-border: #e2e8f0;
  --color-sidebar: #2563eb;
  --color-sidebar-hover: #1d4ed8;
  --color-sidebar-active: #1e40af;

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;

  /* Borders */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;

  /* Sidebar */
  --sidebar-width: 260px;
  --header-height: 60px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

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

input,
button,
textarea,
select {
  font: inherit;
}

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

ul,
ol {
  list-style: none;
}

/* --------------------------------------------------------------------------
   Layout Utilities
   -------------------------------------------------------------------------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-sm {
  gap: var(--spacing-sm);
}

.gap-md {
  gap: var(--spacing-md);
}

.gap-lg {
  gap: var(--spacing-lg);
}

.w-full {
  width: 100%;
}

.text-center {
  text-align: center;
}

/* --------------------------------------------------------------------------
   Spacing Utilities
   -------------------------------------------------------------------------- */
.mt-sm {
  margin-top: var(--spacing-sm);
}

.mt-md {
  margin-top: var(--spacing-md);
}

.mt-lg {
  margin-top: var(--spacing-lg);
}

.mb-sm {
  margin-bottom: var(--spacing-sm);
}

.mb-md {
  margin-bottom: var(--spacing-md);
}

.mb-lg {
  margin-bottom: var(--spacing-lg);
}

.p-md {
  padding: var(--spacing-md);
}

.p-lg {
  padding: var(--spacing-lg);
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
.h1 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  line-height: 1.3;
}

.h2 {
  font-size: var(--font-size-xl);
  font-weight: 600;
  line-height: 1.4;
}

.h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  line-height: 1.4;
}

.h4 {
  font-size: var(--font-size-base);
  font-weight: 600;
  line-height: 1.5;
}

.text-muted {
  color: var(--color-text-secondary);
}

.text-danger {
  color: var(--color-danger);
}

.text-success {
  color: var(--color-success);
}

/* --------------------------------------------------------------------------
   Visibility
   -------------------------------------------------------------------------- */
.hidden {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Responsive — Tablet (max-width: 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .container {
    padding: 0 var(--spacing-md);
  }
}

/* --------------------------------------------------------------------------
   Responsive — Mobile (max-width: 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .container {
    padding: 0 var(--spacing-sm);
  }

  .h1 {
    font-size: var(--font-size-xl);
  }

  .h2 {
    font-size: var(--font-size-lg);
  }
}
