/* Custom styles for KlinikaTop */

/* Base Styles and Variables */
:root {
  --primary: #10b981;
  --primary-dark: #0d9c6b;
  --secondary: #3b82f6;
  --text: #1f2937;
  --text-light: #6b7280;
  --bg-light: #f9fafb;
  --border: #e5e7eb;
  --radius: 0.5rem;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --transition: all 0.3s ease;
  --header-height: 64px;
  --footer-height: 60px;
  
  /* Responsive spacing */
  --space-unit: clamp(0.5rem, 1.5vw, 1rem);
  --space-xxs: calc(0.25 * var(--space-unit));
  --space-xs: calc(0.5 * var(--space-unit));
  --space-sm: calc(0.75 * var(--space-unit));
  --space-md: calc(1.25 * var(--space-unit));
  --space-lg: calc(2 * var(--space-unit));
  --space-xl: calc(3.25 * var(--space-unit));
  --space-xxl: calc(5.25 * var(--space-unit));
  
  /* Responsive typography */
  --text-xs: clamp(0.75rem, 0.8vw + 0.5rem, 0.875rem);
  --text-sm: clamp(0.875rem, 1vw + 0.5rem, 1rem);
  --text-base: clamp(1rem, 1.2vw + 0.5rem, 1.125rem);
  --text-lg: clamp(1.125rem, 1.4vw + 0.5rem, 1.25rem);
  --text-xl: clamp(1.25rem, 1.6vw + 0.5rem, 1.5rem);
  --text-2xl: clamp(1.5rem, 2vw + 0.5rem, 2rem);
  --text-3xl: clamp(1.875rem, 2.5vw + 0.5rem, 3rem);
  --text-4xl: clamp(2.25rem, 3vw + 0.5rem, 3.75rem);
  --text-5xl: clamp(3rem, 4vw + 0.5rem, 4.5rem);
}

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

