/* ===================================
   마인내과 Design System
   Clean, Interactive Medical Website
   =================================== */

/* ===================================
   CSS Reset & Base Styles
   =================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
}

/* ===================================
   Design Tokens
   =================================== */
:root {
  /* Colors - Medical Theme */
  /* Colors - Medical Theme */
  --primary: #013328;
  --primary-light: #2c5e53;
  --primary-dark: #00221a;
  --secondary: #00A896;
  --secondary-light: #33BAAA;
  --accent: #FF6B6B;

  /* Neutrals */
  --white: #FFFFFF;
  --gray-50: #F8FAFB;
  --gray-100: #F1F4F7;
  --gray-200: #E4E9EF;
  --gray-300: #D1D9E2;
  --gray-400: #A8B4C0;
  --gray-500: #6B7A8F;
  --gray-600: #4A5568;
  --gray-700: #2D3748;
  --gray-800: #1A202C;
  --gray-900: #0F1419;

  /* Semantic Colors */
  --success: #10B981;
  --warning: #F59E0B;
  --error: #EF4444;
  --info: #3B82F6;

  /* Background */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8FAFB;
  --bg-tertiary: #F1F4F7;

  /* Text */
  --text-primary: #1A202C;
  --text-secondary: #4A5568;
  --text-tertiary: #6B7A8F;
  --text-inverse: #FFFFFF;

  /* Spacing Scale */
  --space-xs: 0.5rem;
  /* 8px */
  --space-sm: 1rem;
  /* 16px */
  --space-md: 1.5rem;
  /* 24px */
  --space-lg: 2rem;
  /* 32px */
  --space-xl: 3rem;
  /* 48px */
  --space-2xl: 4rem;
  /* 64px */
  --space-3xl: 6rem;
  /* 96px */
  --space-4xl: 8rem;
  /* 128px */

  /* Typography Scale */
  --text-xs: 0.75rem;
  /* 12px */
  --text-sm: 0.875rem;
  /* 14px */
  --text-base: 1rem;
  /* 16px */
  --text-lg: 1.125rem;
  /* 18px */
  --text-xl: 1.25rem;
  /* 20px */
  --text-2xl: 1.5rem;
  /* 24px */
  --text-3xl: 1.875rem;
  /* 30px */
  --text-4xl: 2.25rem;
  /* 36px */
  --text-5xl: 3rem;
  /* 48px */
  --text-6xl: 3.75rem;
  /* 60px */
  --text-7xl: 4.5rem;
  /* 72px */

  /* Font Weights */
  --font-light: 300;
  --font-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Border Radius */
  --radius-sm: 0.375rem;
  /* 6px */
  --radius-md: 0.5rem;
  /* 8px */
  --radius-lg: 0.75rem;
  /* 12px */
  --radius-xl: 1rem;
  /* 16px */
  --radius-2xl: 1.5rem;
  /* 24px */
  --radius-full: 9999px;

  /* Shadows */
  --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);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;

  /* Z-index Scale */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
}

/* ===================================
   Typography
   =================================== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700&display=swap');

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: var(--font-bold);
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

h1 {
  font-size: var(--text-5xl);
}

h2 {
  font-size: var(--text-4xl);
}

h3 {
  font-size: var(--text-3xl);
}

h4 {
  font-size: var(--text-2xl);
}

h5 {
  font-size: var(--text-xl);
}

h6 {
  font-size: var(--text-lg);
}

p {
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

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

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

/* ===================================
   Layout Utilities
   =================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-4xl) 0;
}

.section-sm {
  padding: var(--space-3xl) 0;
}

.section-lg {
  padding: 6rem 0;
}

/* ===================================
   Grid System
   =================================== */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ===================================
   Buttons
   =================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  padding: 0.875rem 2rem;
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

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

.btn-large {
  padding: 1.125rem 2.5rem;
  font-size: var(--text-lg);
}

.btn-small {
  padding: 0.625rem 1.5rem;
  font-size: var(--text-sm);
}

/* ===================================
   Cards
   =================================== */
.card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

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

.card-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.card-description {
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ===================================
   Section Headers
   =================================== */
.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-subtitle {
  color: var(--primary);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-sm);
}

