/* ============================================
   CUSTOM COLOR SYSTEM
   Main Color: #4bb9ec
   ============================================ */

:root {
  /* Primary Brand Color */
  --primary: #4bb9ec;
  --primary-dark: #3a9fd4;
  --primary-light: #6bc8f5;
  --primary-hover: #3a9fd4;
  --primary-rgb: 75, 185, 236;
  
  /* Primary with opacity (for backgrounds) */
  --primary-50: rgba(75, 185, 236, 0.05);
  --primary-100: rgba(75, 185, 236, 0.1);
  --primary-200: rgba(75, 185, 236, 0.2);
  --primary-300: rgba(75, 185, 236, 0.3);
  --primary-500: rgba(75, 185, 236, 0.5);
  --primary-700: rgba(75, 185, 236, 0.7);
  --primary-800: rgba(75, 185, 236, 0.8);
  --primary-900: rgba(75, 185, 236, 0.9);
  
  /* Text Colors */
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --text-light: #d1d5db;
  --text-muted: #9ca3af;
  
  /* Background Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --bg-dark: #1f2937;
  
  /* Border Colors */
  --border-light: #e5e7eb;
  --border-default: #d1d5db;
  --border-dark: #9ca3af;
  
  /* Hover States */
  --hover-bg: #f3f4f6;
  --hover-text: #374151;
  
  /* Additional Colors for Chart/Data Visualization */
  --chart-primary: #4bb9ec;
  --chart-accent: #8b5cf6;
  --chart-success: #10b981;
  --chart-warning: #f59e0b;
  --chart-danger: #ef4444;
  
  /* Shadow */
  --shadow-sm: 0 1px 2px 0 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);
}

/* ============================================
   BASE STYLES
   ============================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 600;
}

p {
  color: var(--text-secondary);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
}

.btn-primary:active {
  opacity: 0.9;
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: var(--hover-bg);
}

.btn-outline {
  background-color: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background-color: var(--primary-50);
}

/* ============================================
   CARDS & CONTAINERS
   ============================================ */

.card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  padding: 1.5rem;
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 1rem;
  padding-bottom: 1rem;
}

/* ============================================
   INPUTS & FORM ELEMENTS
   ============================================ */

input, select, textarea {
  border: 1px solid var(--border-light);
  border-radius: 0.375rem;
  padding: 0.5rem 1rem;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-100);
}

input::placeholder {
  color: var(--text-tertiary);
}

/* ============================================
   PRIMARY COLOR UTILITIES
   ============================================ */

/* Text colors */
.text-primary {
  color: var(--primary);
}

.text-primary-hover:hover {
  color: var(--primary-dark);
}

/* Background colors */
.bg-primary {
  background-color: var(--primary);
}

.bg-primary-light {
  background-color: var(--primary-100);
}

.bg-primary-lighter {
  background-color: var(--primary-50);
}

/* Border colors */
.border-primary {
  border-color: var(--primary);
}

/* ============================================
   STATUS BADGES
   ============================================ */

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.badge-primary {
  background-color: var(--primary-100);
  color: var(--primary-dark);
}

.badge-success {
  background-color: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.badge-warning {
  background-color: rgba(245, 158, 11, 0.1);
  color: #d97706;
}

.badge-danger {
  background-color: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

/* ============================================
   PROGRESS BARS
   ============================================ */

.progress {
  width: 100%;
  height: 0.5rem;
  background-color: var(--border-light);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  background-color: var(--primary);
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s ease;
}

/* ============================================
   NAVIGATION
   ============================================ */

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}

.nav-link:hover {
  background-color: var(--hover-bg);
  color: var(--text-primary);
}

.nav-link.active {
  background-color: var(--primary);
  color: #ffffff;
}

/* ============================================
   LISTS & ACTIVITY INDICATORS
   ============================================ */

.activity-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background-color: var(--primary);
  display: inline-block;
  margin-top: 0.25rem;
}

.activity-dot-accent {
  background-color: var(--chart-accent);
}

/* ============================================
   TABLES
   ============================================ */

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background-color: var(--bg-tertiary);
}

th {
  padding: 0.75rem 1.5rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-light);
}

td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
}

tbody tr:hover {
  background-color: var(--bg-secondary);
}

/* ============================================
   DROPDOWN & POPOVER
   ============================================ */

.dropdown {
  position: absolute;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-lg);
  z-index: 50;
}

.dropdown a, .dropdown button {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  text-align: left;
  color: var(--text-primary);
  transition: all 0.2s ease;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.875rem;
}

.dropdown a:hover, .dropdown button:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

/* ============================================
   ANIMATIONS
   ============================================ */

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden {
  display: none !important;
}

