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

:root {
  --bg-gradient-start: var(--bg);
  --bg-gradient-end: var(--bg);
  --card-bg-color: var(--surface);
  --card-border-color: var(--border);
  --text-primary-color: var(--text);
  --text-secondary-color: var(--muted);
  --accent-color: var(--primary);
}

body {
  font-family: "Inter", "Noto Sans KR", sans-serif;
  background: var(--bg);
  color: var(--text-primary-color);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  box-sizing: border-box;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 6vw 60px;
}

.hero {
 text-align: left;
 margin-bottom: 50px;
}

.hero h2 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--text) 0%, var(--muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 600px;
}

.dashboard-container {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* Live Display - Control Panel Active State (key-checker specific) */
.control-panel.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb, 106, 167, 255), 0.1), var(--shadow);
}

.live-display-inner {
  display: flex;
  align-items: center;
  gap: 32px;
}

.live-icon-wrapper {
  width: 80px;
  height: 80px;
  background: var(--surface-2);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  color: var(--primary);
  border: 1px solid var(--border);
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.control-panel.active .live-icon-wrapper {
  transform: scale(1.05) rotate(-5deg);
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.live-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.live-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.live-key {
  margin: 0;
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--text);
  font-family: "Consolas", "Monaco", monospace;
  white-space: nowrap;
  line-height: 1.1;
  transition: color 0.1s ease;
}

.control-panel.active .live-key {
    color: var(--primary);
}

.live-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
}

.meta-pill {
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    font-family: "Consolas", monospace;
}

/* Grid Layouts */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.full-width {
    grid-column: 1 / -1;
}

.content-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 25px;
    padding: 24px;
    box-shadow: var(--shadow);
}

.card-title {
    margin: 0 0 20px;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-title i {
    color: var(--primary);
}

.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.card-header-row .card-title {
    padding: 0;
    margin: 0;
    border: none;
}

/* Detail Lists */
.detail-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 0.95rem;
}

.detail-item:not(:last-child) {
    border-bottom: 1px solid var(--surface-2);
    padding-bottom: 12px;
}

.detail-label {
    color: var(--muted);
    font-family: "Consolas", monospace;
}

.detail-value {
    font-weight: 600;
    color: var(--text);
    font-family: "Consolas", monospace;
    text-align: right;
}

/* Virtual Keyboard */
.featured-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 25px;
    padding: 24px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.keyboard-render {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.key-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  min-width: 800px;
}

.k-key {
  height: 52px;
  min-width: 52px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: "Consolas", monospace;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  user-select: none;
  transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 0 var(--border);
  margin-bottom: 4px; /* Space for shadow */
}

.k-key.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 var(--border);
  transform: translateY(4px);
}

/* Key Sizes */
.k-w-auto { flex: 1; }
.k-w-1_25 { width: 65px; }
.k-w-1_5 { width: 78px; }
.k-w-1_75 { width: 91px; }
.k-w-2 { width: 104px; }
.k-w-2_25 { width: 117px; }
.k-w-2_75 { width: 143px; }
.k-w-space { width: 350px; }

/* Log List */
.log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 8px;
}

.log-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 25px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.95rem;
  font-family: "Consolas", monospace;
  animation: fadeIn 0.3s ease;
}

.log-item:first-child {
    border-color: var(--primary);
    background: var(--surface);
}

.log-meta {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Buttons */
.pill-btn {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pill-btn:hover {
    background: var(--border);
}

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

@media (max-width: 768px) {
    .live-display-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .live-icon-wrapper {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .live-key {
        font-size: 2rem;
    }

    .keyboard-render {
        padding-bottom: 20px;
    }
}
