:root {
  --card-bg: #fff;
  --text-color: #333;
  --tag-bg: #00c2a8;
  --bg-color: #f5f7fa;
}

body, html {
  height: 100%;
}
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main.container {
  flex: 1 0 auto;
}
footer.footer {
  margin-top: 2rem;
}

/* 헤더 홈 링크 전용 */
.logo {
  text-decoration: none;
  color: white;
  font-weight: bold;
}

.logo:hover {
  opacity: 0.8;
}

body {
  margin: 0;
  font-family: 'Pretendard', sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.4s ease, color 0.4s ease;
}

header {
  background: var(--tag-bg);
  color: white;
  padding: 1.2rem 1rem;
  text-align: left;
  font-size: 1.5rem;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
}

#darkModeToggle {
  background: #ededed;
  border: 2px solid #7fd6c3;
  border-radius: 6px;
  font-size: 1rem;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  color: #222;
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  transition: background-color 0.3s, color 0.3s;
  margin-left: 0;
}

#darkModeToggle:hover {
  background: #d6f3eb;
  color: #222;
}

#langToggle {
  background: transparent;
  border: 2px solid #fff;
  border-radius: 6px;
  font-size: 1rem;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  color: #fff;
  font-weight: 500;
  box-shadow: none;
  transition: background-color 0.3s, color 0.3s;
}

#langToggle:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

#darkModeToggle:hover {
  background: rgba(255,255,255,0.25);
}

.tools_grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
  max-width: 1200px;
  margin: auto;
}

.tool_card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text-color);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.4s ease, color 0.4s ease;
}

.tool_card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.tool_img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: #ddd;
}

.tool_content {
  padding: 1rem;
}

.tool_title {
  font-size: 1.1rem;
  font-weight: bold;
  margin: 0 0 0.5rem;
}

.tool_tag {
  display: inline-block;
  background: var(--tag-bg);
  color: white;
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
}

html.dark-mode {
  --card-bg: #333335;
  --text-color: #eaeaea;
  --bg-color: #222223;
}

.tool-info {
  display: block;
  width: 85%;
  margin: 130px 0 10px;
  color: var(--text-color);
  font-size: 1.05rem;
  line-height: 1.6;
  box-sizing: border-box;
}

/* Ezoic 사이드바 광고 레이아웃 */
.ad-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.main-content {
  flex: 1;
  min-width: 300px;
  max-width: 800px;
}

.ad-sidebar {
  width: 160px;
  min-height: 600px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: sticky;
  top: 20px;
}

/* 반응형 디자인 */
@media (max-width: 1200px) {
  .ad-sidebar is {
    display: none;
  }
}

@media (max-width: 768px) {
  .ad-container {
    flex-direction: column;
    align-items: center;
  }
  
  .ad-sidebar {
    width: 100%;
    max-width: 300px;
    min-height: 250px;
    position: static;
  }
}
