/* Global Styles */
:root {
  --primary-color: #0056b3;
  --secondary-color: #00356f;
  --accent-color: #e0f0ff;
  --light-gray: #f5f5f5;
  --medium-gray: #e0e0e0;
  --dark-gray: #333333;
  --text-color: #222222;
  --white: #ffffff;
  --shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

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

body {
  font-family: 'Arial', sans-serif;
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
}

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

h1, h2, h3, h4, h5, h6 {
  margin-bottom: 0.5em;
  font-weight: 600;
  line-height: 1.3;
  color: var(--secondary-color);
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin-bottom: 1rem;
}

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

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

img {
  max-width: 100%;
  height: auto;
}

section {
  padding: 3rem 0;
}

/* Button Styles */
.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border-radius: 4px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

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

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

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

.btn-secondary:hover {
  background-color: var(--accent-color);
}

/* Header & Navigation */
header {
  background-color: var(--white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo {
  height: 80px; /* Fixed height */
  width: auto; /* Let width adjust proportionally */
}

.desktop-nav {
  display: none;
}

.nav-link {
  margin: 0 1rem;
  color: var(--gray-700);
  position: relative;
}

.nav-link:hover {
  color: var(--primary-color);
}

.mobile-menu-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-700);
}

.mobile-menu-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-700);
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100vh;
  background-color: var(--white);
  z-index: 200;
  transition: right 0.3s ease;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
}

.mobile-menu.active {
  right: 0;
}

.mobile-nav {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.mobile-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.mobile-logo {
  margin-bottom: 0;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.mobile-nav-links .nav-link {
  font-size: 1.2rem;
  margin: 0;
  padding: 0.5rem 0;
}

@media (min-width: 768px) {
  .desktop-nav {
    display: flex;
  }
  
  .mobile-menu-button {
    display: none;
  }
  
  .mobile-menu {
    width: 350px;
  }
}

/* Hero Section */
.hero {
  position: relative;
  height: 70vh;
  background-size: cover;
  background-position: center;
  color: var(--white);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: 2rem;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--white);
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

/* Features Section */
.features {
  background-color: var(--light-gray);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.feature-card {
  background-color: var(--white);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

/* About Section */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  align-items: center;
}

/* Services Section */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.service-card {
  background-color: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.service-img {
  height: 200px;
  width: 100%;
  object-fit: cover;
}

.service-content {
  padding: 1.5rem;
}

.text-center {
  text-align: center;
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    /* Remove fixed height to allow images to maintain their aspect ratio */
    height: auto;
    background-color: var(--white);
    box-shadow: var(--shadow);
    cursor: pointer;
}

.gallery-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: var(--transition);
    display: block;
}

.gallery-item:hover .gallery-image {
    transform: scale(1.05);
}

/* PDF Resources Grid */
.pdf-resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.pdf-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    background-color: var(--white);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.pdf-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.pdf-icon {
    width: 80px;
    height: auto;
    margin-bottom: 1rem;
}

.pdf-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.download-btn {
    margin-top: 0.5rem;
    color: var(--primary-color);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.download-btn i {
    font-size: 0.9rem;
}

.download-btn:hover {
    color: var(--secondary-color);
}

/* Lightbox for Images */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
}

.lightbox img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1001;
}

/* Media queries for PDF grid */
@media (max-width: 768px) {
    .pdf-resources-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 576px) {
    .pdf-resources-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 1rem;
    }
    
    .pdf-icon {
        width: 60px;
    }
    
    .pdf-title {
        font-size: 0.8rem;
    }
}

/* Additional utility classes */
.rounded-img {
  border-radius: 8px;
  width: 100%;
  height: auto;
}

/* Contact Form */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.contact-info {
  background-color: var(--accent-color);
  padding: 2rem;
  border-radius: 8px;
}

.info-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.info-icon {
  margin-right: 1rem;
  color: var(--primary-color);
  font-size: 1.2rem;
}

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

.contact-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--medium-gray);
  border-radius: 4px;
  font-family: inherit;
}

.contact-form textarea {
  height: 150px;
  resize: vertical;
}

/* Appointment Form */
.appointment-form {
  max-width: 800px;
  margin: 0 auto;
  background-color: var(--white);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

/* Footer */
footer {
  background-color: var(--secondary-color);
  color: var(--white);
  padding: 3rem 0 1rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-logo {
  filter: brightness(0) invert(1);
  height: 80px;
  width: auto;
  margin-bottom: 1rem;
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-icon {
  display: inline-block;
  width: 40px;
  height: 40px;
  background-color: var(--white);
  border-radius: 50%;
  color: var(--secondary-color);
  text-align: center;
  line-height: 40px;
  transition: var(--transition);
}

.social-icon:hover {
  background-color: var(--accent-color);
  transform: translateY(-3px);
}

.copyright {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Media Queries */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  .hero {
    height: 60vh;
  }

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

/* Fix horizontal scrolling issue */
html, body {
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

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

  h2 {
    font-size: 1.5rem;
  }

  section {
    padding: 2rem 0;
  }

  .hero {
    height: 50vh;
  }

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

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  min-width: 250px;
  max-width: 350px;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: toast-in 0.3s ease, toast-out 0.3s ease forwards 5s;
  opacity: 0;
}

.toast-success {
  background-color: var(--white);
  border-left: 5px solid #4CAF50;
  color: var(--dark-gray);
}

.toast-error {
  background-color: var(--white);
  border-left: 5px solid #F44336;
  color: var(--dark-gray);
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toast-icon {
  font-size: 1.2rem;
}

.toast-success .toast-icon {
  color: #4CAF50;
}

.toast-error .toast-icon {
  color: #F44336;
}

.toast-message {
  font-weight: 500;
}

.toast-close {
  color: #aaa;
  cursor: pointer;
  font-size: 1rem;
  padding: 0 5px;
  transition: var(--transition);
}

.toast-close:hover {
  color: var(--dark-gray);
}

@keyframes toast-in {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes toast-out {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-20px);
    opacity: 0;
  }
}

/* Media query for services page layout on smaller screens */
@media (max-width: 768px) {
  .about-grid {
    display: flex;
    flex-direction: column;
  }
  
  /* This reverses the order for sections where image is first */
  #prosthetics .about-grid, 
  #pediatric .about-grid, 
  #fabrication .about-grid {
    display: flex;
    flex-direction: column;
  }
  
  #prosthetics .about-grid > div:first-child,
  #pediatric .about-grid > div:first-child,
  #fabrication .about-grid > div:first-child {
    order: 1; /* Move image below text */
  }
  
  /* Adjust spacing */
  .about-grid > div {
    margin-bottom: 1.5rem;
  }
  
  /* Position the button at the bottom */
  .about-grid .btn {
    margin-top: 1.5rem;
    display: inline-block;
  }
}