.section-title {
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.section-description {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto;
}

/* ===================================
   Animation Utilities
   =================================== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.slide-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.slide-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* ===================================
   Responsive Design
   =================================== */

/* Tablet Landscape (1024px and below) */
@media (max-width: 1024px) {
  .container {
    padding: 0 var(--space-xl);
  }

  /* Hero Section */
  .hero-content h1 {
    font-size: 3rem;
  }

  .hero-content p {
    font-size: var(--text-xl);
  }

  /* Services Grid */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
  }

  /* Stats Grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Doctors Grid */
  .doctors-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Facilities Carousel */
  .facility-card {
    min-width: 280px;
  }

  /* Location Grid */
  .location-grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
  }

  .location-map {
    min-height: 400px;
  }
}

/* Tablet Portrait (768px and below) */
@media (max-width: 768px) {

  /* Typography */
  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 2rem;
  }

  h3 {
    font-size: 1.5rem;
  }

  /* Container */
  .container {
    padding: 0 var(--space-lg);
  }

  /* Hero Section */
  .hero {
    min-height: 500px;
    padding: var(--space-3xl) 0;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-content h1 {
    font-size: 2.5rem;
    line-height: 1.2;
  }

  .hero-content p {
    font-size: var(--text-lg);
  }

  .hero-buttons {
    flex-direction: column;
    gap: var(--space-md);
  }

  .hero-buttons .btn {
    width: 100%;
    justify-content: center;
  }

  /* Services Grid */
  .services-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .service-card {
    padding: var(--space-xl);
  }

  /* Stats Section */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .stat-card {
    padding: var(--space-xl);
  }

  /* Doctors Section */
  .doctors-grid {
    grid-template-columns: 1fr;
  }

  .doctor-card {
    flex-direction: column;
    text-align: center;
  }

  .doctor-image {
    width: 100%;
    height: 300px;
  }

  /* Facilities Carousel */
  .facilities-carousel {
    gap: var(--space-md);
  }

  .facility-card {
    min-width: 250px;
  }

  /* Location Section */
  .location-details h2 {
    font-size: var(--text-2xl);
  }

  .location-info-list {
    gap: var(--space-lg);
  }

  .location-item {
    flex-direction: row;
    align-items: flex-start;
  }

  .location-map {
    min-height: 350px;
  }

  /* CTA Section */
  .cta-section h2 {
    font-size: var(--text-2xl);
  }

  .cta-buttons {
    flex-direction: column;
  }

  .cta-buttons .btn {
    width: 100%;
  }

  /* Footer */
  .footer-content {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
    text-align: center;
  }

  .footer-section {
    align-items: center;
  }

  .footer-links {
    justify-content: center;
  }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {

  /* Typography */
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  h3 {
    font-size: 1.25rem;
  }

  /* Container */
  .container {
    padding: 0 var(--space-md);
  }

  /* Hero */
  .hero-content h1 {
    font-size: 2rem;
  }

  .hero-content p {
    font-size: var(--text-base);
  }

  /* Buttons */
  .btn {
    padding: 0.875rem 1.5rem;
    font-size: var(--text-sm);
  }

  .btn-large {
    padding: 1rem 2rem;
  }

  /* Service Cards */
  .service-icon {
    width: 60px;
    height: 60px;
  }

  /* Facility Cards */
  .facility-card {
    min-width: 220px;
  }

  /* Location Items */
  .location-item {
    gap: var(--space-md);
  }

  .location-icon {
    width: 40px;
    height: 40px;
  }

  /* Spacing */
  section {
    padding: var(--space-3xl) 0;
  }

  .page-header {
    padding: var(--space-2xl) 0;
  }
}

@media (max-width: 480px) {
  :root {
    --text-5xl: 1.75rem;
    --text-4xl: 1.5rem;
    --text-3xl: 1.25rem;
  }

  .btn-large {
    padding: 1rem 2rem;
    font-size: var(--text-base);
  }
}
/* ===================================
   Grid System Mobile Responsive Fix
   =================================== */

@media (max-width: 768px) {
  .grid,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr !important;
    gap: var(--space-lg);
  }
}

@media (max-width: 480px) {
  .grid,
  .grid-2,
  .grid-3,
  .grid-4 {
    gap: var(--space-md);
  }
}
