/**
 * Unity Hub Design System
 * Extracted from Momentum Hub's Tailwind configuration
 * Vanilla CSS with no build step required
 */

/* ============================================================================
   CSS Custom Properties (Design Tokens)
   ========================================================================== */

:root {
  /* Ocean Blues (Primary) */
  --ocean-50: #e6f3f8;
  --ocean-100: #cce7f1;
  --ocean-200: #99cfe3;
  --ocean-300: #66b7d5;
  --ocean-400: #339fc7;
  --ocean-500: #0087b9;
  --ocean-600: #006c94;
  --ocean-700: #00516f;
  --ocean-800: #00364a;
  --ocean-900: #11607d;

  /* Aqua/Teal (Accents) */
  --aqua-50: #e6faf9;
  --aqua-100: #ccf5f3;
  --aqua-200: #99ebe7;
  --aqua-300: #66e1db;
  --aqua-400: #33d7cf;
  --aqua-500: #00cdc3;
  --aqua-600: #00a49c;
  --aqua-700: #007b75;
  --aqua-800: #00524e;
  --aqua-900: #002927;

  /* Graystone (Neutrals) */
  --graystone-50: #f8f9fa;
  --graystone-100: #f1f3f5;
  --graystone-200: #e9ecef;
  --graystone-300: #dee2e6;
  --graystone-400: #ced4da;
  --graystone-500: #adb5bd;
  --graystone-600: #868e96;
  --graystone-700: #495057;
  --graystone-800: #343a40;
  --graystone-900: #212529;

  /* Typography */
  --font-body: "Neue Haas Grotesk Display Pro", "Helvetica Neue", Arial, sans-serif;
  --font-heading: Impact, "Arial Black", Arial, sans-serif;

  /* Spacing Scale (4px base) */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */

  /* Border Radius */
  --radius-sm: 0.25rem;    /* 4px */
  --radius-md: 0.375rem;   /* 6px */
  --radius-lg: 0.5rem;     /* 8px */
  --radius-xl: 0.75rem;    /* 12px */
  --radius-2xl: 1rem;      /* 16px */
  --radius-full: 9999px;

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

  /* Background color */
  --bg-body: #cfebf8;
  --bg-surface: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: var(--graystone-600);
}

/* ============================================================================
   Base Styles
   ========================================================================== */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  letter-spacing: -0.01em;
  word-break: normal;
  overflow-wrap: break-word;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: var(--space-4);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

a {
  color: var(--ocean-600);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--ocean-700);
  text-decoration: underline;
}

/* ============================================================================
   Layout Utilities
   ========================================================================== */

.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.grid {
  display: grid;
  gap: var(--space-4);
}

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.flex {
  display: flex;
}

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

.flex-wrap {
  flex-wrap: wrap;
}

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

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

.justify-center {
  justify-content: center;
}

.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ============================================================================
   Button Components
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: var(--ocean-500);
  color: white;
  border-color: var(--ocean-600);
}

.btn-primary:hover {
  background: var(--ocean-600);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--graystone-100);
  color: var(--graystone-900);
  border-color: var(--graystone-300);
}

.btn-secondary:hover {
  background: var(--graystone-200);
  box-shadow: var(--shadow-md);
}

.btn-ghost {
  background: transparent;
  color: var(--ocean-600);
}

.btn-ghost:hover {
  background: var(--ocean-50);
}

.btn-danger {
  background: #dc2626;
  color: white;
  border-color: #b91c1c;
}

.btn-danger:hover {
  background: #b91c1c;
  box-shadow: var(--shadow-md);
}

.btn-pill {
  border-radius: var(--radius-full);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: 0.75rem;
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: 1rem;
}

/* ============================================================================
   Card Components
   ========================================================================== */

.card {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

.card-hover:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-header {
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--graystone-200);
  margin-bottom: var(--space-4);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0;
}

.floating-panel {
  background: var(--bg-surface);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-xl);
  max-width: 500px;
  width: 100%;
}

/* ============================================================================
   Form Components
   ========================================================================== */

.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--graystone-700);
  margin-bottom: var(--space-2);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: 0.875rem;
  border: 1px solid var(--graystone-300);
  border-radius: var(--radius-md);
  background: white;
  transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--ocean-500);
  box-shadow: 0 0 0 3px rgba(0, 135, 185, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--graystone-400);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-checkbox {
  width: 1rem;
  height: 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* ============================================================================
   Table Components
   ========================================================================== */

.table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  box-shadow: var(--shadow);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table thead {
  background: var(--graystone-50);
  border-bottom: 2px solid var(--graystone-200);
}

.table th {
  padding: var(--space-4);
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--graystone-700);
}

.table td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--graystone-200);
}

.table tbody tr:hover {
  background: var(--graystone-50);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================================================
   Badge Components
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-primary {
  background: var(--ocean-100);
  color: var(--ocean-700);
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-error {
  background: #fee2e2;
  color: #991b1b;
}

/* ============================================================================
   Spacing Utilities
   ========================================================================== */

.p-0 { padding: 0; }
.p-2 { padding: var(--space-2); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-6 { padding-left: var(--space-6); padding-right: var(--space-6); }
.py-2 { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

.m-0 { margin: 0; }
.m-2 { margin: var(--space-2); }
.m-4 { margin: var(--space-4); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }

/* ============================================================================
   Text Utilities
   ========================================================================== */

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

.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-ocean { color: var(--ocean-600); }

/* ============================================================================
   Utility Classes
   ========================================================================== */

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: var(--radius-full); }

.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.cursor-pointer { cursor: pointer; }

/* ============================================================================
   Loading Spinner
   ========================================================================== */

.spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--ocean-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* ============================================================================
   Custom Scrollbar
   ========================================================================== */

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--graystone-100);
}

::-webkit-scrollbar-thumb {
  background: var(--graystone-400);
  border-radius: var(--radius-full);
  border: 3px solid var(--graystone-100);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--graystone-500);
}

/* ============================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 768px) {
  .container {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }

  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: 1fr;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  .btn {
    padding: var(--space-2) var(--space-4);
    font-size: 0.8125rem;
  }
}

@media (min-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .lg\:grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ============================================================================
   Print Styles
   ========================================================================== */

@media print {
  .no-print {
    display: none !important;
  }
}
