/* 3D Print Calcs - Main Stylesheet */
/* 3dprintcalcs.com */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #10b981;
  --accent: #f59e0b;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --error: #ef4444;
  --success: #22c55e;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

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

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

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.logo span {
  color: var(--text);
}

nav ul {
  display: flex;
  list-style: none;
  gap: 24px;
}

nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

nav a:hover {
  color: var(--primary);
}

/* Hero Section */
.hero {
  padding: 60px 0;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 16px;
  color: var(--text);
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* Calculator Cards Grid */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding: 40px 0;
}

.calc-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}

.calc-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.calc-card h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: var(--primary);
}

.calc-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.calc-card .icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

/* Calculator Page Styles */
.calc-page {
  padding: 40px 0 60px;
}

.calc-page h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.calc-page .subtitle {
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* Calculator Container */
.calculator {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

/* Form Elements */
.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text);
}

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

input[type="number"],
input[type="text"],
select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input::placeholder {
  color: var(--text-muted);
}

.input-group {
  display: flex;
  align-items: stretch;
}

.input-group input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-group .unit {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 16px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

/* Preset Buttons */
.presets {
  margin-bottom: 24px;
}

.presets-label {
  font-weight: 500;
  margin-bottom: 10px;
  color: var(--text);
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.preset-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
}

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

.btn-secondary:hover {
  background: var(--border);
}

.btn-block {
  width: 100%;
}

/* Results Section */
.results {
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: none;
}

.results.show {
  display: block;
}

.results-header {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--text);
}

.result-main {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 24px;
  border-radius: var(--radius);
  text-align: center;
  margin-bottom: 20px;
}

.result-main .label {
  font-size: 0.875rem;
  opacity: 0.9;
  margin-bottom: 4px;
}

.result-main .value {
  font-size: 2.5rem;
  font-weight: 700;
}

.result-breakdown {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 20px;
}

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

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

.result-row .label {
  color: var(--text-muted);
}

.result-row .value {
  font-weight: 600;
}

/* Affiliate Box */
.affiliate-box {
  margin-top: 24px;
  padding: 20px;
  background: #fefce8;
  border: 1px solid #fef08a;
  border-radius: var(--radius);
}

.affiliate-box h4 {
  font-size: 1rem;
  margin-bottom: 12px;
  color: var(--text);
}

.affiliate-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.affiliate-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: white;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.2s;
}

.affiliate-link:hover {
  box-shadow: var(--shadow);
}

.affiliate-link .name {
  font-weight: 500;
}

.affiliate-link .price {
  color: var(--secondary);
  font-weight: 600;
}

/* Content Sections */
.content-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.content-section h2 {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.content-section p {
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* FAQ Section */
.faq {
  margin-top: 48px;
}

.faq h2 {
  font-size: 1.5rem;
  margin-bottom: 24px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-question {
  padding: 16px 20px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-question::after {
  content: '+';
  font-size: 1.5rem;
  color: var(--text-muted);
}

.faq-item.open .faq-question::after {
  content: '−';
}

.faq-answer {
  padding: 0 20px 16px;
  color: var(--text-muted);
  display: none;
}

.faq-item.open .faq-answer {
  display: block;
}

/* Footer */
footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 40px 0;
  margin-top: 60px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--primary);
}

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

/* Affiliate Disclosure */
.disclosure {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 16px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius);
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 16px;
  }

  nav ul {
    gap: 16px;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .calculator {
    padding: 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .result-main .value {
    font-size: 2rem;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
