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

:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --bg-color: #fafafa;
  --surface-color: #ffffff;
  --text-main: #0f172a;
  --text-muted: #475569;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.08);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  --radius: 12px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: "Inter", "Noto Sans KR", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Layout */
.app-container {
  display: flex;
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Sidebar Navigation (Fixed for reliable sticky behavior) */
.sidebar {
  width: 260px;
  background-color: var(--surface-color);
  border-right: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  position: fixed;
  left: max(0px, calc((100vw - 1400px) / 2));
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 10;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 2.5rem;
  letter-spacing: -0.01em;
}

.logo svg {
  color: var(--primary-color);
}

.nav-list {
  list-style: none;
}

.nav-item {
  margin-bottom: 0.2rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  border-radius: 8px;
  transition: var(--transition);
  font-size: 0.95rem;
}

.nav-link svg {
  stroke: currentColor;
  opacity: 0.7;
  transition: var(--transition);
}

/* Search Bar */
.search-container {
  position: sticky;
  top: 0;
  background: var(--surface-color);
  z-index: 10;
  margin-bottom: 1.5rem;
}

#tool-search {
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  font-size: 0.9rem;
  transition: all 0.2s ease;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

#tool-search:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: #fff;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.nav-link:hover, .nav-link.active {
  background-color: #f1f5f9;
  color: var(--primary-color);
}

.nav-link:hover svg, .nav-link.active svg {
  opacity: 1;
  stroke: var(--primary-color);
}

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: 260px; /* Offset the fixed sidebar */
  padding: 2.5rem 3.5rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  max-width: 900px;
  opacity: 1;
  transition: opacity 0.3s;
}

.main-content.loading {
  opacity: 0.5;
  pointer-events: none;
}

header h1 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  color: #0f172a;
}

header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Tools Grid (Dashboard) */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.tool-card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tool-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

.tool-icon {
  width: 44px;
  height: 44px;
  background: #eff6ff;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  margin-bottom: 0.5rem;
}

.tool-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.tool-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Tool Interface Area */
.tool-interface {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--text-main);
  font-size: 0.95rem;
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
  background-color: #fcfcfc;
  color: var(--text-main);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background-color: #ffffff;
}

textarea.form-control {
  min-height: 140px;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.75rem;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: -0.01em;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

.btn-block {
  width: 100%;
}

.btn-group {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

/* Result Area */
.result-box {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1.05rem;
  word-break: break-all;
  min-height: 80px;
  color: var(--text-main);
}

/* Ad Placement Placeholder */
.ad-container {
  background-color: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
  margin: 1.5rem 0;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* SEO Content Toggle */
.seo-details {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-top: 1rem;
  overflow: hidden;
}

.seo-summary {
  padding: 1.5rem 2rem;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-main);
  list-style: none;
  border-bottom: 1px solid transparent;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.seo-summary:hover {
  background-color: #f8fafc;
}
.seo-summary::-webkit-details-marker {
  display: none;
}
.seo-summary::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s;
}
.seo-details[open] .seo-summary::before {
  transform: rotate(45deg);
}
.seo-details[open] .seo-summary {
  border-bottom: 1px solid var(--border-color);
  background-color: #f8fafc;
}

/* SEO Content Area */
.seo-content {
  padding: 2.5rem;
  background-color: var(--surface-color);
}

.seo-content h2 {
  font-size: 1.35rem;
  margin-bottom: 1.25rem;
  color: var(--text-main);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.seo-content h3 {
  font-size: 1.15rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
  color: var(--text-main);
}

.seo-content p {
  margin-bottom: 1rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.seo-content ul {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
}

.seo-content li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

/* Cross Links */
.cross-links {
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin-top: 2.5rem;
}

.cross-links h3 {
  font-size: 1.1rem;
  color: var(--text-main);
  margin-bottom: 1rem;
  font-weight: 600;
}

.cross-link-btn {
  display: inline-block;
  background-color: var(--surface-color);
  color: var(--text-main);
  padding: 0.6rem 1.25rem;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  margin: 0.25rem;
}

.cross-link-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* Footer */
footer {
  text-align: center;
  padding: 3rem 2rem;
  color: #94a3b8;
  font-size: 0.9rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
  margin-left: 260px;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem;
    left: 0;
    z-index: 10;
  }
  
  .logo {
    margin-bottom: 1.25rem;
  }

  .nav-list {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    /* 스크롤바 숨김 (선택사항) */
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
  }
  .nav-list::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera*/
  }

  .nav-item {
    margin-bottom: 0;
    white-space: nowrap;
  }
  
  .main-content {
    margin-left: 0;
    padding: 1.5rem 1rem;
  }
  
  footer {
    margin-left: 0;
    padding: 2rem 1rem;
  }
  
  .btn-group {
    flex-direction: column;
  }
}

/* Auto-generated styles from HTML inline styles */
.auto-style-61df163b { display: flex; flex-direction: column; align-items: center; border: none; background: transparent; padding: 1rem 0; }
.auto-style-738b2f03 { width: 100%; max-width: 680px; height: 140px; overflow: hidden; display: flex; justify-content: center; }
.auto-style-3e0512b1 { border: none; }
.auto-style-23354c6a { font-size: 0.75rem; color: #94a3b8; margin-top: 1rem; text-align: center; line-height: 1.4; font-weight: 400; letter-spacing: -0.01em; }
.auto-style-d5e8c5f3 { flex:1; }
.auto-style-3645c266 { flex:1; background-color:#475569; box-shadow:none; }
.auto-style-cf0f3aef { margin-top: 2rem; }
.auto-style-05bae670 { margin-top:1rem; background-color:var(--surface-color); color:var(--text-main); border:1px solid var(--border-color); }
.auto-style-d8d6f7a6 { padding: 1rem; }
.auto-style-cfe21962 { min-height: 120px; display: flex; align-items: center; justify-content: center; margin-top:2rem; }
.auto-style-9422cfcf { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.auto-style-6094761d { flex:1; min-width:120px; background:var(--bg-color); border:1px solid var(--border-color); padding:1rem; border-radius:12px; text-align:center; }
.auto-style-70d90d94 { display:block; font-size:0.85rem; color:var(--text-muted); margin-bottom:0.25rem; }
.auto-style-72210ca8 { font-size:1.75rem; color:var(--primary-color); }
.auto-style-c54196f6 { font-size:1.75rem; color:var(--text-main); }
.auto-style-e0cbda6a { min-height: 250px; font-size: 1.05rem; }

#custom-toast {
    visibility: hidden; min-width: 250px; margin-left: -125px;
    background-color: #333; color: #fff; text-align: center;
    border-radius: 8px; padding: 16px; position: fixed; z-index: 9999;
    left: 50%; bottom: 30px; font-size: 1rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
#custom-toast.show {
    visibility: visible;
    -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}
@-webkit-keyframes fadein { from {bottom: 0; opacity: 0;} to {bottom: 30px; opacity: 1;} }
@keyframes fadein { from {bottom: 0; opacity: 0;} to {bottom: 30px; opacity: 1;} }
@-webkit-keyframes fadeout { from {bottom: 30px; opacity: 1;} to {bottom: 0; opacity: 0;} }
@keyframes fadeout { from {bottom: 30px; opacity: 1;} to {bottom: 0; opacity: 0;} }
