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

:root {
  --bg-primary: #0b0d13;
  --bg-secondary: #131722;
  --bg-card: rgba(22, 28, 45, 0.4);
  --bg-card-hover: rgba(28, 36, 58, 0.6);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-active: rgba(255, 255, 255, 0.2);
  
  --text-primary: #f3f4f6;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  
  --accent-primary: #f97316; /* 놀고팜 오렌지 */
  --accent-blue: #3b82f6;    /* 아이러브고향 블루 */
  --accent-green: #10b981;   /* 법령 그린 */
  --accent-purple: #8b5cf6;  /* 경쟁사 보라 */
  --accent-teal: #14b8a6;
  
  --gradient-main: linear-gradient(135deg, #f97316 0%, #8b5cf6 50%, #3b82f6 100%);
  --gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
  --gradient-dark: linear-gradient(180deg, #131722 0%, #0b0d13 100%);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background-color: var(--bg-primary);
  background-image: var(--gradient-dark);
  color: var(--text-primary);
  font-family: 'Inter', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.7;
  overflow-x: hidden;
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Layout container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Glassmorphism Header */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(11, 13, 19, 0.7);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
}

.logo-area {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.nav {
  display: flex;
  gap: 8px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition-smooth);
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  background: var(--gradient-main);
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

.nav-link.own::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-blue);
}

.nav-link.comp::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-purple);
}

.nav-link.pol::before {
  content: "§";
  color: var(--accent-green);
  font-weight: 800;
}

/* Page head */
.page-head {
  padding: 60px 0 30px;
  text-align: left;
}

.page-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 2.5rem;
  letter-spacing: -1px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-meta {
  color: var(--text-muted);
  font-size: 0.95rem;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.page-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-meta span::after {
  content: "•";
  margin-left: 16px;
  color: rgba(255, 255, 255, 0.1);
}

.page-meta span:last-child::after {
  content: none;
}

/* Common Components */
h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  margin: 50px 0 20px;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 4px solid var(--accent-primary);
  padding-left: 16px;
}

h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 30px 0 15px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

p {
  margin-bottom: 20px;
  color: var(--text-secondary);
}

/* Lead text block */
.lead-box {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  background-image: var(--gradient-card);
  border-radius: var(--radius-md);
  padding: 24px;
  margin: 24px 0 40px;
  font-size: 1.05rem;
  border-left: 5px solid var(--accent-primary);
  box-shadow: var(--shadow-glass);
}

.lead-box.blue { border-left-color: var(--accent-blue); }
.lead-box.green { border-left-color: var(--accent-green); }
.lead-box.purple { border-left-color: var(--accent-purple); }

.lead-box b {
  color: #fff;
}

/* Cards & Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin: 30px 0;
}

.card {
  background: var(--bg-card);
  background-image: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  transition: var(--transition-smooth);
}

.card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: var(--border-color-active);
  box-shadow: var(--shadow-md);
}

.card:hover::before {
  background: var(--gradient-main);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: #fff;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Badges / Tags */
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.own {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge.comp {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge.pol {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Beautiful Premium Table */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin: 30px 0;
  box-shadow: var(--shadow-glass);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.925rem;
}

th, td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}

th {
  background: rgba(22, 28, 45, 0.7);
  font-weight: 700;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

tr {
  transition: var(--transition-smooth);
}

tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

tr:last-child td {
  border-bottom: none;
}

/* IA tree style */
.ia-box {
  background: rgba(11, 13, 19, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  font-family: 'Fira Code', 'Courier New', Courier, monospace;
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--text-secondary);
  overflow-x: auto;
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
}

.ia-box b {
  color: var(--accent-primary);
}

/* Screenshots gallery */
.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.screenshot-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.screenshot-card:hover {
  transform: scale(1.02);
  border-color: var(--border-color-active);
  box-shadow: var(--shadow-md);
}

.screenshot-img-wrap {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: #000;
  border-bottom: 1px solid var(--border-color);
}

.screenshot-img-wrap.mobile {
  aspect-ratio: 9/16;
  max-height: 400px;
  display: flex;
  justify-content: center;
}

.screenshot-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.screenshot-img-wrap.mobile img {
  width: auto;
  height: 100%;
  object-fit: contain;
}

.screenshot-caption {
  padding: 12px 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
}

/* Score chart component */
.score-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin: 30px 0;
}

.score-row {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  gap: 16px;
}

.score-label {
  width: 140px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.score-bar-bg {
  flex-grow: 1;
  height: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 99px;
  overflow: hidden;
}

.score-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--gradient-main);
  width: 0%;
  transition: width 1s ease-in-out;
}

.score-val {
  width: 40px;
  text-align: right;
  font-weight: 700;
  color: #fff;
  font-size: 0.95rem;
  font-family: 'Outfit', sans-serif;
}

/* Pager / Nav links footer */
.pager {
  display: flex;
  justify-content: space-between;
  margin: 60px 0 40px;
  gap: 20px;
}

.pager-btn {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  text-decoration: none;
  color: var(--text-primary);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pager-btn:hover {
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.pager-btn.prev {
  text-align: left;
}

.pager-btn.next {
  text-align: right;
}

.pager-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.pager-title {
  font-weight: 700;
  font-size: 1.1rem;
}

/* Footer style */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 40px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  background: rgba(11, 13, 19, 0.8);
}

.footer p {
  margin-bottom: 8px;
}

/* Code highlight style */
pre {
  background: rgba(11, 13, 19, 0.8);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  overflow-x: auto;
  margin: 20px 0;
}

code {
  font-family: 'Fira Code', 'Courier New', Courier, monospace;
  font-size: 0.85rem;
}

/* Highlights text formatting */
.text-good { color: var(--accent-green); font-weight: 600; }
.text-bad { color: #ef4444; font-weight: 600; }
.text-accent { color: var(--accent-primary); font-weight: 600; }

/* Responsive styles */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    gap: 16px;
  }
  .nav {
    flex-wrap: wrap;
    justify-content: center;
  }
  .page-title {
    font-size: 2rem;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .pager {
    flex-direction: column;
  }
  th, td {
    padding: 12px 14px;
  }
}
