/* Layout */
.tnp-wrap {
  display: grid;
  gap: 16px;
  max-width: 880px;
  margin: 0 auto;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

/* Form */
.tnp-form {
  display: grid;
  gap: 10px;
}

.tnp-label {
  font-weight: 600;
}

.tnp-textarea {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  font: inherit;
  line-height: 1.4;
  resize: vertical;
}

.tnp-actions {
  display: flex;
  flex-wrap: wrap; /* Added for mobile */
  align-items: center;
  gap: 12px;
}

.tnp-select {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background-color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.tnp-btn,
.tnp-copy-button {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  background: #111827;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: transform .02s ease-in-out, opacity .15s ease-in-out, box-shadow .15s;
  box-shadow: 0 2px 0 rgba(0,0,0,.12);
}

.tnp-btn:disabled,
.tnp-copy-button:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.tnp-btn:active,
.tnp-copy-button:active {
  transform: translateY(1px);
}

.tnp-status {
  font-size: 0.95rem;
  color: #374151;
}

/*
 * =========================================================================
 * ENHANCED OUTPUT STYLES (Appended)
 * =========================================================================
 */

.tnp-wrap .tnp-output-container {
    margin-top: 20px;
    border: 2px solid #0073aa;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 880px;
}

/* This is the aria-busy state from the original theranotes.css */
.tnp-wrap .tnp-output-container[aria-busy="true"] {
  outline: 2px dashed #cbd5e1;
  outline-offset: -2px;
  min-height: 100px;
}

.tnp-wrap .tnp-output-header {
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.tnp-wrap .tnp-output-header h3 {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.tnp-wrap .tnp-copy-button {
    background: #fff !important;
    border: none !important;
    color: #0073aa !important;
    padding: 8px 16px !important;
    cursor: pointer;
    border-radius: 4px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tnp-wrap .tnp-copy-button:hover {
    background: #f0f0f0 !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.tnp-wrap .tnp-copy-button.copied {
    background: #46b450 !important;
    color: #fff !important;
}

.tnp-wrap .tnp-copy-button .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 1;
}

.tnp-wrap .tnp-structured-note {
    padding: 20px;
    background: #fafafa;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #23282d;
    max-height: 600px;
    overflow-y: auto;
    border-top: 1px solid #ddd;
}

.tnp-wrap .tnp-structured-note::-webkit-scrollbar {
    width: 8px;
}

.tnp-wrap .tnp-structured-note::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.tnp-wrap .tnp-structured-note::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.tnp-wrap .tnp-structured-note::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .tnp-wrap .tnp-output-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .tnp-wrap .tnp-copy-button {
        width: 100%;
        justify-content: center;
    }
    
    .tnp-wrap .tnp-structured-note {
        font-size: 16px; /* Larger for mobile readability */
    }
}
