/* Modern EMR Discovery Canada Styling */

/* CSS Custom Properties for consistent theming */
:root {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary-color: #10b981;
  --accent-color: #f59e0b;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --background-light: #ffffff;
  --background-gray: #f8fafc;
  --background-dark: #f1f5f9;
  --gradient-primary: linear-gradient(135deg, #2563eb 0%, #10b981 100%);
  --gradient-secondary: linear-gradient(135deg, #1e3a8a 0%, #1f2937 100%);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --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);
  --border-radius: 8px;
  --border-radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  width: 100%;
  height: 100%;
}

body {
  width: 100%;
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--background-light);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography Improvements */
h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h3 {
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

p {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* Modern Navigation */
.navbar-default {
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: none;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.navbar-default.top-nav-collapse {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-md);
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--primary-color) !important;
  transition: var(--transition);
}

.navbar-brand:hover {
  color: var(--primary-dark) !important;
  transform: translateY(-1px);
}

.navbar-default .navbar-nav > li > a {
  color: var(--text-primary) !important;
  font-weight: 500;
  font-size: 1rem;
  padding: 15px 20px !important;
  transition: var(--transition);
  border-radius: var(--border-radius);
  margin: 0 5px;
}

.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
  color: var(--primary-color) !important;
  background-color: var(--background-gray) !important;
  transform: translateY(-2px);
}

/* Modern Button Styles */
.btn-primary {
  background: var(--gradient-primary);
  border: none;
  padding: 12px 32px;
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  text-transform: none;
  letter-spacing: 0.025em;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(135deg, #1d4ed8 0%, #059669 100%);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Section Styling */
.section-modern {
  padding: 120px 0;
  position: relative;
  overflow: hidden;
}

.section-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0.05;
  background-image: 
    radial-gradient(circle at 20% 50%, var(--primary-color) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, var(--secondary-color) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, var(--accent-color) 0%, transparent 50%);
  pointer-events: none;
}

/* Welcome Section */
.welcome-section {
  background: var(--gradient-secondary);
  color: white;
  text-align: center;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  position: relative;
}

.welcome-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 30% 20%, rgba(37, 99, 235, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 70% 80%, rgba(16, 185, 129, 0.2) 0%, transparent 50%);
  pointer-events: none;
}

.welcome-section .container {
  position: relative;
  z-index: 1;
}

.welcome-section h1 {
  color: white;
  background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 2rem;
}

.welcome-section h3 {
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  margin-bottom: 3rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* About Section */
.about-section {
  background: var(--background-light);
  padding: 120px 0;
}

.about-section .container {
  max-width: 1000px;
}

/* What We Do Section */
.whatwedo-section {
  background: var(--background-gray);
  padding: 120px 0;
}

.service-item {
  margin-bottom: 2rem;
  padding: 2rem;
  background: white;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border-left: 4px solid var(--primary-color);
}

.service-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.service-item h3 {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 1rem;
}

.service-item h3 u {
  text-decoration: none;
  color: var(--primary-color);
  font-weight: 700;
  display: block;
  margin-bottom: 0.5rem;
}

/* Contact Section */
.contact-section {
  background: linear-gradient(135deg, var(--background-dark) 0%, var(--background-gray) 100%);
  padding: 120px 0;
}

.contact-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.contact-item {
  background: white;
  padding: 2rem;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: var(--transition);
}

.contact-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.contact-item u {
  text-decoration: none;
  font-weight: 700;
  color: var(--primary-color);
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1.125rem;
}

/* Back to Top Button */
#back2Top {
  width: 50px;
  height: 50px;
  line-height: 50px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
  display: none;
  cursor: pointer;
  text-align: center;
  font-size: 20px;
  text-decoration: none;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  transform: rotate(270deg);
}

#back2Top:hover {
  transform: rotate(270deg) translateY(-3px);
  box-shadow: var(--shadow-lg);
  color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
  .section-modern {
    padding: 80px 0;
  }
  
  .welcome-section {
    padding-top: 100px;
    text-align: center;
  }
  
  .about-section,
  .whatwedo-section,
  .contact-section {
    text-align: center;
    padding: 80px 0;
  }
  
  .service-item {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
  }
  
  .contact-info {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .navbar-default .navbar-nav > li > a {
    padding: 10px 15px !important;
    margin: 2px 0;
  }
}

@media (min-width: 767px) {
  .navbar {
    padding: 20px 0;
    transition: var(--transition);
  }
  
  .top-nav-collapse {
    padding: 10px 0;
  }
}

/* Animation for smooth loading */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Add some visual interest with subtle patterns */
.pattern-dots::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(circle, var(--primary-color) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.05;
  pointer-events: none;
}

.contact-item p {
  color: var(--text-secondary);
  margin: 0;
}

.contact-item a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

.contact-item a:hover {
  color: var(--primary-color);
  text-decoration: none;
}

/* Focus styles for accessibility */
.btn-primary:focus,
.page-scroll:focus,
#back2Top:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .fade-in-up {
    animation: none;
  }
  
  html {
    scroll-behavior: auto;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --primary-color: #0000ff;
    --text-primary: #000000;
    --text-secondary: #000000;
    --background-light: #ffffff;
  }
}

/* Service section conclusion */
.service-conclusion {
  margin-top: 3rem;
  text-align: center;
}