/* Coal Creek Guitars Color Scheme
   Primary Background: #000000 (true black - matches logo)
   Primary Text/Accent: #d4c5a9 (cream/tan)
   Secondary Accent: #c9a227 (gold/amber)
*/

:root {
  --bg-dark: #000000;
  --bg-dark-alt: #111111;
  --bg-card: rgba(212, 197, 169, 0.05);
  --text-cream: #d4c5a9;
  --text-light: #e8e0d0;
  --text-muted: #9a9080;
  --accent-gold: #c9a227;
  --accent-gold-light: #dbb94a;
  --accent-gold-dark: #a88820;
  --border-subtle: rgba(212, 197, 169, 0.15);
  --border-accent: rgba(201, 162, 39, 0.4);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg-dark);
  min-height: 100vh;
  color: var(--text-light);
  padding: 20px;
}

/* ============================================
   SITE NAVIGATION
   ============================================ */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 600px;
  margin: 0 auto 20px;
  padding: 0 10px;
}

.nav-logo img {
  height: 40px;
  width: auto;
}

.nav-home {
  color: var(--text-cream);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-home:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

/* ============================================
   HOMEPAGE STYLES
   ============================================ */
.home-page {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
}

.home-container {
  max-width: 800px;
  width: 100%;
  text-align: center;
}

.home-header {
  margin-bottom: 20px;
}

.home-logo {
  max-width: 100%;
  width: 600px;
  height: auto;
}

.home-section-title {
  color: var(--text-cream);
  font-size: 1.5rem;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 60px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 24px;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: 16px;
  text-decoration: none;
  transition: all 0.3s;
}

.tool-card:hover {
  border-color: var(--accent-gold);
  background: rgba(201, 162, 39, 0.08);
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.tool-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
  border-radius: 16px;
  margin-bottom: 20px;
}

.tool-icon svg {
  width: 32px;
  height: 32px;
  color: var(--bg-dark);
}

.tool-image {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.tool-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.tool-title {
  color: var(--text-cream);
  font-size: 1.25rem;
  margin-bottom: 12px;
}

.tool-description {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 20px;
}

.tool-link {
  color: var(--accent-gold);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tool-card:hover .tool-link {
  color: var(--accent-gold-light);
}

.home-footer {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding-top: 40px;
  border-top: 1px solid var(--border-subtle);
}

/* ============================================
   SERIAL DECODER PAGE STYLES
   ============================================ */
.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 40px 30px;
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
}

h1 {
  text-align: center;
  color: var(--text-cream);
  margin-bottom: 8px;
  font-size: 2rem;
}

.subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 30px;
  font-size: 0.95rem;
}

.input-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-weight: 500;
  color: var(--text-cream);
}

.optional {
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--text-muted);
}

select, input {
  padding: 12px 16px;
  font-size: 1rem;
  border: 2px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--bg-dark);
  color: var(--text-light);
  transition: border-color 0.2s, box-shadow 0.2s;
}

select:focus, input:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.2);
}

select option {
  background: var(--bg-dark);
  color: var(--text-light);
}

button {
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
  color: var(--bg-dark);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-top: 10px;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(201, 162, 39, 0.4);
}

button:active {
  transform: translateY(0);
}

.result-section {
  margin-top: 30px;
  padding: 24px;
  background: rgba(201, 162, 39, 0.08);
  border-radius: 12px;
  border: 1px solid var(--border-accent);
}

.result-section h2 {
  color: var(--accent-gold);
  margin-bottom: 16px;
  font-size: 1.3rem;
}

.result-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.result-item:last-child {
  border-bottom: none;
}

.result-label {
  color: var(--text-muted);
  font-weight: 500;
}

.result-value {
  color: var(--text-light);
  font-weight: 600;
  text-align: right;
}

.error-section {
  margin-top: 20px;
  padding: 16px 20px;
  background: rgba(255, 82, 82, 0.15);
  border: 1px solid rgba(255, 82, 82, 0.4);
  border-radius: 8px;
  color: #ff6b6b;
}

