/* ================================================================
   GrowMath Vedic Worksheets — Frontend Styles
   ================================================================ */

.growmath-wrap *,
.growmath-wrap *::before,
.growmath-wrap *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.growmath-wrap {
  font-family: 'Segoe UI', Arial, sans-serif;
  max-width: 780px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
  color: #1a1a1a;
}

/* ── Header ── */
.gm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #1a3a2a;
  border-radius: 14px;
  padding: 1rem 1.4rem;
  margin-bottom: 1.2rem;
}

.gm-header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gm-logo-box {
  width: 42px;
  height: 42px;
  background: #2e7d4f;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
}

.gm-brand-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
}

.gm-brand-sub {
  font-size: 0.72rem;
  color: #a0d4b4;
  font-weight: 400;
  margin-top: 1px;
}

.gm-header-tag {
  font-size: 0.75rem;
  background: rgba(46,125,79,0.35);
  color: #b8e8cc;
  padding: 5px 12px;
  border-radius: 20px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* ── Cards ── */
.gm-card {
  background: #fff;
  border: 1px solid #e0ddd5;
  border-radius: 14px;
  padding: 1.3rem 1.4rem;
  margin-bottom: 1rem;
}

.gm-card-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #2e7d4f;
  margin-bottom: 0.9rem;
}

/* ── Grid rows ── */
.gm-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.gm-row-2:last-child {
  margin-bottom: 0;
}

/* ── Fields ── */
.gm-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #444;
  margin-bottom: 0.38rem;
}

.gm-field select,
.gm-field input[type="text"],
.gm-field input[type="date"] {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid #d4d0c8;
  border-radius: 8px;
  font-size: 0.88rem;
  color: #1a1a1a;
  background: #fafaf8;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.gm-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%232e7d4f' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.gm-field select:focus,
.gm-field input:focus {
  border-color: #2e7d4f;
  box-shadow: 0 0 0 3px rgba(46,125,79,0.12);
  background: #fff;
}

/* ── Generate button ── */
#gm-generate-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 0.95rem;
  background: #1a3a2a;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.3px;
  transition: background 0.2s;
  margin-bottom: 0.5rem;
}

#gm-generate-btn:hover {
  background: #2e7d4f;
}

#gm-generate-btn:disabled {
  background: #bbb;
  cursor: not-allowed;
}

/* ── Error ── */
.gm-error {
  min-height: 20px;
  font-size: 0.82rem;
  color: #c0392b;
  text-align: center;
}

/* ── Preview area ── */
.gm-preview-area {
  margin-top: 1rem;
}

/* ── Problems grid ── */
.gm-problems-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
}

.gm-prob-box {
  border: 1px solid #e0ddd5;
  border-radius: 10px;
  padding: 0.7rem 0.85rem 0.6rem;
  background: #faf9f7;
  min-height: 90px;
  display: flex;
  flex-direction: column;
}

.gm-prob-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
}

.gm-prob-num {
  background: #2e7d4f;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gm-prob-topic {
  font-size: 0.62rem;
  color: #aaa;
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gm-prob-q {
  font-size: 1rem;
  font-weight: 700;
  color: #1a3a2a;
  text-align: center;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.4;
  padding: 2px 0;
}

.gm-prob-line {
  border: none;
  border-top: 1.5px solid #1a3a2a;
  margin: 6px 10px 0;
}

/* ── PDF button ── */
.gm-btn-pdf {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 0.85rem;
  background: #2e7d4f;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s;
}

.gm-btn-pdf:hover {
  background: #1a3a2a;
}

/* ── Responsive ── */
@media (max-width: 560px) {
  .gm-row-2,
  .gm-problems-grid {
    grid-template-columns: 1fr;
  }
  .gm-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .gm-header-tag {
    align-self: flex-end;
  }
}
