/* 완전한 모바일 반응형 CSS - KIHA */

/* 기본 반응형 설정 */
* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 컨테이너 반응형 */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* 헤더 모바일 최적화 */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(135deg, #2E7D32, #66BB6A);
  backdrop-filter: blur(10px);
}

.header-top {
  padding: 10px 0;
  background: rgba(46, 125, 50, 0.95);
}

.header-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.contact-info {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.contact-info span {
  font-size: 0.9rem;
  color: white;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* 네비게이션 모바일 최적화 */
.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.nav-menu {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 30px;
}

.nav-menu > li {
  position: relative;
}

.nav-menu > li > a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 10px 0;
  display: block;
  transition: all 0.3s ease;
}

.nav-menu > li > a:hover,
.nav-menu > li > a.active {
  color: #E8F5E8;
  text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

/* 드롭다운 메뉴 */
.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  min-width: 200px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  border-radius: 8px;
  padding: 10px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1001;
}

.nav-menu li:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown a {
  display: block;
  padding: 12px 20px;
  color: #333;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.dropdown a:hover {
  background: #E8F5E8;
  color: #2E7D32;
}

/* 모바일 햄버거 메뉴 */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}

.mobile-menu-toggle span {
  width: 25px;
  height: 3px;
  background: white;
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}

