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

:root {
  --primary-color: #007bff;
  --primary-hover: #0056b3;
  --bg-color: #f4f7f6;
  --card-bg: #ffffff;
  --text-main: #2d3436;
  --text-muted: #636e72;
  --border-color: #dfe6e9;
  --nav-bg: #ffffff;
  --footer-bg: #2d3436;
}

body {
  font-family: 'Noto Sans KR', sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.8;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Navigation */
.navbar {
  background-color: var(--nav-bg);
  box-shadow: 0 2px 15px rgba(0,0,0,0.08);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.nav-container {
  max-width: 1200px; /* Wider nav */
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px; /* Adjusted padding */
  min-height: 70px; /* Allow container to grow */
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
  letter-spacing: -1px;
}

.nav-menu {
  display: flex;
  gap: 18px; /* Reduced gap */
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
  flex-wrap: nowrap; /* Prevent ugly wrapping */
}

.nav-menu a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.3s;
  padding: 10px 5px;
  position: relative;
  white-space: nowrap; /* Prevent text from breaking mid-word */
}

.nav-menu a:hover, .nav-menu a.active {
  color: var(--primary-color);
}

.nav-menu a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 3px 3px 0 0;
}

/* Dropdown styles */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown .dropbtn::after {
    content: ' ▼';
    font-size: 0.7rem;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: var(--card-bg);
  min-width: 180px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
  border-radius: 8px;
  padding: 10px 0;
  margin-top: 10px; /* Add some space */
}

.dropdown-content a {
  color: var(--text-muted);
  padding: 12px 20px;
  text-decoration: none;
  display: block;
  text-align: left;
}

.dropdown-content a::after { display: none; } /* Remove underline from dropdown links */
.dropdown-content a:hover { background-color: var(--bg-color); }
.dropdown:hover .dropdown-content { display: block; }
.nav-menu .dropdown a.active::after { display: none; } /* No active underline for dropdown parent */


/* Main Layout */
main {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 50px 20px;
}

.container {
  width: 100%;
  max-width: 900px; /* Adjusted for better focus on forms */
  margin-bottom: 40px;
}

.card-container {
    background-color: var(--card-bg);
    padding: 50px;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.04);
}

/* Shorten Form Styles */
#shorten-form .input-row {
    display: flex;
    margin-bottom: 15px;
    width: 100%;
}
#shorten-form input {
    flex-grow: 1;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px 0 0 8px;
    font-size: 1rem;
}
#shorten-form #submit-btn {
    padding: 15px 25px;
    border: none;
    background-color: var(--primary-color);
    color: white;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.3s;
    white-space: nowrap;
}
#shorten-form #submit-btn:hover { background-color: var(--primary-hover); }
#shorten-form .input-row.optional input { 
    border-radius: 8px; 
    margin-right: 0;
}
.features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    color: var(--text-muted);
}
.result {
    margin-top: 20px;
}

/* Typography for Content Richness */
h1, .page-header h1 {
  font-size: 2.8rem;
  margin-bottom: 10px;
  letter-spacing: -1.5px;
  color: #1e272e;
  text-align: center;
  border: none;
  padding: 0;
}

.subtitle, .page-header p {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 40px;
  text-align: center;
}

/* General Card used in multiple places */
.card {
    padding: 2rem;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

/* Tool Card specific styles */
.tool-card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.tool-card {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.tool-card-icon { font-size: 2.5rem; color: var(--primary-color); margin-bottom: 20px; }
.tool-card h3 { margin: 0 0 15px 0; font-size: 1.4rem; color: var(--text-main); }
.tool-card p { color: var(--text-muted); font-size: 0.95rem; flex-grow: 1; margin-bottom: 20px; }
.tool-card-link { background-color: var(--primary-color); color: white; padding: 12px 20px; border-radius: 10px; text-decoration: none; font-weight: 500; transition: background-color 0.3s; }
.tool-card-link:hover { background-color: var(--primary-hover); }

/* Footer */
footer {
  background-color: var(--footer-bg);
  color: #ecf0f1;
  padding: 60px 0 30px;
  width: 100%;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  padding: 0 20px;
}

.footer-section h4 { color: #ffffff; margin-bottom: 20px; font-size: 1.2rem; }
.footer-section ul { list-style: none; padding: 0; margin: 0; }
.footer-section li { margin-bottom: 12px; }
.footer-section a { color: #bdc3c7; text-decoration: none; transition: color 0.3s; }
.footer-section a:hover { color: var(--primary-color); }

.footer-bottom {
  max-width: 1200px;
  margin: 40px auto 0;
  padding: 30px 20px 0;
  border-top: 1px solid #444;
  text-align: center;
  color: #7f8c8d;
  font-size: 0.9rem;
}

/* Dark Mode */
body.dark-mode {
  --bg-color: #121212;
  --card-bg: #1e1e1e;
  --text-main: #e0e0e0;
  --text-muted: #95a5a6;
  --nav-bg: #1e1e1e;
  --border-color: #333;
}

body.dark-mode h1, body.dark-mode h2, body.dark-mode .page-header h1 { color: #ffffff; }
body.dark-mode .tool-card { background-color: #2c2c2c; }
body.dark-mode .dropdown-content { background-color: #2c2c2c; }
body.dark-mode .dropdown-content a:hover { background-color: #333; }

/* 모바일 네비게이션 — hover 드롭다운이 터치에서 안 열리는 문제 대응 */
@media (max-width: 600px) {
  .nav-container { flex-wrap: wrap; row-gap: 4px; padding: 8px 14px; min-height: 0; }
  .nav-logo { font-size: 1.3rem; }
  .nav-menu { flex-wrap: wrap; gap: 8px 14px; width: 100%; justify-content: center; }
  .nav-menu a { font-size: 0.9rem; padding: 6px 2px; }
  /* 모바일에서는 '건강 계산기' 라벨 대신 계산기 링크를 펼쳐 노출 */
  .dropdown { position: static; }
  .dropdown .dropbtn { display: none; }
  .dropdown-content {
    display: flex; position: static; flex-wrap: wrap; justify-content: center;
    gap: 8px 14px; min-width: 0; padding: 0; box-shadow: none; background: transparent;
  }
  .dropdown-content a { padding: 6px 2px; }
  #theme-toggle { display: none; }
}

/* Hide broken search widget */
.widget_search {
  display: none !important;
}