.hidden {
  display: none !important;
}

.notes {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(212, 197, 169, 0.05);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.notes strong {
  color: var(--accent-gold);
}

/* Value Button */
.value-button-container {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.value-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 24px;
  background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
  color: white;
  font-size: 1.1rem;
  margin-top: 0;
}

.value-button:hover {
  box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
}

.value-button-icon {
  font-size: 1.4rem;
  font-weight: bold;
}

/* Modal Styles */
.valuation-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.valuation-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.valuation-modal-content {
  position: relative;
  background: var(--bg-dark);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--border-accent);
}

.valuation-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 4px 10px;
  margin: 0;
  line-height: 1;
  transition: color 0.2s;
}

.valuation-modal-close:hover {
  color: var(--text-light);
  transform: none;
  box-shadow: none;
}

.valuation-modal-header {
  padding: 24px 24px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.valuation-modal-header h2 {
  color: var(--accent-gold);
  margin: 0;
  font-size: 1.5rem;
}

.valuation-subtitle {
  color: var(--text-muted);
  margin: 4px 0 0;
  font-size: 0.95rem;
}

.valuation-modal-body {
  padding: 24px;
}

/* Wizard Steps */
.wizard-step h3 {
  color: var(--text-light);
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.wizard-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

/* Model Grid */
.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.model-card {
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.model-card:hover {
  border-color: var(--accent-gold);
  background: rgba(201, 162, 39, 0.1);
  transform: translateY(-2px);
}

.model-card-image {
  position: relative;
  margin-bottom: 8px;
}

.model-card-image img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--bg-dark);
}

.model-placeholder {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark-alt);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.model-placeholder-icon {
  font-size: 2rem;
}

.model-card-name {
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.9rem;
}

.model-card-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Wizard Footer */
.wizard-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.wizard-btn {
  padding: 10px 20px;
  font-size: 0.95rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  margin: 0;
}

.wizard-btn-primary {
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
  color: var(--bg-dark);
  border: none;
}

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

.wizard-btn-secondary:hover {
  background: rgba(201, 162, 39, 0.1);
  transform: none;
  box-shadow: none;
}

/* Identify Tips */
.identify-tips {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}

.identify-tips li {
  padding: 8px 0;
  color: var(--text-cream);
  border-bottom: 1px solid var(--border-subtle);
}

.identify-tips li strong {
  color: var(--accent-gold);
}

.identify-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* Results Step */
.results-step {
  max-width: 100%;
}

.results-header {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
  align-items: flex-start;
}

.results-image {
  flex-shrink: 0;
}

.results-image img {
  width: 180px;
  height: 130px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--bg-dark);
}

.results-placeholder {
  width: 180px;
  height: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-dark-alt);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.results-placeholder-icon {
  font-size: 3rem;
}

.results-placeholder-text {
  font-size: 0.8rem;
  color: var(--accent-gold);
  text-align: center;
  padding: 0 8px;
}

.results-title h3 {
  margin-bottom: 8px;
  font-size: 1.3rem;
}

.results-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Search Links Section */
.search-links-section {
  margin-bottom: 24px;
}

.search-links-section h4 {
  color: var(--accent-gold);
  margin-bottom: 12px;
  font-size: 1rem;
}

.search-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.search-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.search-link:hover {
  border-color: var(--accent-gold);
  background: rgba(201, 162, 39, 0.1);
}

.search-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-weight: bold;
  font-size: 0.9rem;
}

.search-link.google .search-icon {
  background: #4285F4;
}

.search-link.reverb .search-icon {
  background: #F43B47;
}

.search-link.reverb-guide .search-icon {
  background: #4CAF50;
}

.search-link.ebay .search-icon {
  background: #E53238;
}

/* Factors Section */
.factors-section {
  margin-bottom: 20px;
}

.factors-section h4 {
  color: var(--accent-gold);
  margin-bottom: 8px;
  font-size: 1rem;
}