/* 메인 배너 반응형 */
.hero-section {
  position: relative;
  background: linear-gradient(135deg, #2E7D32, #66BB6A);
  color: white;
  padding: 80px 0;
  text-align: center;
  overflow: hidden;
}

.hero-content h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

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

.hero-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

.btn-primary {
  background: white;
  color: #2E7D32;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.btn-secondary {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.btn-secondary:hover {
  background: white;
  color: #2E7D32;
}

/* 카드 그리드 반응형 */
.grid-container {
  display: grid;
  gap: 30px;
  padding: 60px 0;
}

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

.card {
  background: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  border: 1px solid rgba(46, 125, 50, 0.1);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.card-icon {
  font-size: 3rem;
  color: #66BB6A;
  margin-bottom: 1rem;
}

.card h3 {
  color: #2E7D32;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

/* 폼 요소 모바일 최적화 */
.form-group {
  margin-bottom: 20px;
}

.form-control {
  width: 100%;
  padding: 15px;
  border: 2px solid #E0E0E0;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: #2E7D32;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

/* 모달 모바일 최적화 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(5px);
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 15px;
  padding: 30px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
}

/* 푸터 모바일 최적화 */
footer {
  background: #333;
  color: white;
  padding: 40px 0 20px;
}

.footer-content {
  display: grid;
  gap: 30px;
  margin-bottom: 30px;
}

.footer-section h3 {
  color: #66BB6A;
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section ul li {
  margin-bottom: 8px;
}

.footer-section ul li a {
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section ul li a:hover {
  color: #66BB6A;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #555;
  color: #ccc;
  font-size: 0.9rem;
}

/* 터치 최적화 */
@media (hover: none) and (pointer: coarse) {
  .card:hover {
    transform: none;
  }
  
  .btn:hover {
    transform: none;
  }
  
  .btn:active {
    transform: scale(0.95);
  }
}

/* 태블릿 반응형 (768px ~ 1024px) */
@media (max-width: 1024px) {
  .container {
    padding: 0 20px;
  }
  
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .hero-content h1 {
    font-size: 2.5rem;
  }
  
  .nav-menu {
    gap: 20px;
  }
  
  .contact-info {
    gap: 15px;
  }
}

/* 모바일 반응형 (최대 768px) */
@media (max-width: 768px) {
  html {
    font-size: 14px;
  }
  
  .container {
    padding: 0 15px;
  }
  
  /* 헤더 모바일 */
  .header-top {
    padding: 8px 0;
  }
  
  .header-info {
    justify-content: center;
    text-align: center;
  }
  
  .contact-info {
    flex-direction: column;
    gap: 5px;
    align-items: center;
  }
  
  .contact-info span {
    font-size: 0.8rem;
  }
  
  .social-links {
    margin-top: 10px;
  }
  
  /* 네비게이션 모바일 */
  .nav-container {
    position: relative;
    padding: 10px 0;
  }
  
  .logo {
    height: 35px;
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    gap: 0;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-radius: 0 0 15px 15px;
    padding: 20px;
    transform: translateY(-20px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
  }
  
  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .nav-menu > li {
    border-bottom: 1px solid #eee;
  }
  
  .nav-menu > li:last-child {
    border-bottom: none;
  }
  
  .nav-menu > li > a {
    color: #333;
    padding: 15px 0;
    font-size: 1.1rem;
  }
  
  .nav-menu > li > a:hover,
  .nav-menu > li > a.active {
    color: #2E7D32;
    background: #E8F5E8;
    padding-left: 10px;
    margin: 0 -10px;
    border-radius: 8px;
  }
  
  /* 드롭다운 모바일 */
  .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: #f8f9fa;
    margin-top: 10px;
    border-radius: 8px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  
  .nav-menu li:hover .dropdown,
  .nav-menu li.active .dropdown {
    max-height: 300px;
  }
  
  /* 히어로 섹션 모바일 */
  .hero-section {
    padding: 60px 0;
  }
  
  .hero-content h1 {
    font-size: 2rem;
    line-height: 1.2;
  }
  
  .hero-content p {
    font-size: 1rem;
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }
  
  .btn {
    width: 100%;
    max-width: 280px;
    padding: 12px 20px;
    font-size: 0.9rem;
  }
  
  /* 그리드 모바일 */
  .grid-container {
    padding: 40px 0;
    gap: 20px;
  }
  
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .card {
    padding: 20px;
    text-align: center;
  }
  
  .card-icon {
    font-size: 2.5rem;
  }
  
  .card h3 {
    font-size: 1.3rem;
  }
  
  /* 모달 모바일 */
  .modal-content {
    width: 95%;
    padding: 20px;
    margin: 10px;
  }
  
  /* 푸터 모바일 */
  footer {
    padding: 30px 0 15px;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 20px;
    text-align: center;
  }
  
  .footer-section h3 {
    font-size: 1.1rem;
  }
  
  .footer-bottom {
    font-size: 0.8rem;
    padding-top: 15px;
  }
}

/* 작은 모바일 (최대 480px) */
@media (max-width: 480px) {
  html {
    font-size: 13px;
  }
  
  .container {
    padding: 0 10px;
  }
  
  .hero-content h1 {
    font-size: 1.8rem;
  }
  
  .card {
    padding: 15px;
  }
  
  .modal-content {
    padding: 15px;
  }
  
  .btn {
    padding: 10px 15px;
    font-size: 0.85rem;
  }
}

/* 아이패드 프로 및 대형 태블릿 */
@media (min-width: 769px) and (max-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-4 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 고해상도 디스플레이 최적화 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .logo {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* 다크모드 지원 */
@media (prefers-color-scheme: dark) {
  .card {
    background: #2a2a2a;
    color: white;
    border-color: rgba(255, 255, 255, 0.1);
  }
  
  .modal-content {
    background: #2a2a2a;
    color: white;
  }
  
  .form-control {
    background: #333;
    color: white;
    border-color: #555;
  }
}

/* 접근성 개선 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 화면 방향 최적화 */
@media (orientation: landscape) and (max-height: 500px) {
  .hero-section {
    padding: 40px 0;
  }
  
  .hero-content h1 {
    font-size: 1.8rem;
  }
}

/* PWA 설치 프롬프트 스타일 */
.pwa-install-prompt {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: #2E7D32;
  color: white;
  padding: 15px 20px;
  border-radius: 12px;
  display: none;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 25px rgba(0,0,0,0.2);
  z-index: 1500;
}

.pwa-install-prompt.show {
  display: flex;
}

.pwa-install-content {
  flex: 1;
}

.pwa-install-title {
  font-weight: 600;
  margin-bottom: 5px;
}

.pwa-install-text {
  font-size: 0.9rem;
  opacity: 0.9;
}

.pwa-install-buttons {
  display: flex;
  gap: 10px;
  margin-left: 15px;
}

.pwa-btn {
  padding: 8px 15px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  background: transparent;
  color: white;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.pwa-btn:hover {
  background: rgba(255,255,255,0.1);
}

.pwa-btn.primary {
  background: white;
  color: #2E7D32;
  border-color: white;
}

.pwa-btn.primary:hover {
  background: #f0f0f0;
}

/* 로딩 애니메이션 */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #2E7D32;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 오프라인 표시 */
.offline-indicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #ff6b6b;
  color: white;
  padding: 10px;
  text-align: center;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
  z-index: 2000;
  font-size: 0.9rem;
}

.offline-indicator.show {
  transform: translateY(0);
}
