/* 1. Global Reset and Root Variables */
:root {
  --dark-bg: #1a1a1a;
  --dark-ui-bg: #2a2a2a;
  --text-light: #f0eadd;
  --text-medium: #a0a0a0;
  --accent-gold: #c8a464;
  --accent-gold-hover: #e0b674;
  --border-color: #444;
  --parchment: #f4e8d0;
  --aged-paper: #e8dcc0;
  --dark-brown: #3d2817;
}

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

/* 2. Body and Main Layout */
body {
  font-family: 'Lato', sans-serif;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2416 100%);
  color: var(--text-light);
  line-height: 1.6;
  min-height: 100vh;
  padding: 20px;
}

.parchment-border {
  max-width: 900px;
  margin: 0 auto;
  border: 3px solid var(--accent-gold);
  border-radius: 8px;
  box-shadow: 0 0 30px rgba(200, 164, 100, 0.3), inset 0 0 50px rgba(0, 0, 0, 0.5);
  background: var(--dark-bg);
  position: relative;
}

.parchment-border::before,
.parchment-border::after {
  content: '◆';
  position: absolute;
  color: var(--accent-gold);
  font-size: 1.5rem;
  top: -15px;
}

.parchment-border::before {
  left: 20px;
}

.parchment-border::after {
  right: 20px;
}

.site-header,
.generator-app,
.site-footer {
  width: 90%;
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 0;
}

/* 3. Component Styles */

/* Header */
.site-header {
  text-align: center;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 2rem;
  position: relative;
}

.royal-emblem {
  font-size: 3rem;
  color: var(--accent-gold);
  margin-bottom: 0.5rem;
  text-shadow: 0 0 10px rgba(200, 164, 100, 0.5);
}

.site-header h1 {
  font-family: 'Cinzel', serif;
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--accent-gold);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
  letter-spacing: 2px;
}

.site-header .tagline {
  font-size: 1.1rem;
  font-style: italic;
  color: var(--text-medium);
  margin-top: 0.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Control Panel */
.control-panel {
  background: linear-gradient(135deg, var(--dark-ui-bg) 0%, #1f1f1f 100%);
  border-radius: 8px;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  border: 2px solid var(--border-color);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.control-group {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.control-group label {
  font-size: 0.9rem;
  color: var(--accent-gold);
  margin-bottom: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.control-group select {
  font-family: 'Lato', sans-serif;
  font-size: 1rem;
  padding: 10px;
  background-color: var(--dark-bg);
  color: var(--text-light);
  border: 1px solid var(--accent-gold);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.control-group select:hover {
  border-color: var(--accent-gold-hover);
  box-shadow: 0 0 8px rgba(200, 164, 100, 0.3);
}

#generate-btn {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.2rem;
  background: linear-gradient(135deg, var(--accent-gold) 0%, #b8944a 100%);
  color: var(--dark-bg);
  border: none;
  padding: 12px 24px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  height: 46px;
  align-self: flex-end;
  box-shadow: 0 4px 10px rgba(200, 164, 100, 0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
}

#generate-btn:hover {
  background: linear-gradient(135deg, var(--accent-gold-hover) 0%, var(--accent-gold) 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(200, 164, 100, 0.6);
}

#generate-btn:active {
  transform: translateY(0);
}

/* Placeholder Scroll */
.placeholder-scroll {
  background: linear-gradient(135deg, var(--dark-ui-bg) 0%, #1f1f1f 100%);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 3rem 2rem;
  text-align: center;
  margin-top: 2rem;
}

.placeholder-text {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  color: var(--accent-gold);
  margin-bottom: 1rem;
}

.placeholder-subtext {
  color: var(--text-medium);
  font-style: italic;
  max-width: 500px;
  margin: 0 auto;
}

/* Results Area */
#results-container {
  margin-top: 2rem;
}

.result-card {
  background: linear-gradient(135deg, var(--dark-ui-bg) 0%, #1f1f1f 100%);
  padding: 16px 20px;
  border-radius: 4px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.result-card:hover {
  border-color: var(--accent-gold);
  box-shadow: 0 4px 12px rgba(200, 164, 100, 0.2);
  transform: translateX(5px);
}

.kingdom-name {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  color: var(--text-light);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.copy-btn {
  font-family: 'Lato', sans-serif;
  font-size: 0.9rem;
  background: var(--accent-gold);
  color: var(--dark-bg);
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.copy-btn:hover {
  background-color: var(--accent-gold-hover);
  box-shadow: 0 2px 8px rgba(200, 164, 100, 0.4);
}

.copy-btn:disabled {
  background-color: var(--text-medium);
  cursor: default;
}

/* Footer */
.site-footer {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-medium);
  border-top: 2px solid var(--border-color);
  margin-top: 2rem;
  padding-top: 2rem;
}

.footer-links {
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--accent-gold);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--accent-gold-hover);
  text-decoration: underline;
}

.footer-links .separator {
  margin: 0 10px;
  color: var(--border-color);
}

.site-footer p {
  margin: 0.5rem 0;
}

/* Content Sections */
.content-section {
  width: 90%;
  max-width: 800px;
  margin: 2.5rem auto;
  padding: 1.5rem;
  background-color: var(--dark-ui-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.content-section h2 {
  font-family: 'Cinzel', serif;
  font-size: 2rem;
  color: var(--accent-gold);
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.content-section h3 {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  color: var(--text-light);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.content-section p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.content-section ul,
.content-section ol {
  margin-left: 20px;
  padding-left: 10px;
}

.content-section li {
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

.content-section ol li {
  padding-left: 0.5rem;
}

.content-section a {
  color: var(--accent-gold);
  text-decoration: none;
}

.content-section a:hover {
  text-decoration: underline;
  color: var(--accent-gold-hover);
}

/* Legal Pages Styles */
.legal-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

.legal-page h1 {
  font-family: 'Cinzel', serif;
  color: var(--accent-gold);
  margin-bottom: 1rem;
  font-size: 2.5rem;
}

.legal-page h2 {
  font-family: 'Cinzel', serif;
  color: var(--accent-gold);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.8rem;
}

.legal-page p {
  margin-bottom: 1rem;
  line-height: 1.8;
}

.legal-page ul {
  margin-left: 2rem;
  margin-bottom: 1rem;
}

.legal-page li {
  margin-bottom: 0.5rem;
}

.back-link {
  display: inline-block;
  margin-top: 2rem;
  color: var(--accent-gold);
  text-decoration: none;
  font-weight: 600;
}

.back-link:hover {
  color: var(--accent-gold-hover);
  text-decoration: underline;
}

/* 4. Responsiveness */
@media (max-width: 600px) {
  .control-panel {
    flex-direction: column;
    align-items: stretch;
  }
  
  #generate-btn {
    align-self: auto;
    width: 100%;
    margin-top: 1rem;
    padding: 16px;
  }

  .result-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .copy-btn {
    width: 100%;
  }

  .site-header h1 {
    font-size: 2rem;
  }

  .royal-emblem {
    font-size: 2rem;
  }

  .placeholder-text {
    font-size: 1.2rem;
  }
}