.factors-intro {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.factors-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.factor-card {
  background: rgba(212, 197, 169, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 12px 16px;
}

.factor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.factor-name {
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.95rem;
}

.factor-impact {
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.factor-impact-high {
  background: rgba(244, 67, 54, 0.2);
  color: #ef5350;
}

.factor-impact-medium {
  background: rgba(255, 152, 0, 0.2);
  color: #ffb74d;
}

.factor-impact-variable {
  background: rgba(33, 150, 243, 0.2);
  color: #64b5f6;
}

.factor-details {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */
@media (max-width: 600px) {
  .home-logo {
    width: 100%;
    max-width: 400px;
  }

  .home-header {
    margin-bottom: 16px;
  }

  .site-nav {
    padding: 0;
  }

  .nav-logo img {
    height: 32px;
  }

  .results-header {
    flex-direction: column;
  }

  .results-image img {
    width: 100%;
    max-width: 200px;
  }

  .model-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .search-links {
    grid-template-columns: 1fr;
  }

  .wizard-footer {
    flex-direction: column;
  }

  .wizard-btn {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  body {
    padding: 12px;
  }

  .container {
    padding: 24px 20px;
  }

  h1 {
    font-size: 1.6rem;
  }

  .valuation-modal-content {
    max-height: 95vh;
    border-radius: 12px;
  }

  .valuation-modal {
    padding: 10px;
  }

  .tool-card {
    padding: 24px 16px;
  }
}

/* ============================================
   LISTINGS PAGE STYLES
   ============================================ */
.listings-container {
  max-width: 900px;
}

.listings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 30px;
}

.listing-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 2px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  transition: all 0.3s;
}

.listing-card:hover {
  border-color: var(--accent-gold);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.listing-image {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-dark-alt);
}

.listing-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.listing-card:hover .listing-image img {
  transform: scale(1.05);
}

.listing-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.listing-info {
  padding: 16px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.listing-title {
  color: var(--text-cream);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.listing-price {
  color: var(--accent-gold);
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: auto;
}

/* Loading state */
.listings-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

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

/* Error state */
.listings-error {
  padding: 24px;
  background: rgba(255, 82, 82, 0.15);
  border: 1px solid rgba(255, 82, 82, 0.4);
  border-radius: 8px;
  color: #ff6b6b;
  text-align: center;
  margin-top: 30px;
}

/* Empty state */
.listings-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}

/* Responsive listings grid */
@media (max-width: 768px) {
  .listings-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .listings-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .listings-container {
    padding: 24px 16px;
  }
}

/* ============================================
   ABOUT PAGE STYLES
   ============================================ */
.about-container {
  max-width: 800px;
}

.about-section {
  margin-bottom: 40px;
}

.about-section h2 {
  color: var(--accent-gold);
  font-size: 1.4rem;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.about-section p {
  color: var(--text-cream);
  line-height: 1.8;
  margin-bottom: 16px;
}

.about-section p:last-child {
  margin-bottom: 0;
}

.contact-section {
  background: var(--bg-card);
  padding: 30px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  text-align: center;
}

.contact-section h2 {
  border-bottom: none;
  padding-bottom: 0;
}

.contact-email {
  margin-top: 20px;
}

.contact-email a {
  color: var(--accent-gold);
  font-size: 1.2rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s;
}

.contact-email a:hover {
  color: var(--text-cream);
}

/* ============================================
   SITE-WIDE FOOTER STYLES
   ============================================ */
.site-footer {
  margin-top: 60px;
  padding: 30px 20px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.footer-content {
  max-width: 800px;
  margin: 0 auto;
}

.footer-contact {
  color: var(--text-muted);
  margin-bottom: 8px;
}

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

.footer-contact a:hover {
  color: var(--text-cream);
}

.footer-copyright {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.home-footer .footer-contact {
  margin-bottom: 8px;
}

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

.home-footer .footer-contact a:hover {
  color: var(--text-cream);
}