/* Responsive Base Styles */
* {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Prevent horizontal scroll */
html, body {
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
  width: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video, canvas, svg, iframe {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Make images and embeds responsive */
img {
  height: auto;
  max-width: 100%;
  vertical-align: middle;
  border-style: none;
}

/* Responsive iframes */
.embed-responsive {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
}

.embed-responsive::before {
  display: block;
  content: "";
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

.embed-responsive-item,
.embed-responsive iframe,
.embed-responsive embed,
.embed-responsive object,
.embed-responsive video {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Responsive Breakpoints */
:root {
  --mobile: 480px;
  --tablet: 640px;
  --laptop: 1024px;
  --desktop: 1280px;
  --widescreen: 1536px;
  
  /* Container widths */
  --container-xs: 100%;
  --container-sm: 540px;
  --container-md: 720px;
  --container-lg: 960px;
  --container-xl: 1140px;
  --container-2xl: 1320px;
  
  /* Responsive spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;
  
  /* Fluid typography */
  --fluid-min-width: 320;
  --fluid-max-width: 1280;
  --fluid-min-scale: 1.2;
  --fluid-max-scale: 1.3;
  --fluid-min-font: 16;
  --fluid-max-font: 20;
  
  /* Calculate fluid font size */
  --fluid-screen: 100vw;
  --fluid-bp: (var(--fluid-screen) - var(--fluid-min-width) / 16 * 1rem) / (var(--fluid-max-width) - var(--fluid-min-width));
  --fluid-scale: calc(var(--fluid-min-scale) + var(--fluid-max-scale) - var(--fluid-min-scale) * var(--fluid-bp));
  --fluid-font-size: calc((var(--fluid-min-font) / 16) * 1rem + (var(--fluid-max-font) - var(--fluid-min-font)) * var(--fluid-bp));
}

/* Responsive Mixins */
/* Using standard media queries for better compatibility */
/* Base container */
.container {
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Responsive Typography */
h1, .h1 { font-size: var(--text-3xl); line-height: 1.2; }
h2, .h2 { font-size: var(--text-2xl); line-height: 1.25; }
h3, .h3 { font-size: var(--text-xl); line-height: 1.3; }
p, .p { font-size: var(--text-base); line-height: 1.6; }

/* Responsive Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Responsive Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: var(--text-sm);
}

/* Responsive iframes */
iframe, embed, object, video {
  max-width: 100%;
  height: auto;
}

/* Responsive Buttons */
button, .btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: var(--text-sm);
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  border-radius: 0.25rem;
  transition: all 0.2s ease-in-out;
}

/* Responsive Forms */
input, select, textarea {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 1rem;
  border: 1px solid #ddd;
  border-radius: 0.25rem;
  font-size: var(--text-base);
}

/* Mobile First Media Queries */
/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) {
  .container {
    max-width: 540px;
  }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
  :root {
    --header-height: 4rem;
  }
  
  .container {
    max-width: 720px;
    padding: 0 1.5rem;
  }
  
  .md\:flex-row {
    flex-direction: row !important;
  }
  
  .md\:w-1\/2 {
    width: 50% !important;
  }
  
  .md\:w-1\/3 {
    width: 33.333333% !important;
  }
  
  .md\:w-2\/3 {
    width: 66.666667% !important;
  }
  
  .md\:hidden {
    display: none !important;
  }
  
  .md\:block {
    display: block !important;
  }
  
  .md\:flex {
    display: flex !important;
  }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
  .container {
    max-width: 960px;
  }
  
  .lg\:w-1\/4 {
    width: 25% !important;
  }
  
  .lg\:w-1\/3 {
    width: 33.333333% !important;
  }
  
  .lg\:w-1\/2 {
    width: 50% !important;
  }
  
  .lg\:w-3\/4 {
    width: 75% !important;
  }
  
  .lg\:hidden {
    display: none !important;
  }
  
  .lg\:block {
    display: block !important;
  }
  
  .lg\:flex {
    display: flex !important;
  }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }
  
  .xl\:w-1\/5 {
    width: 20% !important;
  }
  
  .xl\:w-1\/4 {
    width: 25% !important;
  }
  
  .xl\:w-1\/3 {
    width: 33.333333% !important;
  }
  
  .xl\:w-1\/2 {
    width: 50% !important;
  }
  
  .xl\:w-2\/3 {
    width: 66.666667% !important;
  }
  
  .xl\:w-3\/4 {
    width: 75% !important;
  }
  
  .xl\:w-4\/5 {
    width: 80% !important;
  }
}

/* Mobile-specific styles */
@media (max-width: 480px) {
  :root {
    --fluid-scale: var(--fluid-min-scale);
    --header-height: 3rem;
  }
  
  /* Mobile-specific utility classes */
  .mobile\:hidden {
    display: none !important;
  }
  
  .mobile\:block {
    display: block !important;
  }
  
  .mobile\:flex {
    display: flex !important;
  }
  
  /* Adjust container padding for mobile */
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  /* Adjust typography for mobile */
  h1, .h1 { font-size: var(--text-2xl); }
  h2, .h2 { font-size: var(--text-xl); }
  h3, .h3 { font-size: var(--text-lg); }
  
  /* Stack elements on mobile */
  .mobile\:stack > * {
    width: 100%;
    margin-bottom: 1rem;
  }
  
  .mobile\:stack > :last-child {
    margin-bottom: 0;
  }
  
  /* Full width buttons on mobile */
  .mobile\:btn-block {
    display: block;
    width: 100%;
  }
  
  /* Hide elements that should only be visible on desktop */
  .desktop-only {
    display: none !important;
  }
  
  /* Show elements that should only be visible on mobile */
  .mobile-only {
    display: block !important;
  }
  
  /* Adjust form elements for mobile */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px; /* Prevents iOS zoom on focus */
  }
  
  /* Ensure buttons and inputs are tappable on mobile */
  button, 
  input[type="button"], 
  input[type="submit"],
  .btn {
    min-height: 44px; /* Minimum touch target size */
    padding: 0.5rem 1rem;
  }
  
  /* Adjust spacing for mobile */
  .section {
    padding: 2rem 0;
  }
  
  /* Hide scrollbar but keep functionality */
  .scroll-container {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
  }
  
  .scroll-container::-webkit-scrollbar {
    display: none; /* Safari and Chrome */
  }
  
  /* Stack elements on mobile */
  .mobile-stack > * + * {
    margin-top: 1rem;
  }
}

/* Tablet and up */
@media (min-width: 481px) and (max-width: 768px) {
  .tablet\:hidden {
    display: none !important;
  }
}

/* Laptop and up */
@media (min-width: 1025px) {
  .laptop\:hidden {
    display: none !important;
  }
  
  .laptop\:flex {
    display: flex !important;
  }
}

/* Desktop and up */
@media (min-width: 1281px) {
  .desktop\:hidden {
    display: none !important;
  }
}

/* Widescreen */
@media (min-width: 1536px) {
  .widescreen\:hidden {
    display: none !important;
  }
}

/* Responsive utilities */
/* Hide elements based on breakpoints */
@media (max-width: 639px) {
  .sm\:hidden { display: none !important; }
  .sm\:block { display: block !important; }
  .sm\:flex { display: flex !important; }
  .sm\:grid { display: grid !important; }
}

@media (min-width: 640px) and (max-width: 767px) {
  .md\:hidden { display: none !important; }
  .md\:block { display: block !important; }
  .md\:flex { display: flex !important; }
  .md\:grid { display: grid !important; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .lg\:hidden { display: none !important; }
  .lg\:block { display: block !important; }
  .lg\:flex { display: flex !important; }
  .lg\:grid { display: grid !important; }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  .xl\:hidden { display: none !important; }
  .xl\:block { display: block !important; }
  .xl\:flex { display: flex !important; }
  .xl\:grid { display: grid !important; }
}

@media (min-width: 1280px) {
  .\32xl\:hidden { display: none !important; }
  .\32xl\:block { display: block !important; }
  .\32xl\:flex { display: flex !important; }
  .\32xl\:grid { display: grid !important; }
}

/* Touch device detection */
@media (hover: none) and (pointer: coarse) {
  .touch\:hidden { display: none !important; }
  .touch\:block { display: block !important; }
  .touch\:flex { display: flex !important; }
  .touch\:grid { display: grid !important; }
}

/* Hover state for devices that support hover */
/* Hover states for devices that support hover */
@media (hover: hover) and (pointer: fine) {
  .hover\:hidden:hover { display: none !important; }
  .hover\:block:hover { display: block !important; }
  .hover\:flex:hover { display: flex !important; }
  .hover\:grid:hover { display: grid !important; }
}

/* Print styles */
@media print {
  .print\:hidden { display: none !important; }
  .print\:block { display: block !important; }
  .print\:flex { display: flex !important; }
  .print\:grid { display: grid !important; }
  
  body {
    font-size: 12pt;
    line-height: 1.3;
    color: #000;
    background: #fff;
  }
  
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 80%;
  }
  
  .no-print {
    display: none !important;
  }
}

/* Base Responsive Typography */
html {
  font-size: var(--fluid-font-size, 16px);
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  
  /* Prevent horizontal scroll */
  overflow-x: hidden;
  width: 100%;
  
  /* Smooth scrolling for iOS */
  -webkit-overflow-scrolling: touch;
}

/* Responsive typography */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  margin-top: 0;
  margin-bottom: var(--space-sm);
}

h1 { font-size: calc(2.5rem * var(--fluid-scale)); }
h2 { font-size: calc(2rem * var(--fluid-scale)); }
h3 { font-size: calc(1.75rem * var(--fluid-scale)); }
h4 { font-size: calc(1.5rem * var(--fluid-scale)); }
h5 { font-size: calc(1.25rem * var(--fluid-scale)); }
h6 { font-size: 1rem; }

p {
  margin-top: 0;
  margin-bottom: var(--space-sm);
  line-height: 1.6;
}

/* Responsive images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Make sure images in rich text areas are responsive */
.rich-text img {
  height: auto;
  max-width: 100%;
}

/* Responsive iframes (for embedded videos, etc.) */
.embed-responsive {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
}

.embed-responsive::before {
  display: block;
  content: "";
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

.embed-responsive iframe,
.embed-responsive embed,
.embed-responsive object,
.embed-responsive video {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Responsive tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-md);
}

/* Responsive forms */
input,
button,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border-radius: 0;
}

