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

:root {
  --bg-color: #0f172a;
  --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  --panel-bg: rgba(30, 41, 59, 0.7);
  --panel-border: rgba(255, 255, 255, 0.1);
  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --key-bg: rgba(51, 65, 85, 0.6);
  --key-border: rgba(255, 255, 255, 0.05);
  --key-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --key-hover: rgba(71, 85, 105, 0.8);
  --key-active: rgba(59, 130, 246, 0.8);
  --key-physical-active: rgba(16, 185, 129, 0.8);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'Noto Sans KR', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
}

.app-container {
  width: 100%;
  max-width: 900px;
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-main);
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.controls {
  display: flex;
  gap: 1rem;
  align-items: center;
}

select {
  background: var(--key-bg);
  color: var(--text-main);
  border: 1px solid var(--panel-border);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  cursor: pointer;
}

button.primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
}

button.primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

button.primary:active {
  transform: translateY(1px);
}

.notepad-area {
  position: relative;
  width: 100%;
}

textarea {
  width: 100%;
  height: 250px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  color: #fff;
  font-size: 1.5rem;
  padding: 1rem;
  resize: vertical;
  outline: none;
  font-family: inherit;
  line-height: 1.5;
  transition: border-color 0.2s;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

textarea:focus {
  border-color: var(--accent);
}

.toast {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(16, 185, 129, 0.9);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.input-guide {
  min-height: 1.4em;
  margin-top: -0.75rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* Keyboard Styles */
.keyboard {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1rem;
}

.key-row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.key {
  background: var(--key-bg);
  border: 1px solid var(--key-border);
  border-radius: 8px;
  min-width: 45px;
  height: 55px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: var(--key-shadow);
  cursor: pointer;
  transition: all 0.1s;
  user-select: none;
  padding: 0 0.2rem;
}

.key:hover {
  background: var(--key-hover);
}

.key.active {
  background: var(--key-physical-active);
  transform: translateY(2px);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.key .eng {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.key .target-char {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .key {
    min-width: 35px;
    height: 45px;
  }
  .key .target-char {
    font-size: 1rem;
  }
  textarea {
    font-size: 1.2rem;
  }
}