.flex {
  display: flex;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

.transition-colors {
  transition: color, background-color, border-color 0.2s ease;
}

.transition-shadow {
  transition: box-shadow 0.2s ease;
}

.rounded-lg {
  border-radius: 0.5rem;
}

.rounded-full {
  border-radius: 9999px;
}

.space-y-3 > * + * {
  margin-top: 0.75rem;
}

.space-y-4 > * + * {
  margin-top: 1rem;
}

.space-y-6 > * + * {
  margin-top: 1.5rem;
}

.w-full {
  width: 100%;
}

.h-2 {
  height: 0.5rem;
}

.h-8 {
  height: 2rem;
}

.h-12 {
  height: 3rem;
}

.w-2 {
  width: 0.5rem;
}

.w-8 {
  width: 2rem;
}

.w-12 {
  width: 3rem;
}

.mt-1 {
  margin-top: 0.25rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-4 {
  margin-top: 1rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-6 {
  margin-bottom: 1.5rem;
}

.pb-2 {
  padding-bottom: 0.5rem;
}

.pb-3 {
  padding-bottom: 0.75rem;
}

.pt-4 {
  padding-top: 1rem;
}

.px-3 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.py-1 {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.text-xs {
  font-size: 0.75rem;
}

.text-sm {
  font-size: 0.875rem;
}

.text-lg {
  font-size: 1.125rem;
}

.text-2xl {
  font-size: 1.5rem;
}

.text-3xl {
  font-size: 1.875rem;
}

.text-gray-500 {
  color: var(--text-tertiary);
}

.text-gray-600 {
  color: var(--text-secondary);
}

.text-gray-900 {
  color: var(--text-primary);
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.tracking-tight {
  letter-spacing: -0.02em;
}

.opacity-75 {
  opacity: 0.75;
}

.line-through {
  text-decoration: line-through;
}

.min-w-0 {
  min-width: 0;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

@media (max-width: 768px) {
  .hidden-mobile {
    display: none;
  }
}

@media (min-width: 768px) {
  .hidden-desktop {
    display: none;
  }
}

/* ============================================
   CUSTOM COLOR CLASSES (co- prefix)
   ============================================ */

/* Primary Color Classes */
.co-bg-primary {
  background-color: var(--primary);
}

.co-bg-primary-dark {
  background-color: var(--primary-dark);
}

.co-bg-primary-light {
  background-color: var(--primary-100);
}

.co-bg-primary-50 {
  background-color: var(--primary-50);
}

.co-text-primary {
  color: var(--primary);
}

.co-text-primary-dark {
  color: var(--primary-dark);
}

.co-text-white {
  color: #ffffff;
}

.co-text-danger {
  color: #ef4444;
}

.co-border-primary-light {
  border-color: var(--primary-100);
}

.co-border-primary {
  border-color: var(--primary);
}

/* Accent/Secondary Colors */
.co-bg-accent {
  background-color: var(--chart-accent);
}

.co-bg-accent-light {
  background-color: rgba(139, 92, 246, 0.1);
}

.co-text-accent {
  color: var(--chart-accent);
}

/* Warning/Status Colors */
.co-bg-warning-light {
  background-color: rgba(245, 158, 11, 0.1);
}

.co-border-warning-light {
  border-color: rgba(245, 158, 11, 0.2);
}

.co-text-warning {
  color: #f59e0b;
}

/* Hover States with Color */
.co-hover-bg-primary-dark:hover {
  background-color: var(--primary-dark);
}

.co-hover-bg-primary-light:hover {
  background-color: var(--primary-100);
}

.co-hover-text-primary-dark:hover {
  color: var(--primary-dark);
}

.co-hover-text-primary:hover {
  color: var(--primary);
}

/* Focus States with Color */
.co-focus-ring-primary:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-100);
  border-color: var(--primary);
}

/* Combined Classes for Common Patterns */
.co-button-primary {
  background-color: var(--primary);
  color: #ffffff;
  transition: all 0.2s ease;
}

.co-button-primary:hover {
  background-color: var(--primary-dark);
}

.co-badge-primary {
  background-color: var(--primary-100);
  color: var(--primary-dark);
}

/* ============================================
   MODERN UI ENHANCEMENTS
   ============================================ */

/* Larger modern radius */
.rounded-xl {
  border-radius: 0.75rem;
}

.rounded-2xl {
  border-radius: 1rem;
}

/* Premium card feel */
.card-modern {
  background-color: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.04);
  transition: all 0.25s ease;
}

.card-modern:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(var(--primary-rgb), 0.08);
}

/* Elevated primary button */
.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  box-shadow: 0 6px 18px rgba(var(--primary-rgb), 0.4);
  transform: translateY(-1px);
}

/* Smooth transitions globally */
button,
.card,
input,
select,
textarea {
  transition: all 0.2s ease;
}