/* Touch target sizes */
button,
a,
input[type="submit"],
input[type="button"],
input[type="reset"] {
  min-height: 44px;
  min-width: 44px;
  padding: 0.5em 1em;
}

/* Hide elements visually but keep them accessible */
.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;
}

/* Better font rendering and base styles */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  margin: 0;
  padding: 0;
  width: 100%;
  overflow-x: hidden;
  line-height: 1.5;
  color: var(--text);
  background-color: #fff;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif;
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

/* Responsive container padding */
@media (max-width: 640px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Responsive typography adjustments */
@media (max-width: 480px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
  h4 { font-size: 1.25rem; }
  h5 { font-size: 1.1rem; }
  h6 { font-size: 1rem; }
  
  p, li, a, span, div {
    font-size: 1rem;
  }
}

/* Mobile navigation */
.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 320px;
  height: 100vh;
  background: white;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: right 0.3s ease;
  overflow-y: auto;
  padding: 1.5rem;
}

.mobile-nav.open {
  right: 0;
}

.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-nav-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Mobile menu button */
.mobile-menu-button {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  z-index: 1001;
}

/* Base responsive styles */
.container {
  width: 100%;
  padding-right: var(--spacing-sm);
  padding-left: var(--spacing-sm);
  margin-right: auto;
  margin-left: auto;
}

