@import url('https://fonts.googleapis.com/css2?family=Nanum+Brush+Script&family=Yeon+Sung&family=Gamja+Flower&display=swap');

:root {
  --color-primary: #4A90E2; /* Main interactive elements, button background */
  --color-primary-dark: #357ABD; /* Button hover */
  --color-text-dark: #2C3E50; /* h1, #korean-name */
  --color-text-medium: #4A4A4A; /* p, main body text */
  --color-text-light: #7F8C8D; /* #tts-btn, hanja, romaja, calligraphy h3 */
  --color-background-light: #F8F8F8; /* body background, result/calligraphy card background */
  --color-border-light: #E0E0E0; /* input border, result/calligraphy card border */
  --color-placeholder: #CCCCCC; /* input placeholder */
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-primary: #8AB4F8; /* Lighter blue for dark mode */
    --color-primary-dark: #AECBFA; /* Even lighter blue for dark mode hover */
    --color-text-dark: #E8EAED; /* Light grey for headings */
    --color-text-medium: #BDC1C6; /* Medium grey for paragraphs */
    --color-text-light: #9AA0A6; /* Darker grey for light text elements */
    --color-background-light: #202124; /* Dark background for body and cards */
    --color-border-light: #5F6368; /* Darker border */
    --color-placeholder: #80868B; /* Darker placeholder */
  }
}

body {
  font-family: 'Noto Sans KR', sans-serif;
  background-color: var(--color-background-light);
  background-image: radial-gradient(var(--color-border-light) 1px, transparent 1px);
  background-size: 20px 20px; /* Adjust size for subtlety */
  color: var(--color-text-medium);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
}

.container {
  max-width: 500px;
  width: 100%;
  padding: 2.5rem; /* Increased padding */
  background-color: var(--color-background-light); /* Keep white for now, as it's a specific container background */
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  text-align: center;
}

h1 {
  font-family: 'Gowun Batang', serif;
  font-size: 2.5rem;
  color: var(--color-text-dark);
  margin-bottom: 1rem; /* Increased margin */
}

p {
  color: var(--color-text-medium);
  line-height: 1.7; /* Slightly increased line-height for readability */
  margin-bottom: 1rem; /* More consistent spacing */
}

.input-container {
  margin: 2rem 0; /* Increased top/bottom margin */
  text-align: left;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.75rem; /* Increased margin */
  color: var(--color-text-medium);
}

input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border-light);
  border-radius: 8px;
  font-size: 1rem;
  box-sizing: border-box;
}

input[type="text"]::placeholder {
  color: var(--color-placeholder);
}

button {
  background-color: var(--color-primary);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.1s ease; /* Added transform transition */
  width: 100%;
}

.name-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

#tts-btn {
  background-color: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--color-text-light);
  transition: color 0.3s ease;
  width: 36px;
  height: 36px;
}

#tts-btn:hover {
  color: var(--color-primary);
}

#tts-btn svg {
  width: 100%;
  height: 100%;
}

.action-btn {
  background-color: var(--color-background-light);
  color: var(--color-text-medium);
  border: 1px solid var(--color-border-light);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

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

#loading {
  margin-top: 2rem; /* Increased margin */
  color: var(--color-text-medium);
}

.result-card {
  margin-top: 2.5rem; /* Increased margin */
  padding: 2.5rem; /* Increased padding */
  border: 1px solid var(--color-border-light);
  border-radius: 16px;
  background-color: var(--color-background-light);
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

#korean-name {
  font-family: 'Gowun Batang', serif;
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--color-text-dark);
  margin: 0;
  animation: nameAppear 0.5s ease-out forwards; /* Added animation */
}

#hanja-name {
  font-size: 1.5rem;
  color: var(--color-text-light);
  margin-top: 1rem; /* Adjusted for better separation */
  margin-bottom: 1rem; /* Adjusted for better separation */
}

