/* ============================================
   Revive & Thrive Tech - Modern Responsive CSS
   ============================================ */

:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #3b82f6;
  --secondary: #10b981;
  --secondary-dark: #059669;
  --secondary-light: #34d399;
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --danger-light: #f87171;
  --warning: #f59e0b;
  --warning-dark: #d97706;
  --warning-light: #fbbf24;
  --success: #10b981;
  --success-dark: #059669;
  --success-light: #34d399;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --text: #1f2937;
  --text-light: #6b7280;
  --bg: #f9fafb;
  --bg-dark: #ffffff;
  --border: #e5e7eb;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
  --radius: 8px;
  --radius-lg: 12px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================
   Typography
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--gray-900);
}

h1 {
  font-size: 2.5rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 2rem;
  letter-spacing: -0.015em;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-light);
}

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

a:hover {
  color: var(--primary-dark);
}

/* ============================================
   Header & Navigation
   ============================================ */

header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 1.5rem 0;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.brand {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.02em;
}

.brand span {
  color: var(--warning);
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a {
  color: white;
  font-weight: 500;
  transition: opacity 0.2s;
  font-size: 0.95rem;
}

.nav-links a:hover {
  opacity: 0.8;
  color: white;
}

/* ============================================
   Main Content
   ============================================ */

main {
  min-height: calc(100vh - 200px);
  padding: 2rem 0;
}

.section {
  margin-bottom: 3rem;
  animation: fadeIn 0.3s ease-in;
}

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

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ============================================
   Hero Section
   ============================================ */

.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 4rem 0;
  border-radius: var(--radius-lg);
  text-align: center;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
}

.hero h1 {
  color: white;
  margin-bottom: 1rem;
  font-size: 2.5rem;
}

.hero p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* ============================================
   Cards & Stats
   ============================================ */

.card {
  background: var(--bg-dark);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  margin-bottom: 1.5rem;
}

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

.card h2, .card h3 {
  margin-top: 0;
  color: var(--gray-900);
}

.card p {
  margin-bottom: 0.5rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-dark);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  display: flex;
  gap: 1rem;
  align-items: center;
  border-left: 4px solid var(--primary);
  transition: all 0.3s ease;
}

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

.stat-icon {
  font-size: 2.5rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-light);
  margin: 0;
}

.stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

/* Card Container */
.card-container, .cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* ============================================
   Forms
   ============================================ */

.form {
  background: var(--bg-dark);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.field-group {
  display: flex;
  flex-direction: column;
}

label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--gray-700);
  font-size: 0.95rem;
}

input, select, textarea {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

/* ============================================
   Buttons
   ============================================ */

.button, button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.button-primary, button[type="submit"] {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}

.button-primary:hover, button[type="submit"]:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.button-secondary {
  background: var(--gray-200);
  color: var(--gray-900);
}

.button-secondary:hover {
  background: var(--gray-300);
}

.button-danger {
  background: var(--danger);
  color: white;
}

.button-danger:hover {
  background: var(--danger-dark);
}

.button-success {
  background: var(--success);
  color: white;
}

.button-success:hover {
  background: var(--success-dark);
}

.button-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   Alerts
   ============================================ */

.alert {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: slideDown 0.3s ease;
}

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

.alert.success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(52, 211, 153, 0.1) 100%);
  border-left: 4px solid var(--success);
  color: var(--success-dark);
}

.alert.error {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(248, 113, 113, 0.1) 100%);
  border-left: 4px solid var(--danger);
  color: var(--danger-dark);
}

.alert.warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(251, 191, 36, 0.1) 100%);
  border-left: 4px solid var(--warning);
  color: var(--warning-dark);
}

/* ============================================
   Tables
   ============================================ */

.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-dark);
}

.table thead {
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
}

.table th {
  padding: 1rem;
  text-align: left;
  font-weight: 700;
  color: var(--gray-900);
  border-bottom: 2px solid var(--border);
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
}

.table tbody tr {
  transition: background 0.2s;
}

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

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

/* ============================================
   Tags & Badges
   ============================================ */

.tag {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
}

.tag-success {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success-dark);
  border: 1px solid var(--success-light);
}

.tag-danger {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger-dark);
  border: 1px solid var(--danger-light);
}

.tag-warning {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning-dark);
  border: 1px solid var(--warning-light);
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

.badge-success {
  background: var(--success-light);
  color: white;
}

.badge-warning {
  background: var(--warning-light);
  color: white;
}

.badge-danger {
  background: var(--danger-light);
  color: white;
}

/* ============================================
   Filters
   ============================================ */

.filters {
  margin-bottom: 2rem;
}

.filter-form {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--bg-dark);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.filter-form input, .filter-form select {
  flex: 1;
  min-width: 150px;
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-dark);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border);
  color: var(--text-light);
}

.empty-state p {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

/* ============================================
   Footer
   ============================================ */

footer {
  background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 100%);
  color: white;
  padding: 2rem 0;
  text-align: center;
  margin-top: 4rem;
}

footer p {
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
  h1 {
    font-size: 1.875rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .hero {
    padding: 2rem 0;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .nav-links {
    gap: 1rem;
    font-size: 0.9rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .form {
    padding: 1.5rem;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .filter-form {
    flex-direction: column;
  }

  .filter-form input, .filter-form select {
    width: 100%;
  }

  .table {
    font-size: 0.875rem;
  }

  .table th, .table td {
    padding: 0.75rem;
  }

  .button {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }

  h1 {
    font-size: 1.5rem;
  }

  .card-container, .cards {
    grid-template-columns: 1fr;
  }

  .nav-links {
    flex-direction: column;
    gap: 0.5rem;
  }

  .nav-links a {
    padding: 0.5rem 0;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions .button {
    width: 100%;
    justify-content: center;
  }
}