/* Base Styles & Variables */
:root {
  --primary: #2C3E50;
  --accent: #C9A94E;
  --light: #E0E0E0;
  --dark: #1A252F;
}

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

body {
  font-family: 'Lora', serif;
  color: var(--light);
  background-color: var(--primary);
  line-height: 1.6;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navigation */
.navbar {
  background-color: var(--dark);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  color: var(--accent);
  font-size: 1.8rem;
  transition: all 0.3s ease;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: var(--light);
  text-decoration: none;
  transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-links > li > a.active {
    color: var(--accent) !important;
    font-weight: bold !important;
    border-bottom: 2px solid var(--accent) !important;
    padding-bottom: 3px !important;
}

/* Main Content */
.generator-section {
  padding: 3rem 0;
  text-align: center;
}

.generator-panel {
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  padding: 2rem;
  margin: 2rem 0;
  position: relative;
  overflow: hidden;
}

.loading-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  transform: translateX(-100%);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  100% { transform: translateX(100%); }
}

/* Generator UI Styles */
.generator-ui {
  max-width: 500px;
  margin: 0 auto;
}

.gender-selection {
  margin: 1.5rem 0;
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.gender-selection label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.btn {
  background-color: var(--accent);
  color: var(--dark);
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 4px;
  font-family: 'Lora', serif;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
}

.btn:hover {
  background-color: #d8b954;
  transform: translateY(-2px);
}

.result-container {
  margin-top: 2rem;
  padding: 2rem;
  background: rgba(0,0,0,0.1);
  border-radius: 6px;
  text-align: center;
}

.viking-name {
  font-size: 2rem;
  color: var(--accent);
  margin: 1rem 0;
}

.name-meaning,
.father-meaning {
  font-family: 'Lora', serif;
  font-style: italic;
  margin-bottom: 1.5rem;
}

.father-meaning {
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

.btn.secondary {
  background-color: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn.secondary:hover {
  background-color: rgba(201, 169, 78, 0.1);
}

/* Content Sections */
.seo-content,
.culture-section,
.stories-section {
  margin-top: 3rem;
  padding: 2rem;
}

/* 加载状态样式 */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: var(--light);
  gap: 1rem;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: var(--accent);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 错误状态样式 */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: var(--light);
  gap: 1rem;
  text-align: center;
}

.error-state button {
  background-color: var(--accent);
  color: var(--dark);
  border: none;
  padding: 0.8rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.error-state button:hover {
  opacity: 0.9;
}
.content-card {
  background: rgba(0,0,0,0.1);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
  transition: all 0.3s ease;
}

.content-card:last-child {
  margin-bottom: 0;
}

.seo-content h2,
.culture-section h2,
.stories-section h2 {
  color: var(--accent);
  margin-bottom: 1.5rem;
}

.seo-content h3,
.culture-section h3,
.stories-section h3 {
  color: var(--accent);
  margin: 1.5rem 0 1rem;
}

.seo-content ul,
.culture-section ul,
.stories-section ul {
  margin: 1rem 0;
  padding-left: 2rem;
}

.seo-content li,
.culture-section li,
.stories-section li {
  margin-bottom: 0.5rem;
}

.seo-content strong,
.culture-section strong,
.stories-section strong {
  color: var(--accent);
}

.story {
  margin-bottom: 3rem;
}

.moral {
  font-style: italic;
  color: var(--accent);
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
}

/* Footer */
.footer {
  background-color: var(--dark);
  padding: 1.5rem 0;
  text-align: center;
  margin-top: 3rem;
}

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
  .navbar .container {
    flex-direction: column;
    align-items: center;
  }

  .nav-links {
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    width: 100%;
    text-align: center;
  }

  .generator-panel {
    padding: 1rem;
    margin: 1rem 0;
  }

  .generator-ui {
    width: 100%;
    padding: 0 10px;
  }

  .gender-selection {
    flex-direction: column;
    gap: 0.5rem;
  }

  .btn {
    width: 100%;
    padding: 0.8rem;
  }

  .viking-name {
    font-size: 1.5rem;
  }
}

/* Logo Responsive Adjustments */
@media (max-width: 480px) {
  .logo {
    font-size: 1.4rem;
  }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
  .generator-panel {
    max-width: 80%;
    margin: 1.5rem auto;
  }
}

@media (min-width: 1600px) {
  .logo {
    font-size: 2.2rem;
  }
}

/* Classic Names Page Styles */
.filter-section {
  background: rgba(0,0,0,0.2);
  padding: 1.5rem;
  border-radius: 8px;
  margin: 2rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-end;
}

.filter-group {
  flex: 1;
  min-width: 200px;
}

.filter-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

.filter-group select {
  width: 100%;
  padding: 0.5rem;
  background: var(--dark);
  color: var(--light);
  border: 1px solid var(--accent);
  border-radius: 4px;
  font-family: 'Lora', serif;
}

.names-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.name-card {
  background: rgba(0,0,0,0.2);
  padding: 1.5rem;
  border-radius: 8px;
  transition: transform 0.3s;
}

.name-card:hover {
  transform: translateY(-5px);
}

.name-card h3 {
  color: var(--accent);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.name-card p {
  margin-bottom: 0.5rem;
}

.category-tag {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: var(--dark);
  color: var(--accent);
  border-radius: 20px;
  font-size: 0.8rem;
  margin-top: 1rem;
}