/* Responsive container */
@media (min-width: 576px) {
  .container {
    max-width: var(--container-sm);
    padding-right: var(--spacing-sm);
    padding-left: var(--spacing-sm);
  }
}

@media (min-width: 768px) {
  .container {
    max-width: var(--container-md);
    padding-right: var(--spacing-md);
    padding-left: var(--spacing-md);
  }
}

@media (min-width: 992px) {
  .container {
    max-width: var(--container-lg);
    padding-right: var(--spacing-lg);
    padding-left: var(--spacing-lg);
  }
}

@media (min-width: 1200px) {
  .container {
    max-width: var(--container-xl);
  }
}

@media (min-width: 1400px) {
  .container {
    max-width: var(--container-2xl);
  }
}

/* Responsive typography */
html {
  font-size: 14px;
}

@media (min-width: 576px) {
  html {
    font-size: 15px;
  }
}

@media (min-width: 768px) {
  html {
    font-size: 15.5px;
  }
}

@media (min-width: 992px) {
  html {
    font-size: 16px;
  }
}
}

/* Mobile menu and navigation */
@media (max-width: 991.98px) {
  .mobile-menu-button {
    display: block;
  }
  
  .desktop-nav {
    display: none;
  }
  
  .mobile-nav {
    display: block;
  }
}

/* Tablet and up */
@media (min-width: 768px) {
  .mobile-menu-button {
    display: none;
  }
  
  .desktop-nav {
    display: flex;
  }
}

/* Responsive grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--spacing-md);
  width: 100%;
}

/* Responsive images */
.responsive-img {
  width: 100%;
  height: auto;
  display: block;
}

/* Responsive tables */
.table-responsive {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Responsive video container */
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  overflow: hidden;
  margin-bottom: 1rem;
}

.video-container iframe,
.video-container embed,
.video-container object {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Responsive utility classes */
.hide-on-mobile {
  display: none;
}

.show-on-mobile {
  display: block;
}

@media (min-width: 768px) {
  .hide-on-mobile {
    display: block;
  }
  
  .show-on-mobile {
    display: none;
  }
}

/* Fix for iOS viewport height */
@supports (-webkit-touch-callout: none) {
  body {
    /* The hack for Safari */
    height: -webkit-fill-available;
  }
}

/* Prevent text size adjustment on orientation change */
html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Responsive typography for better readability */
p, li, a, span, div {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Responsive form elements */
input, select, textarea, button {
  font-size: 1rem;
  max-width: 100%;
}

/* Responsive tables */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e2e8f0;
}

/* Responsive images in content */
.content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem 0;
}

/* Responsive navigation */
.nav-toggle {
  display: none;
}

@media (max-width: 767px) {
  .nav-menu {
    display: none;
  }
  
  .nav-toggle:checked ~ .nav-menu {
    display: block;
  }
}
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

