/* ============================================================
   style.css — v16 Keyboard Shortcuts Theme
   ============================================================ */

/* --- Variables --- */
:root {
  --font-display: 'JetBrains Mono', 'Menlo', monospace;
  --font-body: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans KR', sans-serif;
  --radius: 10px;
  --radius-sm: 6px;
  --transition: 0.2s ease;
  --max-w: 1280px;
}

[data-theme="dark"] {
  --bg-0: #0c0e14;
  --bg-1: #12151e;
  --bg-2: #1a1e2b;
  --bg-3: #232838;
  --bg-hover: #2a3044;
  --text-0: #edf0f7;
  --text-1: #b0b8cc;
  --text-2: #6c7590;
  --accent: #00ddb3;
  --accent-dim: rgba(0,221,179,0.10);
  --accent-text: #00ffcc;
  --border: #262c3d;
  --key-face: linear-gradient(180deg, #3a4055 0%, #2c3044 100%);
  --key-shadow: 0 3px 0 #1a1e28, 0 4px 6px rgba(0,0,0,0.5);
  --key-border: #444c60;
  --key-text: #e4e8f0;
  --header-bg: rgba(12,14,20,0.88);
  --search-bg: #1a1e2b;
  --tag-bg: #1e2333;
  --scrollbar-track: #12151e;
  --scrollbar-thumb: #2c3044;
}

[data-theme="light"] {
  --bg-0: #f4f5f9;
  --bg-1: #ffffff;
  --bg-2: #ffffff;
  --bg-3: #f0f2f6;
  --bg-hover: #e8eaf0;
  --text-0: #111827;
  --text-1: #4b5563;
  --text-2: #9ca3af;
  --accent: #0891b2;
  --accent-dim: rgba(8,145,178,0.08);
  --accent-text: #0e7490;
  --border: #e2e5ec;
  --key-face: linear-gradient(180deg, #fafafa 0%, #e8e8e8 100%);
  --key-shadow: 0 2px 0 #bbb, 0 3px 3px rgba(0,0,0,0.10);
  --key-border: #ccc;
  --key-text: #222;
  --header-bg: rgba(255,255,255,0.92);
  --search-bg: #fff;
  --tag-bg: #eef0f5;
  --scrollbar-track: #f4f5f9;
  --scrollbar-thumb: #d1d5db;
}

/* --- Reset --- */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-0);
  color: var(--text-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}
::selection { background: var(--accent); color: #000; }
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 4px; }
.hidden { display: none !important; }

/* --- Header --- */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem;
  height: 56px; display: flex; align-items: center; justify-content: space-between;
}
.logo {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem;
  color: var(--text-0); text-decoration: none;
}
.logo-icon {
  width: 32px; height: 32px; background: var(--accent); border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  color: #000; font-size: 0.9rem;
}
.header-actions { display: flex; align-items: center; gap: 0.5rem; }

.btn-icon {
  height: 36px; min-width: 36px; padding: 0 0.5rem;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg-2); color: var(--text-1);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem;
  cursor: pointer; transition: all var(--transition); font-size: 0.88rem;
  font-family: var(--font-body);
}
.btn-icon:hover { background: var(--bg-hover); color: var(--accent); border-color: var(--accent); }
.btn-bookmark { font-size: 0.8rem; font-weight: 600; }
.bookmark-badge {
  background: var(--accent); color: #000; font-size: 0.68rem;
  padding: 1px 5px; border-radius: 10px; font-weight: 700;
}
.nav-links { display: flex; gap: 0.2rem; }
.nav-links a {
  padding: 0.4rem 0.75rem; border-radius: var(--radius-sm);
  color: var(--text-1); text-decoration: none; font-size: 0.83rem; font-weight: 500;
  transition: all var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); background: var(--accent-dim); }

/* Language dropdown */
.lang-dropdown { position: relative; }
.lang-menu {
  display: none; position: absolute; right: 0; top: 100%; margin-top: 6px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25); z-index: 200; min-width: 140px; overflow: hidden;
}
.lang-menu.show { display: block; }
.lang-menu a {
  display: block; padding: 0.6rem 1rem; color: var(--text-1); text-decoration: none;
  font-size: 0.83rem; font-weight: 500; transition: all var(--transition);
}
.lang-menu a:hover { background: var(--bg-hover); color: var(--accent); }
.lang-menu a.active { color: var(--accent); font-weight: 700; }

/* --- Search --- */
.search-section { max-width: var(--max-w); margin: 0 auto; padding: 1.25rem 1.25rem 0.75rem; }
.search-wrap { position: relative; max-width: 600px; margin: 0 auto; }
.search-input {
  width: 100%; padding: 0.8rem 1.1rem 0.8rem 2.8rem;
  border-radius: var(--radius); border: 1.5px solid var(--border);
  background: var(--search-bg); color: var(--text-0);
  font-size: 0.92rem; font-family: var(--font-body);
  transition: all var(--transition); outline: none;
}
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.search-input::placeholder { color: var(--text-2); }
.search-icon {
  position: absolute; left: 0.95rem; top: 50%; transform: translateY(-50%);
  color: var(--text-2); font-size: 0.85rem;
}
.search-stats {
  text-align: center; margin-top: 0.5rem; font-size: 0.75rem;
  color: var(--text-2); font-family: var(--font-display);
}

