/* YouthPlug Tools Engine – Frontend Styles
   Lightweight, mobile-first, SaaS look */

:root {
  --ypt-primary: #2563eb;
  --ypt-primary-hover: #1d4ed8;
  --ypt-success: #16a34a;
  --ypt-danger: #dc2626;
  --ypt-bg: #f8fafc;
  --ypt-card: #ffffff;
  --ypt-border: #e2e8f0;
  --ypt-text: #0f172a;
  --ypt-muted: #64748b;
  --ypt-radius: 12px;
  --ypt-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
}

.ypt-tool-wrapper {
  max-width: 720px;
  margin: 0 auto 2rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ypt-text);
}

.ypt-tool-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.ypt-tool-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
}

.ypt-tool-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  line-height: 1.25;
}

.ypt-tool-desc {
  color: var(--ypt-muted);
  margin: 0;
  font-size: 1rem;
}

/* Form elements */
.ypt-tool-form {
  background: var(--ypt-card);
  border: 1px solid var(--ypt-border);
  border-radius: var(--ypt-radius);
  padding: 1.5rem;
  box-shadow: var(--ypt-shadow);
}

.ypt-field {
  margin-bottom: 1rem;
}

.ypt-field label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 0.35rem;
}

.ypt-field input[type="text"],
.ypt-field input[type="number"],
.ypt-field input[type="date"],
.ypt-field input[type="email"],
.ypt-field select,
.ypt-field textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--ypt-border);
  border-radius: 8px;
  font-size: 1rem;
  background: #fff;
  transition: border-color 0.15s;
}

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

.ypt-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 600px) {
  .ypt-field-row {
    grid-template-columns: 1fr;
  }
}

.ypt-radio-group label,
.ypt-checkboxes label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 400;
  margin-bottom: 0.4rem;
  cursor: pointer;
}

/* Buttons */
.ypt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
}

.ypt-btn:active {
  transform: scale(0.98);
}

.ypt-btn-primary {
  background: var(--ypt-primary);
  color: #fff;
  width: 100%;
  margin-top: 0.5rem;
}

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

.ypt-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ypt-btn-secondary {
  background: #f1f5f9;
  color: var(--ypt-text);
  margin-top: 0.5rem;
}

.ypt-btn-secondary:hover {
  background: #e2e8f0;
}

/* Results */
.ypt-result {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--ypt-bg);
  border-radius: 8px;
  border: 1px solid var(--ypt-border);
}

.ypt-result h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
}

.ypt-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.ypt-result-grid .label {
  display: block;
  font-size: 0.75rem;
  color: var(--ypt-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ypt-result-grid .value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  margin-top: 0.2rem;
}

.ypt-note {
  font-size: 0.8rem;
  color: var(--ypt-muted);
  margin-top: 1rem;
}

/* Tool grid (homepage / categories) */
.ypt-tool-grid {
  display: grid;
  gap: 1.25rem;
}

.ypt-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ypt-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ypt-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .ypt-cols-3, .ypt-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
  .ypt-cols-2, .ypt-cols-3, .ypt-cols-4 { grid-template-columns: 1fr; }
}

.ypt-tool-card {
  display: block;
  background: var(--ypt-card);
  border: 1px solid var(--ypt-border);
  border-radius: var(--ypt-radius);
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
  box-shadow: var(--ypt-shadow);
}

.ypt-tool-card:hover {
  border-color: var(--ypt-primary);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.08);
  transform: translateY(-2px);
}

.ypt-card-icon {
  font-size: 1.75rem;
  display: block;
  margin-bottom: 0.5rem;
}

.ypt-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.ypt-card-desc {
  font-size: 0.875rem;
  color: var(--ypt-muted);
  margin: 0 0 0.75rem;
  line-height: 1.4;
}

.ypt-card-cat {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ypt-primary);
  font-weight: 600;
}

/* Related tools */
.ypt-related-tools {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ypt-border);
}

.ypt-related-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ypt-related-list a {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  background: #f1f5f9;
  border-radius: 999px;
  font-size: 0.85rem;
  color: var(--ypt-text);
  text-decoration: none;
}

.ypt-related-list a:hover {
  background: #e2e8f0;
}

/* Ad slots */
.ypt-ad-slot {
  margin: 1.5rem 0;
  text-align: center;
  min-height: 50px;
}

.ypt-pro-upsell {
  margin-top: 2rem;
  padding: 1rem;
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  border-radius: 8px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--ypt-muted);
}

/* File upload zone */
.ypt-upload-zone {
  border: 2px dashed var(--ypt-border);
  border-radius: var(--ypt-radius);
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 1rem;
  position: relative;
}

.ypt-upload-zone:hover,
.ypt-upload-zone.dragover {
  border-color: var(--ypt-primary);
  background: #eff6ff;
}

.ypt-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.ypt-progress {
  margin-top: 1rem;
}

.ypt-progress-bar {
  height: 6px;
  background: var(--ypt-primary);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s;
  animation: ypt-pulse 1.5s infinite;
}

@keyframes ypt-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Invoice / Quote preview */
.ypt-invoice-preview {
  background: #fff;
  padding: 1.5rem;
  border: 1px solid var(--ypt-border);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.inv-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.inv-table th,
.inv-table td {
  border: 1px solid var(--ypt-border);
  padding: 0.5rem;
  text-align: left;
  font-size: 0.9rem;
}

.inv-table th {
  background: #f8fafc;
}

.ypt-invoice-item,
.ypt-expense-row {
  display: grid;
  grid-template-columns: 2fr 0.7fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.ypt-expense-row {
  grid-template-columns: 2fr 1fr;
}

.ypt-password-output {
  font-family: ui-monospace, monospace;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}

.ypt-list-results {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ypt-list-results li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--ypt-border);
  gap: 0.75rem;
}

.ypt-copy-btn {
  flex-shrink: 0;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  background: #f1f5f9;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

/* Print styles for invoices */
@media print {
  body * { visibility: hidden; }
  .ypt-invoice-preview, .ypt-invoice-preview * { visibility: visible; }
  .ypt-invoice-preview { position: absolute; left: 0; top: 0; width: 100%; }
  .ypt-btn { display: none !important; }
}

.ypt-section-label { font-size:1rem; font-weight:700; margin:1.5rem 0 .75rem; padding-bottom:.35rem; border-bottom:2px solid #e2e8f0; color:#0f172a; }
.ypt-section-label:first-child { margin-top:0; }
.ypt-checkboxes { display:flex; flex-wrap:wrap; gap:.5rem 1rem; }

