/* TAP Editor — minimal style matching liza.st */

:root {
  --bg: #fff;
  --text: #1a1a1a;
  --link: #0066cc;
  --link-hover: #004499;
  --muted: #666;
  --border: #ddd;
  --input-bg: #fafafa;
  --success: #059669;
  --error: #dc2626;
  --accent: #7c3aed;
  --mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Monaco', 'Consolas', monospace;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  padding: 2rem 1rem;
}

main {
  max-width: 600px;
  margin: 0 auto;
}

h1 {
  font-size: 1.5rem;
  font-weight: normal;
  margin: 0 0 0.25rem;
}

h2 {
  font-size: 1rem;
  font-weight: normal;
  color: var(--muted);
  margin: 2rem 0 0.75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25rem;
}

.tagline {
  color: var(--muted);
  margin: 0 0 2rem;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* Feature list */
.feature-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.feature-list li {
  margin: 0.5rem 0;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

label .hint {
  color: var(--muted);
  font-size: 0.8rem;
}

label .required {
  color: var(--error);
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="date"],
input[type="number"],
textarea,
select {
  font-family: var(--mono);
  font-size: 14px;
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--input-bg);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.1);
}

textarea {
  min-height: 80px;
  resize: vertical;
}

/* Checkbox groups */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.checkbox-group label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

.checkbox-group label:hover {
  border-color: var(--accent);
}

.checkbox-group input[type="checkbox"] {
  width: auto;
  margin: 0;
}

/* Radio groups */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
}

.radio-group label:hover {
  border-color: var(--accent);
}

.radio-group input[type="radio"] {
  width: auto;
  margin: 0;
}

/* Dynamic list fields */
.list-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.list-item {
  display: flex;
  gap: 0.5rem;
}

.list-item input {
  flex: 1;
}

.list-item button {
  padding: 0.5rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
}

.list-item button:hover {
  background: var(--input-bg);
}

.add-item-btn {
  align-self: flex-start;
  padding: 0.25rem 0.5rem;
  background: none;
  border: 1px dashed var(--border);
  border-radius: 4px;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
}

.add-item-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Buttons */
.btn {
  font-family: var(--mono);
  font-size: 14px;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn.primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.btn.primary:hover {
  background: #333;
}

.btn.secondary {
  background: var(--bg);
  color: var(--text);
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Messages */
.message {
  padding: 0.75rem;
  border-radius: 4px;
  margin: 1rem 0;
}

.message.success {
  background: #f0fdf4;
  border: 1px solid var(--success);
  color: var(--success);
}

.message.error {
  background: #fef2f2;
  border: 1px solid var(--error);
  color: var(--error);
}

.message.info {
  background: #f5f3ff;
  border: 1px solid var(--accent);
  color: var(--accent);
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s;
}

.card:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.card-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.card-title {
  font-weight: 500;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Actions */
.actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.actions-right {
  justify-content: flex-end;
}

/* Preview */
.preview-box {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 400px;
  overflow-y: auto;
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.tab {
  padding: 0.5rem 1rem;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Utility */
.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.85rem;
}

/* Header with back link */
.page-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-header h1 {
  margin: 0;
}

.back-link {
  font-size: 0.9rem;
}

/* Collapsible sections */
.collapsible {
  border: 1px solid var(--border);
  border-radius: 4px;
  margin: 1rem 0;
}

.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  cursor: pointer;
  background: var(--input-bg);
}

.collapsible-header:hover {
  background: #f0f0f0;
}

.collapsible-content {
  padding: 0.75rem;
  display: none;
}

.collapsible.open .collapsible-content {
  display: block;
}

.collapsible-icon {
  transition: transform 0.2s;
}

.collapsible.open .collapsible-icon {
  transform: rotate(90deg);
}

/* Footer */
footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
}

footer p {
  margin: 0;
}

/* Responsive */
@media (max-width: 480px) {
  body {
    padding: 1rem;
  }
  
  .card-grid {
    grid-template-columns: 1fr;
  }
  
  .checkbox-group,
  .radio-group {
    flex-direction: column;
  }
}

  background: #333;
  color: #fff;
  border-color: #333;
}

/* Language Selector — links style */
  position: absolute;
  top: 1rem;
  right: 2rem; text-align: right;
  display: flex;
  gap: 0.3rem;
  font-size: 0.85rem;
}
  color: #0066cc;
  text-decoration: none;
  cursor: pointer;
}
  text-decoration: underline;
}
  color: #333;
  font-weight: bold;
  text-decoration: none;
}

/* Override: языки справа внутри колонки */
  position: static !important;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}

/* Header row — title left, languages right */
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
  margin: 0;
}
  position: static;
  display: flex;
  gap: 0;
  font-size: 0.85rem;
}

/* Header: title above, languages below right-aligned */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 1rem;
}
  margin: 0 0 0.3rem 0;
}
  align-self: flex-end;
  margin-top: -1.5rem;
}

/* Languages under title, right-aligned */
  text-align: right;
  margin-bottom: 1rem;
}

/* Language selector - right aligned */
.lang-selector {
  text-align: right !important;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}
.lang-selector a {
  color: #0066cc;
  text-decoration: none;
  cursor: pointer;
}
.lang-selector a:hover {
  text-decoration: underline;
}
.lang-selector a.active {
  color: #333;
  font-weight: bold;
}