#romaja-pronunciation {
  font-size: 1.2rem;
  color: var(--color-text-light);
  margin-top: 0rem; /* Removed negative margin */
  margin-bottom: 1.5rem;
}

#name-meaning {
  font-size: 1rem;
  color: var(--color-text-medium);
  text-align: left;
  line-height: 1.8;
  margin-top: 1.5rem; /* Added margin-top for separation */
}



.calligraphy-card {
  margin-top: 2.5rem; /* Increased margin */
  padding: 2.5rem; /* Increased padding */
  border: 1px solid var(--color-border-light);
  border-radius: 16px;
  background-color: var(--color-background-light);
  text-align: center;
  display: flex;
  flex-direction: row; /* Changed to row for horizontal layout */
  justify-content: space-around; /* Distribute space evenly */
  align-items: center; /* Center items vertically */
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
  gap: 1.5rem; /* Added gap for better spacing between calligraphy names */
}

.calligraphy-card h3 {
  font-family: 'Gowun Batang', serif;
  margin-bottom: 1rem;
  color: var(--color-text-light);
  text-align: left;
  width: 100%; /* Ensure title takes full width */
}

.calligraphy-card p {
  font-size: 3rem;
  color: var(--color-text-dark); /* Keep black for calligraphy names */
  margin: 0 10px; /* Adjust margin for horizontal spacing */
  cursor: pointer; /* Add pointer cursor to indicate clickability */
  transition: transform 0.2s ease-in-out; /* Smooth transition for hover effect */
}

.calligraphy-card p:hover {
  transform: scale(1.1); /* Enlarge text on hover */
}

/* Styles for the hidden practice sheet for PDF generation */
.practice-sheet {
  position: absolute;
  left: -9999px; /* Hide off-screen */
  width: 210mm; /* A4 width */
  background: #fff; /* Keep white for print background */
  padding: 20mm;
  box-sizing: border-box;
}

#practice-title {
  font-family: 'Gowun Batang', serif;
  font-size: 24px;
  color: var(--color-text-medium);
  margin-bottom: 20px;
  text-align: center;
}

.practice-grid {
  display: flex;
  flex-direction: column;
  gap: 15px; /* Space between rows */
  width: 100%;
}

.practice-row {
  display: flex;
  gap: 15px; /* Space between name groups */
  justify-content: center;
}

.name-group {
  display: flex;
}

.grid-item {
  width: 40px;
  height: 40px;
  border: 1px solid var(--color-border-light);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 28px;
}

/* Dotted crosshair guides */
.grid-item::before, .grid-item::after {
  content: '';
  position: absolute;
  background-color: transparent;
}

.grid-item::before { /* Vertical line */
  left: 50%;
  top: 0;
  width: 1px;
  height: 100%;
  border-left: 1px dotted var(--color-border-light);
}

.grid-item::after { /* Horizontal line */
  top: 50%;
  left: 0;
  height: 1px;
  width: 100%;
  border-top: 1px dotted var(--color-border-light);
}

.grid-item.traceable {
  color: var(--color-grid-traceable);
  opacity: 0.5; /* Increased opacity for better visibility */
}















#calligraphy-name-1 {







  font-family: 'Nanum Brush Script', cursive;







}















#calligraphy-name-2 {







  font-family: 'Yeon Sung', cursive;







}















#calligraphy-name-3 {































  font-family: 'Gamja Flower', cursive;































}































































#calligraphy-name-4 {















  font-family: 'Gowun Batang', serif;















}































#calligraphy-name-5 {















  font-family: 'Jua', sans-serif;















}































#calligraphy-name-6 {















  font-family: 'Stylish', cursive;















}































#calligraphy-name-7 {















  font-family: 'East Sea Dokdo', cursive;















}































#calligraphy-name-8 {















  font-family: 'Dokdo', cursive;















}







@media (max-width: 600px) {







  .container {







    padding: 1.5rem; /* Reduce padding on smaller screens */







  }







}















.hidden {







  display: none !important;







}