/* CV Family Portal - Improved Enhanced Styles */
@import url("enhanced-dark-mode.css");

:root {
  /* Modern Color Palette */
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --secondary-color: #8b5cf6;
  --success-color: #10b981;
  --info-color: #3b82f6;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --light-color: #f9fafb;
  --dark-color: #111827;
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-info: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  
  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--dark-color);
  line-height: 1.6;
  background-color: var(--light-color);
  transition: background-color var(--transition-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
  color: var(--dark-color);
}

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; }

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

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

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

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: var(--radius-md);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: var(--radius-md);
  border: 2px solid #f1f5f9;
}

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

/* Navigation */
.navbar {
  box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.95) !important;
  transition: all var(--transition-base);
  padding: var(--spacing-md) 0;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  color: var(--primary-color) !important;
}

.navbar-nav .nav-link {
  font-weight: 500;
  margin: 0 var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  color: #64748b;
}

.navbar-nav .nav-link:hover {
  background-color: rgba(99, 102, 241, 0.1);
  color: var(--primary-color);
}

.navbar-nav .nav-link.active {
  background-color: rgba(99, 102, 241, 0.15);
  color: var(--primary-color);
  font-weight: 600;
}

.dropdown-menu {
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: var(--shadow-lg);
  padding: var(--spacing-sm);
  margin-top: var(--spacing-sm);
}

.dropdown-item {
  border-radius: var(--radius-md);
  padding: var(--spacing-sm) var(--spacing-md);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.dropdown-item:hover {
  background-color: rgba(99, 102, 241, 0.1);
  color: var(--primary-color);
}

/* Hero Section */
.hero-section {
  background: var(--gradient-primary);
  padding: var(--spacing-2xl) 0;
  position: relative;
  overflow: hidden;
  color: white;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero-section .display-4 {
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin-bottom: var(--spacing-lg);
  animation: fadeInUp 0.8s ease-out;
}

.hero-section .lead {
  font-size: 1.25rem;
  margin-bottom: var(--spacing-xl);
  opacity: 0.95;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* Dashboard Header */
.dashboard-header {
  background: var(--gradient-primary);
  padding: var(--spacing-xl) 0;
  position: relative;
  overflow: hidden;
  color: white;
}

.dashboard-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%);
  pointer-events: none;
}

/* Cards */
.card {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  overflow: hidden;
  background: white;
}

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

.card-header {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-bottom: none;
  padding: var(--spacing-lg);
  font-weight: 600;
  background-color: white;
  border-bottom: 1px solid #f1f5f9;
}

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

.card-footer {
  background-color: #f9fafb;
  border-top: 1px solid #f1f5f9;
  padding: var(--spacing-md) var(--spacing-lg);
}

/* Stats Cards */
.stats-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.stats-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.stats-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-xl);
}

.stats-card .card-body {
  position: relative;
  z-index: 1;
}

.stats-card h2 {
  font-size: 2.5rem;
  font-weight: 800;
  margin: 0;
}

/* Buttons */
.btn {
  border-radius: var(--radius-md);
  font-weight: 600;
  padding: var(--spacing-sm) var(--spacing-lg);
  transition: all var(--transition-fast);
  border: none;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-outline-primary {
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--gradient-primary);
  border-color: transparent;
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.btn-success:hover {
  background: var(--success-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-info {
  background: var(--gradient-info);
  color: white;
}

.btn-info:hover {
  background: var(--info-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-warning {
  background: var(--gradient-warning);
  color: white;
}

.btn-warning:hover {
  background: var(--warning-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

.btn-danger:hover {
  background: var(--danger-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-light {
  background: white;
  color: var(--dark-color);
  border: 1px solid #e5e7eb;
}

.btn-light:hover {
  background: #f9fafb;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* Forms */
.form-control, .form-select {
  border-radius: var(--radius-md);
  border: 2px solid #e5e7eb;
  padding: var(--spacing-sm) var(--spacing-md);
  transition: all var(--transition-fast);
  background-color: white;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
  outline: none;
}

.form-control.is-invalid {
  border-color: var(--danger-color);
}

.form-control.is-invalid:focus {
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-label {
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: #374151;
}

.input-group-text {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background-color: #f9fafb;
  border: 2px solid #e5e7eb;
  border-right: none;
}

.input-group .form-control {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  border-left: none;
}

/* Tables */
.table {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table thead th {
  border-bottom: 2px solid var(--primary-color);
  background-color: #f9fafb;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  padding: var(--spacing-md);
}

.table tbody td {
  padding: var(--spacing-md);
  vertical-align: middle;
}

.table-hover tbody tr {
  transition: background-color var(--transition-fast);
}

.table-hover tbody tr:hover {
  background-color: rgba(99, 102, 241, 0.05);
}

/* Badges */
.badge {
  font-weight: 600;
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
}

/* Progress Bars */
.progress {
  height: 8px;
  border-radius: var(--radius-full);
  background-color: #e5e7eb;
  overflow: hidden;
}

.progress-bar {
  border-radius: var(--radius-full);
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes slideInLeft {
  from {
    transform: translateX(-30px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

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

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

.pulse {
  animation: pulse 2s infinite;
}

/* Profile Section */
.profile-header {
  background: var(--gradient-primary);
  color: white;
  position: relative;
  overflow: hidden;
  padding: var(--spacing-2xl) 0;
}

.profile-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 50%, rgba(255,255,255,0.1) 0%, transparent 60%);
  pointer-events: none;
}

.profile-header .rounded-circle {
  border: 4px solid white;
  box-shadow: var(--shadow-xl);
  transition: transform var(--transition-base);
}

.profile-header .rounded-circle:hover {
  transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
  
  .hero-section,
  .dashboard-header,
  .profile-header {
    padding: var(--spacing-xl) 0;
  }
  
  .card {
    margin-bottom: var(--spacing-md);
  }
  
  .stats-card h2 {
    font-size: 2rem;
  }
}

/* Loading States */
.spinner-border {
  border-width: 2px;
}

.spinner-border-sm {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}

/* Alert Notifications */
.alert-notification {
  animation: slideInLeft 0.3s ease-out;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --light-color: #1f2937;
    --dark-color: #f9fafb;
  }
}