/* --- Ad containers --- */
.ad-container {
  max-width: var(--max-w); margin: 0.5rem auto; padding: 0 1.25rem;
}

/* --- Tabs --- */
.tabs-section { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }
.tab-row {
  display: flex; gap: 0.35rem; padding: 0.4rem 0;
  overflow-x: auto; scrollbar-width: thin;
}
.tab-row::-webkit-scrollbar { height: 3px; }
.tab-row::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }
.tab-row.wrap {
  flex-wrap: wrap; overflow-x: visible;
}
.tab-btn {
  flex-shrink: 0; padding: 0.45rem 0.9rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--tag-bg);
  color: var(--text-1); font-size: 0.8rem; font-weight: 500;
  cursor: pointer; transition: all var(--transition);
  display: flex; align-items: center; gap: 0.3rem;
  font-family: var(--font-body); white-space: nowrap;
}
.tab-btn:hover { border-color: var(--accent); color: var(--accent); }
.tab-btn.active { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 700; }
.tab-btn i { font-size: 0.78rem; }
.platform-tabs { margin-top: 0.15rem; }

/* --- Content Area --- */
.content-area {
  max-width: var(--max-w); margin: 0.75rem auto 0; padding: 0 1.25rem;
  display: grid; grid-template-columns: 1fr 220px; gap: 1rem;
}
.main-col { min-width: 0; }
.side-col { position: sticky; top: 72px; height: fit-content; }

/* --- Shortcut Cards --- */
.category-section { margin-bottom: 1.75rem; }
.category-header {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.65rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--border);
}
.category-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.category-name { font-family: var(--font-display); font-size: 0.9rem; font-weight: 700; }
.category-count { font-size: 0.72rem; color: var(--text-2); font-family: var(--font-display); }
.shortcuts-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.5rem;
}
.shortcut-card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.8rem 0.9rem; transition: all var(--transition); position: relative;
  overflow: hidden;
}
.shortcut-card:hover {
  border-color: var(--accent); background: var(--bg-3);
  transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.4rem; }
.card-desc { font-weight: 600; font-size: 0.88rem; }
.card-actions { display: flex; gap: 0.25rem; }
.card-action-btn {
  width: 26px; height: 26px; border-radius: 5px; border: none;
  background: transparent; color: var(--text-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; transition: all var(--transition);
}
.card-action-btn:hover { background: var(--bg-hover); color: var(--accent); }
.card-action-btn.bookmarked { color: #f59e0b; }
.card-action-btn.copied { color: var(--accent); }
.card-keys { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; margin-bottom: 0.35rem; }

/* --- THE KEY --- */
.key {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 28px; padding: 0 7px;
  background: var(--key-face); border: 1px solid var(--key-border);
  border-radius: 4px; box-shadow: var(--key-shadow);
  font-family: var(--font-display); font-size: 0.75rem; font-weight: 600;
  color: var(--key-text); transition: transform 0.1s;
}
.key:hover { transform: translateY(2px); box-shadow: 0 1px 0 var(--key-border); }
.key-sep { color: var(--text-2); font-size: 0.65rem; font-weight: 700; margin: 0 1px; }
.card-usage { font-size: 0.75rem; color: var(--text-2); line-height: 1.4; }

/* --- Sidebar --- */
.sidebar-card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 0.9rem; margin-bottom: 0.75rem;
}
.sidebar-title {
  font-family: var(--font-display); font-size: 0.8rem; font-weight: 700;
  margin-bottom: 0.6rem; display: flex; align-items: center; gap: 0.35rem;
}
.sidebar-title i { color: var(--accent); }
.popular-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.4rem 0; border-bottom: 1px solid var(--border); font-size: 0.78rem;
}
.popular-item:last-child { border-bottom: none; }
.popular-keys { font-family: var(--font-display); color: var(--accent); font-weight: 600; }
.popular-desc { color: var(--text-1); }
.sidebar-tip { font-size: 0.75rem; color: var(--text-2); line-height: 1.5; }

/* --- Empty State --- */
.empty-state {
  text-align: center; padding: 3rem 1rem; color: var(--text-2);
}
.empty-state i { font-size: 3rem; margin-bottom: 0.75rem; display: block; }
.empty-state h3 { font-size: 1.1rem; color: var(--text-1); margin-bottom: 0.3rem; }
.empty-state p { font-size: 0.85rem; }

/* --- SEO Section --- */
.seo-section {
  max-width: var(--max-w); margin: 2rem auto 0; padding: 0 1.25rem;
}
.seo-article {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem 2rem;
}
.seo-article h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 1rem; }
.seo-article h3 { font-size: 1rem; font-weight: 600; margin: 1rem 0 0.4rem; color: var(--accent); }
.seo-article p { font-size: 0.88rem; color: var(--text-1); margin-bottom: 0.6rem; line-height: 1.7; }

