/* FOUC 방지 */
body {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

body.loaded {
  opacity: 1;
}
/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Jua&family=Noto+Sans+KR:wght@400;700&display=swap');

:root {
  --font-primary: 'Noto Sans KR', sans-serif;
  --font-display: 'Jua', sans-serif;
  --color-primary: #FF6B6B;
  --color-secondary: #FFD93D;
  --color-accent: #6BCB77;
  --color-dark: #4D4D4D;
  --color-light: #F7F7F7;
  
  /* 그림자 색상 변수 */
  --shadow-color-sweet-glow: rgba(255, 236, 179, 0.7);
  --shadow-color-salty-glow: rgba(187, 222, 251, 0.7);
  --shadow-color-spicy-glow: rgba(255, 205, 210, 0.7);
  --shadow-color-main: rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  background-color: var(--color-light);
  color: var(--color-dark);
  margin: 0;
  padding: 20px;
  text-align: center;
  background-image: linear-gradient(to top, rgba(255,255,255,0.8), rgba(255,255,255,0.8)), url("https://www.transparenttextures.com/patterns/cubes.png");
}

header {
  margin-bottom: 40px;
}

header h1 {
  font-family: var(--font-display);
  font-size: 3.5rem;
  color: var(--color-primary);
  margin: 0.5rem 0;
  text-shadow: 2px 2px 4px var(--shadow-color-main);
}

header p {
  font-size: 1.2rem;
  color: var(--color-dark);
}

#language-selector {
  position: absolute;
  top: 20px;
  right: 20px;
}

#language-switcher {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-family: var(--font-primary);
  background-color: white;
}

#flavor-selection h2 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 30px;
  color: var(--color-dark);
}

.flavor-options {
  display: flex;
  justify-content: center;
  gap: 30px; /* 카드 간격 증가 */
  flex-wrap: wrap;
}

.flavor-card {
  background-color: #fff;
  border: none;
  border-radius: 20px; /* 더 둥글게 */
  padding: 25px;
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
  width: 170px; /* 크기 살짝 키움 */
  height: 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* 다층 그림자로 입체감 극대화 */
  box-shadow: 
    0 1px 3px rgba(0,0,0,0.05), /* 가장 가까운 그림자 */
    0 5px 15px rgba(0,0,0,0.08), /* 중간 그림자 */
    0 15px 35px rgba(0,0,0,0.1); /* 가장 먼 그림자 */
}

.flavor-card:hover {
  transform: translateY(-12px); /* 더 역동적인 움직임 */
}

#sweet:hover { box-shadow: 0 15px 40px var(--shadow-color-sweet-glow), 0 0 0 4px var(--color-secondary);}
#salty:hover { box-shadow: 0 15px 40px var(--shadow-color-salty-glow), 0 0 0 4px #81D4FA;}
#spicy:hover { box-shadow: 0 15px 40px var(--shadow-color-spicy-glow), 0 0 0 4px var(--color-primary);}


.flavor-card .icon {
  font-size: 4rem; /* 아이콘 크기 키움 */
  margin-bottom: 15px;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.flavor-card:hover .icon {
  transform: scale(1.25) rotate(-15deg); /* 더 과장된 효과 */
}

.flavor-card span {
  font-family: var(--font-primary);
  font-weight: 700;
  font-size: 1.2rem; /* 폰트 크기 키움 */
  color: var(--color-dark);
}

#sweet { background: linear-gradient(135deg, #FFFDE7, #FFF8E1); }
#salty { background: linear-gradient(135deg, #E1F5FE, #B3E5FC); }
#spicy { background: linear-gradient(135deg, #FFEBEE, #FFCDD2); }

#map-container {
  margin-top: 50px;
  position: relative;
  height: 60vh; /* Adjust height as needed */
  width: 100%;
  max-width: 1200px; /* Limit map width on large screens */
  margin-left: auto;
  margin-right: auto;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

#map {
  height: 100%;
  width: 100%;
}

#loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 8px solid var(--color-light);
  border-top: 8px solid var(--color-primary);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
  display: none;
  z-index: 10;
}

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

/* Responsive Design */
@media (max-width: 768px) {
  body { padding: 15px; }
  header h1 { font-size: 2.8rem; }
  header p { font-size: 1rem; }
  .flavor-options { flex-direction: column; align-items: center; gap: 20px;}
  .flavor-card { width: 80%; max-width: 280px; height: auto; padding: 20px; }
  .flavor-card .icon { font-size: 3.5rem; }
  #map-container { height: 50vh; }
}
