:root {
  --primary-color: #4f46e5;
  --accent-color: #ff9f2f;
  --bg-light: #f9fafb;
  --border-color: #e5e7eb;
  --text-dark: #111827;
  --text-muted: #6b7280;
}

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

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

.generator-container {
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  max-width: 800px;
  margin: 0 auto 30px;
}

.generator-container h1 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  font-size: 2rem;
  text-align: center;
}

.generator-container label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
  font-size: 0.95rem;
}

.generator-container input,
.generator-container textarea {
  width: 100%;
  margin-bottom: 1.25rem;
  padding: 12px;
  border-radius: 8px;
  border: 2px solid var(--border-color);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s;
}

.generator-container input:focus,
.generator-container textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

button {
  padding: 12px 28px;
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  transition: transform 0.2s, box-shadow 0.2s;
  display: block;
  margin: 0 auto;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 159, 47, 0.3);
}

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

.btn-secondary {
  background: var(--primary-color);
  margin-top: 1.5rem;
}

.btn-secondary:hover {
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Worksheet Output Styles */
.worksheet {
  width: 8.5in;
  min-height: 11in;
  margin: 30px auto;
  background: white;
  padding: 0.75in;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  position: relative;
  page-break-after: always;
}

/* Logo Watermark */
.worksheet::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 400px;
  height: 400px;
  background-image: url('../../images/logo.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

.worksheet > * {
  position: relative;
  z-index: 1;
}

.header-bar {
  background: linear-gradient(135deg, #ffe1ad 0%, #ffd89b 100%);
  padding: 10px 20px;
  font-size: 0.9rem;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: 500;
  color: #8b5a00;
  border-left: 4px solid var(--accent-color);
}

.worksheet-title {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--primary-color);
  border-bottom: 3px solid var(--accent-color);
  padding-bottom: 10px;
}

.worksheet img {
  width: 280px;
  max-width: 35%;
  float: right;
  margin: 0 0 15px 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.worksheet p {
  margin-bottom: 1rem;
  text-align: justify;
  line-height: 1.8;
}

.section {
  margin-top: 25px;
  background: linear-gradient(135deg, #fff7e8 0%, #fef3e2 100%);
  padding: 20px;
  border-radius: 12px;
  border-left: 4px solid var(--accent-color);
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--primary-color);
}

.worksheet-footer {
  margin-top: 30px;
  padding-top: 15px;
  border-top: 2px solid var(--border-color);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Print Styles */
@media print {
  body {
    background: white;
    padding: 0;
  }

  .generator-container {
    display: none;
  }

  hr {
    display: none;
  }

  .worksheet {
    width: 100%;
    margin: 0;
    padding: 0.75in;
    box-shadow: none;
    page-break-after: avoid;
  }

  .worksheet img {
    max-width: 30%;
    float: right;
    margin: 0 0 10px 15px;
    page-break-inside: avoid;
  }

  .header-bar,
  .worksheet-title {
    page-break-after: avoid;
  }

  .section {
    page-break-inside: auto;
    clear: none;
  }

  .section-title {
    page-break-after: avoid;
  }

  .worksheet-footer {
    page-break-before: avoid;
  }

  button {
    display: none;
  }

  /* Allow T/F items to break if needed */
  div[style*="page-break-inside: avoid"] {
    page-break-inside: auto !important;
  }
}

@page {
  size: letter;
  margin: 0;
}