/* Responsive flex utilities */
.flex-col {
  flex-direction: column;
}

@media (min-width: 768px) {
  .md\:flex-row {
    flex-direction: row;
  }
  
  .md\:items-center {
    align-items: center;
  }
}

/* Touch-friendly buttons and links */
button, a, [role="button"], [role="link"] {
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  text-decoration: none;
  cursor: pointer;
}

/* Hide scrollbar but keep functionality */
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

/* Responsive images with intrinsic ratio */
.img-responsive {
  width: 100%;
  height: auto;
  display: block;
}

/* Aspect ratio containers */
.aspect-ratio {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 by default */
  overflow: hidden;
}

.aspect-ratio > * {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Print styles */
@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  a,
  a:visited {
    text-decoration: underline;
  }
  
  a[href]::after {
    content: " (" attr(href) ")";
  }
  
  /* Don't show links that are fragment identifiers */
  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }
  
  /* Add page breaks */
  h2, h3, h4, h5, h6 {
    page-break-after: avoid;
  }
  
  img, tr, pre, blockquote {
    page-break-inside: avoid;
  }
}

/* Responsive font sizes */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }
  
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Prevent horizontal scroll */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Responsive Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Touch-friendly Elements */
button,
a,
input[type="button"],
input[type="submit"],
input[type="reset"] {
/* Navbar Styles */
.scrolled {
    background-color: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Navbar Container */
.bg-white\/95 {
    padding: 0.5rem 0;
}

.navbar-container {
    max-width: 100%;
    padding: 0 0.5rem;
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    overflow: visible;
}

/* Navbar Button Styles */
.nav-button,
#mobile-menu a,
#mobile-menu button,
.navbar-nav .nav-item .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    color: #1f2937 !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    line-height: 1.2;
    letter-spacing: 0;
    text-transform: none !important;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem !important;
    margin: 0 0.2rem;
    border-radius: 6px;
    text-decoration: none !important;
    white-space: nowrap;
    background-color: transparent;
    border: none;
}

.nav-button:hover,
#mobile-menu a:hover,
#mobile-menu button:hover,
.navbar-nav .nav-item .nav-link:hover {
    color: #10b981 !important;
    background-color: rgba(16, 185, 129, 0.1) !important;
}

.nav-button::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 1.5px;
    background: #10b981;
    transform: translateX(-50%);
    transition: width 0.2s ease;
}

.nav-button.active,
#mobile-menu a.active,
#mobile-menu button.active,
.navbar-nav .nav-item .nav-link.active {
    color: #10b981 !important;
    background-color: rgba(16, 185, 129, 0.1) !important;
    font-weight: 600 !important;
}

.nav-button.active::after {
  width: 70%;
}

/* Desktop Menu */
.hidden.lg\:space-x-1 > :not([hidden]) ~ :not([hidden]) {
  --tw-space-x-reverse: 0;
  margin-right: 0.5rem;
  margin-left: 0.5rem;
}

/* Navbar Buttons */
.nav-button.lg\:flex {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
  flex-wrap: nowrap;
  overflow-x: visible;
  width: auto;
  margin: 0;
  padding: 0;
}

.btn-outline {
  background: transparent;
  color: #10b981;
  border: 1px solid #10b981;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  line-height: 1.5;
  font-size: 0.875rem;
  background-color: transparent;
}

.btn-outline:hover {
  background-color: rgba(16, 185, 129, 0.1);
  color: #0d9c6b;
  border-color: #0d9c6b;
}

.btn-outline:active {
  background-color: rgba(16, 185, 129, 0.2);
  transform: translateY(1px);
}

/* Mobile Menu Button */
.mobile-menu-button {
  display: none;
  background: none;
  border: none;
  padding: 0.5rem;
  flex-shrink: 0;
}

