:root {
  --primary-color: #2c5aa0;
  --secondary-color: #4a90e2;
  --accent-color: #f8f9fa;
  --text-color: #2c3e50;
  --text-muted: #6c757d;
  --border-color: #e9ecef;
  --shadow-light: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.15);
  --border-radius: 0.5rem;
  --transition: all 0.3s ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  margin: 0;
  padding: 0;
}

#content {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  box-shadow: var(--shadow-medium);
  border-radius: var(--border-radius);
  overflow: hidden;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

header {
  position: relative;
  overflow: hidden;
}

header img {
  display: block;
  border-radius: 0;
}

section {
  padding: 3rem 2rem;
  position: relative;
}

section:nth-of-type(even) {
  background: var(--accent-color);
}

section h2 {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  position: relative;
}

section h2::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--secondary-color);
  border-radius: 2px;
}

section h3 {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 1.8rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

section h4 {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 1.3rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

section h5 {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 1.1rem;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
}

section p {
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 1.25rem;
  color: var(--text-color);
}

section ul {
  padding-left: 1.5rem;
}

section li {
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
  color: var(--text-color);
}

#bio {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

#bio .bio-content {
  flex: 1;
}

#bio .bio-image {
  flex-shrink: 0;
  width: 200px;
}

#mugshot {
  width: 100%;
  height: auto;
  border-radius: 50%;
  box-shadow: var(--shadow-medium), 0 0 0 4px white, 0 0 0 6px var(--primary-color);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  object-fit: cover;
}

#mugshot:hover {
  transform: scale(1.05) rotate(2deg);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2), 0 0 0 4px white, 0 0 0 6px var(--secondary-color);
}

.bio-image {
  position: relative;
}

.bio-image::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--primary-color));
  border-radius: 50%;
  z-index: -1;
  opacity: 0.1;
  animation: rotate 20s linear infinite;
}

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

/* Course Cards Layout */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.course-card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-light);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

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

.course-card.featured {
  border: 2px solid var(--secondary-color);
  position: relative;
}

.course-card.featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.course-header {
  background: var(--accent-color);
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.course-header h4 {
  color: var(--primary-color);
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.3;
}

.course-duration {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 0.75rem;
}

.course-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--secondary-color);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.course-content {
  padding: 1.5rem;
}

.course-description {
  margin-bottom: 1.5rem;
}

.course-description p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-color);
  margin: 0;
}

.course-details h5 {
  color: var(--primary-color);
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.course-details p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.course-details ul {
  margin-bottom: 1rem;
}

.course-details li {
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.course-link {
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: 600;
}

.course-link:hover {
  text-decoration: underline;
}

.course-logo {
  margin-top: 1rem;
  text-align: center;
}

.course-logo img {
  max-width: 150px;
  height: auto;
}

/* FSPCA logo styling */
img[alt*="FSPCA"], img[alt*="FSCPCA"] {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto;
}

/* Enhanced focus styles for all interactive elements */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--secondary-color);
  outline-offset: 2px;
}

/* High contrast focus for form elements */
.form-control:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.5);
  outline: 2px solid var(--secondary-color);
  outline-offset: 2px;
}

/* Skip link for screen readers */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--primary-color);
  color: white;
  padding: 8px;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
  z-index: 1000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

.contact-form {
  max-width: 600px;
  margin: 0 auto;
}

.contact-form .form-group {
  margin-bottom: 1.5rem;
}

.contact-form label {
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  display: block;
}

.contact-form .form-control {
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: var(--transition);
  width: 100%;
}

.contact-form .form-control:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25);
  outline: none;
}

.contact-form textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

.contact-form .btn-primary {
  background: var(--primary-color);
  border: 2px solid var(--primary-color);
  color: white;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--border-radius);
  transition: var(--transition);
  cursor: pointer;
}

.contact-form .btn-primary:hover {
  background: var(--secondary-color);
  border-color: var(--secondary-color);
  transform: translateY(-1px);
}

.contact-form .btn-primary:active {
  transform: translateY(0);
}

.contact-info {
  background: var(--accent-color);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-top: 2rem;
  text-align: center;
}

.contact-info h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.contact-info p {
  margin-bottom: 0.5rem;
}

.contact-info a {
  color: var(--secondary-color);
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
}

.form-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  display: block;
}

.error-message {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: none;
}

.error-message.active {
  display: block;
}

.form-control.error {
  border-color: #dc3545;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

footer {
  background: var(--primary-color);
  color: white;
  padding: 2rem;
  text-align: center;
  margin-top: 0;
}

footer p {
  margin: 0;
  font-size: 0.95rem;
}

footer a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: var(--transition);
}

footer a:hover {
  color: white;
  text-decoration: underline;
}

@media (max-width: 992px) {
  #content {
    margin: 1rem;
  }
  
  section {
    padding: 2.5rem 2rem;
  }
  
  section h2 {
    font-size: 2.25rem;
  }
}

@media (max-width: 768px) {
  #content {
    margin: 0.5rem;
    border-radius: 0;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
  }
  
  section {
    padding: 2rem 1.5rem;
  }
  
  section h2 {
    font-size: 2rem;
  }
  
  section h3 {
    font-size: 1.5rem;
  }
  
  section h4 {
    font-size: 1.2rem;
  }
  
  #bio {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }
  
  #bio .bio-image {
    width: 150px;
    margin: 0 auto;
  }
  
  .courses-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .course-header {
    padding: 1.25rem;
  }
  
  .course-content {
    padding: 1.25rem;
  }
}

@media (max-width: 576px) {
  body {
    font-size: 14px;
  }
  
  #content {
    margin: 0;
    border-radius: 0;
  }
  
  section {
    padding: 1.5rem 1rem;
  }
  
  section h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
  }
  
  section h2::after {
    width: 40px;
    height: 3px;
  }
  
  section h3 {
    font-size: 1.3rem;
  }
  
  section h4 {
    font-size: 1.1rem;
  }
  
  section p, section li {
    font-size: 1rem;
    line-height: 1.6;
  }
  
  #bio .bio-image {
    width: 120px;
  }
  
  .courses-grid {
    gap: 1rem;
  }
  
  .course-header {
    padding: 1rem;
  }
  
  .course-header h4 {
    font-size: 1.1rem;
  }
  
  .course-content {
    padding: 1rem;
  }
  
  .course-description p {
    font-size: 1rem;
  }
  
  .course-details h5 {
    font-size: 0.95rem;
    margin-top: 1rem;
  }
  
  footer {
    padding: 1.5rem 1rem;
  }
  
  .contact-form .form-control {
    padding: 0.625rem 0.875rem;
    font-size: 16px;
  }
  
  .contact-form .btn-primary {
    padding: 0.75rem 1.5rem;
    width: 100%;
  }
  
  .contact-info {
    padding: 1.25rem;
  }
  
  /* FSPCA image mobile fix */
  img[alt*="FSPCA"], img[alt*="FSCPCA"] {
    max-width: 200px;
    margin: 0.75rem auto;
  }
}

@media (max-width: 400px) {
  section {
    padding: 1.25rem 0.75rem;
  }
  
  section h2 {
    font-size: 1.5rem;
  }
  
  section p, section li {
    font-size: 0.95rem;
  }
  
  .accordion .btn-link {
    padding: 0.75rem;
    font-size: 0.9rem;
  }
  
  /* FSPCA image very small screens */
  img[alt*="FSPCA"], img[alt*="FSCPCA"] {
    max-width: 160px;
    margin: 0.5rem auto;
  }
}