/* --- Footer --- */
.footer {
  margin-top: 3rem; border-top: 1px solid var(--border);
  background: var(--bg-1); padding: 1.75rem 1.25rem;
}
.footer-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1.5rem;
}
.footer-col h4 {
  font-family: var(--font-display); font-size: 0.78rem; font-weight: 700;
  color: var(--text-0); margin-bottom: 0.4rem;
}
.footer-col a, .footer-col p {
  display: block; color: var(--text-2); text-decoration: none;
  font-size: 0.75rem; line-height: 1.7;
}
.footer-col a:hover { color: var(--accent); }
.footer-copy {
  max-width: var(--max-w); margin: 1rem auto 0; padding-top: 0.75rem;
  border-top: 1px solid var(--border); text-align: center;
  font-size: 0.7rem; color: var(--text-2);
}

/* --- Toast --- */
.toast {
  position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 300;
  background: var(--accent); color: #000;
  padding: 0.6rem 1rem; border-radius: var(--radius-sm);
  font-size: 0.82rem; font-weight: 600; font-family: var(--font-display);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  animation: toastIn 0.25s ease; transition: opacity 0.3s;
  display: flex; align-items: center; gap: 0.4rem;
}
.toast-error { background: #ef4444; color: #fff; }
@keyframes toastIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* --- Inline ad --- */
.ad-slot-inline { margin: 1rem 0; }

/* --- Animations --- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.category-section { animation: fadeUp 0.25s ease both; }
.category-section:nth-child(2) { animation-delay: 0.04s; }
.category-section:nth-child(3) { animation-delay: 0.08s; }

/* --- Responsive --- */
@media (max-width: 900px) {
  .content-area { grid-template-columns: 1fr; }
  .side-col { display: none; }
}
@media (max-width: 600px) {
  .header-inner { height: 48px; padding: 0 0.75rem; }
  .logo span { display: none; }
  .nav-links { display: none; }
  .btn-bookmark span { display: none; }
  .search-section { padding: 0.75rem; }
  .shortcuts-grid { grid-template-columns: 1fr; }
  .content-area { padding: 0 0.75rem; }
  .seo-article { padding: 1rem; }
  .footer-inner { flex-direction: column; gap: 1rem; }
}

/* --- Subpage Styles --- */
.subpage-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}
.page-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.page-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.page-header h1 i {
  color: var(--accent);
  margin-right: 0.4rem;
}
.page-header p {
  color: var(--text-2);
  font-size: 0.9rem;
}
.page-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.page-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.page-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--accent);
}
.page-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1rem 0 0.4rem;
}
.page-card p {
  font-size: 0.88rem;
  color: var(--text-1);
  line-height: 1.7;
  margin-bottom: 0.5rem;
}
.page-card ul, .page-card ol {
  padding-left: 1.2rem;
  margin: 0.5rem 0;
}
.page-card li {
  font-size: 0.88rem;
  color: var(--text-1);
  line-height: 1.8;
}
.page-card a {
  color: var(--accent);
}

/* --- Prompt Card (distinct from shortcut card) --- */
.prompt-section .category-dot { background: #f59e0b !important; }
.category-badge {
  font-size: 0.6rem; font-weight: 700; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px; letter-spacing: 0.05em;
}
.prompt-badge {
  background: rgba(245,158,11,0.15); color: #f59e0b;
  border: 1px solid rgba(245,158,11,0.3);
}

.prompt-card {
  border-left: 3px solid #f59e0b !important;
  background: var(--bg-2) !important;
}
.prompt-card:hover {
  border-left-color: #fbbf24 !important;
}
.prompt-icon {
  color: #f59e0b;
  margin-right: 0.35rem;
  font-size: 0.82rem;
}
.prompt-key code {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: 5px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 600;
  color: #fbbf24;
  margin-bottom: 0.35rem;
}
[data-theme="light"] .prompt-key code {
  background: rgba(245,158,11,0.08);
  color: #b45309;
  border-color: rgba(245,158,11,0.3);
}

/* --- Affiliate CTA --- */
.affiliate-cta {
  margin: 1.5rem 0;
}
.affiliate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, var(--accent), #00b896);
  color: #000;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: var(--font-body);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all var(--transition);
  box-shadow: 0 2px 8px rgba(0,221,179,0.25);
}
.affiliate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,221,179,0.35);
  filter: brightness(1.05);
}
.affiliate-btn i:last-child {
  transition: transform 0.2s;
}
.affiliate-btn:hover i:last-child {
  transform: translateX(3px);
}
[data-theme="light"] .affiliate-btn {
  background: linear-gradient(135deg, #0891b2, #06b6d4);
  color: #fff;
  box-shadow: 0 2px 8px rgba(8,145,178,0.25);
}

/* --- Ad Container (hidden until AdSense activated) --- */
.ad-container {
  display: none; /* Hidden until CONFIG.adsense.enabled = true */
  background: var(--bg-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  text-align: center;
  overflow: hidden;
}
.ad-container.active {
  display: block;
}