/* Grid adjustments */
.grid-cols-4, 
.grid-cols-3 {
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

/* Forms */
.newsletter-form {
  flex-direction: column;
  gap: 1rem;
}

.newsletter-input,
.newsletter-button {
  width: 100%;
  padding: 0.875rem 1.25rem;
}

/* Buttons */
.btn, button, .button {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

/* Spacing */
section {
  padding: 3rem 0;
}

/* Small devices (large phones, 480px and up) */
@media (max-width: 640px) {
  /* Typography */
  h1, .h1 { font-size: 1.75rem; }
  h2, .h2 { font-size: 1.5rem; }
  h3, .h3 { font-size: 1.25rem; }
  
  /* Layout */
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .hero-content {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  
  /* Grid adjustments */
  .grid-cols-4, 
  .grid-cols-3,
  .grid-cols-2 {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  
  /* Cards */
  .card, 
  .service-card,
  .doctor-card,
  .clinic-card {
    margin-bottom: 1.5rem;
  }
  
  /* Navigation */
  .nav-menu {
    width: 85%;
  }
  
  /* Testimonials */
  .testimonial-card {
    padding: 1.5rem;
  }
  
  /* Footer */
  footer {
    text-align: center;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .social-links {
    justify-content: center;
    margin-top: 1.5rem;
  }
}

/* Extra small devices (phones, 480px and down) */
@media (max-width: 480px) {
  /* Typography */
  h1, .h1 { font-size: 1.5rem; }
  h2, .h2 { font-size: 1.375rem; }
  
  /* Buttons */
  .btn, button, .button {
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
  }
  
  /* Spacing */
  section {
    padding: 2.5rem 0;
  }
  
  .section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
  }
  
  /* Forms */
  .form-group {
    margin-bottom: 1rem;
  }
  
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="password"],
  textarea,
  select {
    padding: 0.75rem;
    font-size: 1rem;
  }
  
  /* Mobile menu */
  .mobile-menu-button {
    padding: 0.5rem;
  }
  
  /* Utility classes */
  .text-sm { font-size: 0.8125rem; }
  .text-base { font-size: 0.9375rem; }
  .text-lg { font-size: 1.0625rem; }
  .text-xl { font-size: 1.1875rem; }
}

/* Very small devices (small phones, 360px and down) */
@media (max-width: 360px) {
  /* Adjust padding and margins for very small screens */
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  
  /* Typography */
  h1, .h1 { font-size: 1.375rem; }
  h2, .h2 { font-size: 1.25rem; }
  
  /* Buttons */
  .btn, button, .button {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
  }
  
  /* Cards */
  .card, 
  .service-card,
  .doctor-card,
  .clinic-card {
    border-radius: 0.5rem;
  }
  
  /* Navigation */
  .nav-menu {
    width: 90%;
    padding: 1.5rem 1rem;
  }
  
  /* Hide non-essential elements on very small screens */
  .hide-on-mobile {
    display: none !important;
  }
}

/* Print styles */
@media print {
  /* Hide non-essential elements when printing */
  .no-print {
    display: none !important;
  }
  
  /* Ensure proper page breaks */
  .page-break {
    page-break-before: always;
  }
  
  /* Adjust typography for print */
  body {
    font-size: 12pt;
    line-height: 1.3;
    color: #000;
    background: #fff;
  }
  
  /* Ensure links are visible in print */
  a {
    text-decoration: underline;
    color: #000;
  }
  
  /* Add URL after links */
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 80%;
  }
}

/* Card Hover Effect */
.card-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

/* Button Hover Effect */
.btn-hover:hover {
  transform: translateY(-3px);
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #4CAF50;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3e8e41;
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Form Controls */
.form-control {
  transition: all 0.3s ease;
  border: 1px solid #e2e8f0;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  width: 100%;
}

.form-control:focus {
  border-color: #4CAF50;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
  outline: none;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .hero-content {
    padding-top: 6rem;
    padding-bottom: 4rem;
  }
  
  .section-padding {
    padding: 3rem 0;
  }
}

/* FAQ Accordion */
.faq-item {
  border-bottom: 1px solid #e2e8f0;
  overflow: hidden;
}

.faq-question {
  cursor: pointer;
  padding: 1rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.faq-question:hover {
  color: #4CAF50;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-answer.show {
  max-height: 500px;
  padding-bottom: 1rem;
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: #4CAF50;
  color: white;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* Loading Spinner */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #4CAF50;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility Classes */
.shadow-custom {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}
