/**
 * main.css - Main site styles for Roman Coin Decoder
 */

:root {
  --primary-color: #8B4513;
  --secondary-color: #D4AF37;
  --dark-bg: #1a1a1a;
  --light-bg: #f5f5f5;
  --text-dark: #333;
  --text-light: #666;
  --border-color: #ddd;
  --success-color: #4caf50;
  --error-color: #f44336;
  --warning-color: #ff9800;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--dark-bg);
  color: var(--text-dark);
  line-height: 1.6;
}

/* Header and Navigation */
header {
  background: linear-gradient(135deg, var(--primary-color) 0%, #5a2e0f 100%);
  color: white;
  padding: 2rem 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

header h1 {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

header p {
  text-align: center;
  font-size: 1.1rem;
  opacity: 0.9;
}

/* Main Container */
main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

/* Card Styles */
.card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  margin-bottom: 2rem;
}

.card h2 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  border-bottom: 2px solid var(--secondary-color);
  padding-bottom: 0.5rem;
}

/* Input Styles */
.input-group {
  margin-bottom: 1.5rem;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--primary-color);
}

.input-group input,
.input-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
  font-family: monospace;
  transition: border-color 0.3s ease;
}

.input-group input:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 5px rgba(139, 69, 19, 0.2);
}

.input-group textarea {
  min-height: 120px;
  resize: vertical;
}

/* Button Styles */
.button-group {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

button {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: #a0522d;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(139, 69, 19, 0.3);
}

.btn-secondary {
  background: var(--secondary-color);
  color: var(--text-dark);
}

.btn-secondary:hover {
  background: #e6c200;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(212, 175, 55, 0.3);
}

.btn-danger {
  background: var(--error-color);
  color: white;
}

.btn-danger:hover {
  background: #da190b;
}

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

.decode-result {
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  border-left: 4px solid var(--primary-color);
}

.decode-result.full-decode {
  border-left-color: var(--secondary-color);
}

/* Summary Section */
.summary-section {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-color);
}

.emperor-card {
  background: linear-gradient(135deg, rgba(139, 69, 19, 0.1), rgba(212, 175, 55, 0.05));
  padding: 1.5rem;
  border-radius: 6px;
  border: 1px solid var(--secondary-color);
}

.emperor-card h3 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.emperor-card .reign {
  color: var(--text-light);
  margin-bottom: 1rem;
}

/* Confidence Meter */
.confidence-meter {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.confidence-bar {
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  flex: 1;
  max-width: 200px;
  overflow: hidden;
}

.confidence-bar::before {
  content: '';
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--success-color), var(--secondary-color));
  border-radius: 4px;
  width: 100%;
}

.confidence-text {
  font-weight: 600;
  color: var(--primary-color);
  white-space: nowrap;
}

/* Split View */
.split-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

.obverse-section,
.reverse-section {
  padding: 1.5rem;
  background: var(--light-bg);
  border-radius: 6px;
}

.obverse-section h3,
.reverse-section h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.legend {
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: white;
  border-radius: 4px;
  border-left: 3px solid var(--secondary-color);
  padding-left: 1rem;
}

/* Tokens Container */
.tokens-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.token-item {
  padding: 1rem;
  border-radius: 6px;
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
}

.token-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.token-abbreviation {
  border-left-color: var(--primary-color);
  background: rgba(139, 69, 19, 0.05);
}

.token-emperor_name {
  border-left-color: var(--success-color);
  background: rgba(76, 175, 80, 0.05);
}

.token-title {
  border-left-color: var(--secondary-color);
  background: rgba(212, 175, 55, 0.05);
}

.token-numeral {
  border-left-color: var(--warning-color);
  background: rgba(255, 152, 0, 0.05);
}

.token-unknown {
  border-left-color: #999;
  background: rgba(0, 0, 0, 0.02);
}

.token-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.token-text {
  font-family: monospace;
  font-weight: 700;
  color: var(--text-dark);
  font-size: 1.1rem;
}

.token-type {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--secondary-color);
  color: var(--text-dark);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.token-meaning {
  color: var(--text-light);
  font-size: 0.9rem;
  margin: 0.5rem 0;
}

.token-expansion {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.95rem;
}

.token-emperor {
  color: var(--success-color);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Emperor Details */
.emperor-details {
  background: var(--light-bg);
  padding: 1.5rem;
  border-radius: 6px;
  margin-top: 1.5rem;
}

.emperor-details h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.emperor-details p {
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.attested-info {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.attested-info h5 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.attested-info ul {
  list-style: none;
  padding-left: 0;
}

.attested-info li {
  padding: 0.5rem 0;
  color: var(--text-light);
}

.theme-info {
  background: white;
  padding: 1rem;
  border-radius: 4px;
  border-left: 3px solid var(--secondary-color);
  margin-top: 1rem;
}

/* Status Messages */
.error {
  background: rgba(244, 67, 54, 0.1);
  border-left: 4px solid var(--error-color);
  color: var(--error-color);
  padding: 1rem;
  border-radius: 4px;
  margin: 1rem 0;
  font-weight: 500;
}

.success {
  background: rgba(76, 175, 80, 0.1);
  border-left: 4px solid var(--success-color);
  color: var(--success-color);
  padding: 1rem;
  border-radius: 4px;
  margin: 1rem 0;
  font-weight: 500;
}

.warning {
  background: rgba(255, 152, 0, 0.1);
  border-left: 4px solid var(--warning-color);
  color: var(--warning-color);
  padding: 1rem;
  border-radius: 4px;
  margin: 1rem 0;
  font-weight: 500;
}

.loading {
  text-align: center;
  padding: 2rem;
  color: var(--text-light);
  font-style: italic;
}

/* Footer */
footer {
  background: rgba(0, 0, 0, 0.7);
  color: #ccc;
  text-align: center;
  padding: 2rem;
  margin-top: 3rem;
  border-top: 2px solid var(--primary-color);
}

footer p {
  margin: 0.5rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.8rem;
  }

  main {
    padding: 0 0.5rem;
  }

  .card {
    padding: 1rem;
  }

  .split-view {
    grid-template-columns: 1fr;
  }

  .tokens-container {
    grid-template-columns: 1fr;
  }

  .button-group {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}

/* Print Styles */
@media print {
  header,
  footer,
  .button-group {
    display: none;
  }

  .card,
  .decode-result {
    box-shadow: none;
    border: 1px solid var(--border-color);
  }
}
