/* Primary button */
.btn-primary {
    background: #999;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
}

.btn-primary:hover {
    background: #444;
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Small buttons */
.btn-small {
    background: #999;
    color: white;
    border: none;
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-small:hover {
    background: #444;
}

.btn-small.copied {
    background: #333;
}

/* Button row */
.btn-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

/* Tabs */
.tab-bar {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 0;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    color: #777;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.tab-btn:hover {
    color: #333;
}

.tab-btn.active {
    color: #444;
    border-bottom-color: #444;
    font-weight: bold;
}

.tab-panel {
    display: none;
    padding: 16px 0;
}

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

/* Plain text output — readable paragraphs */
.plain-text-output {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 24px 28px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.75;
    color: #333;
    max-height: 500px;
    overflow-y: auto;
}

.plain-text-output p {
    margin: 0 0 14px 0;
}

.plain-text-output p:last-child {
    margin-bottom: 0;
}

.plain-text-output ol,
.plain-text-output ul {
    margin: 0 0 14px 0;
    padding-left: 24px;
}

.plain-text-output li {
    margin-bottom: 6px;
}

.plain-text-output ol:last-child,
.plain-text-output ul:last-child {
    margin-bottom: 0;
}

/* Code blocks — dark theme for structured + JSON */
.tab-panel pre {
    background: #1e1e1e;
    color: #d4d4d4;
    border-radius: 6px;
    padding: 16px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 500px;
    overflow-y: auto;
}

/* Loading */
.loading-container {
    text-align: center;
    padding: 40px 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #ddd;
    border-top-color: #999;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: #666;
    font-size: 14px;
}

.loading-status {
    color: #999;
    font-size: 13px;
    margin-top: 8px;
}

/* Output section */
.output-section {
    margin-top: 24px;
}

.output-section h3 {
    margin-bottom: 12px;
    color: #333;
}

/* Optimization notes */
.optimization-notes {
    background: #f5f5f5;
    border-left: 4px solid #999;
    padding: 12px 16px;
    border-radius: 0 4px 4px 0;
    margin-top: 16px;
    font-size: 13px;
    color: #999;
}

.optimization-notes strong {
    display: block;
    margin-bottom: 4px;
}

.token-estimate {
    display: inline-block;
    background: #e3f2fd;
    color: #1565c0;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin-top: 8px;
}

/* JSON syntax highlighting */
.json-key {
    color: #9cdcfe;
}

.json-string {
    color: #ce9178;
}

.json-number {
    color: #b5cea8;
}

.json-keyword {
    color: #569cd6;
}

/* Open in model buttons */
.open-in-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.open-in-section h4 {
    margin: 0 0 12px 0;
    color: #555;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.open-in-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.btn-open-in {
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.btn-open-in:hover {
    background: #444;
    transform: translateY(-1px);
}

.btn-open-in:active {
    transform: translateY(0);
}

.btn-chatgpt,
.btn-claude,
.btn-copilot,
.btn-gemini {
    background: #999;
}

/* Assess Prompts section */
.assess-section {
    background: transparent;
    margin-left: -20px;
    margin-right: -20px;
    padding: 20px;
    border-top: none;
    border-radius: 8px;
}

.assess-hint {
    margin: 0 0 14px 0;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

.assess-hint a {
    color: #555;
    text-decoration: none;
    font-weight: 500;
}

.assess-hint a:hover {
    text-decoration: underline;
}

.btn-assess {
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}

.btn-assess:hover {
    transform: translateY(-1px);
}

.btn-assess:active {
    transform: translateY(0);
}

.btn-assess-prefill {
    background: #999;
}

.btn-assess-prefill:hover {
    background: #777;
}

.btn-assess-run {
    background: #999;
}

.btn-assess-run:hover {
    background: #777;
}

/* Clipboard toast modal */
.clipboard-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.clipboard-modal-content {
    background: #fff;
    border-radius: 10px;
    padding: 28px 32px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    animation: slideUp 0.25s ease;
    position: relative;
}

.clipboard-modal-content .btn-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
}

.clipboard-modal-content p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}

.clipboard-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 16px;
}

.clipboard-modal-actions .btn-primary {
    width: auto;
}

.clipboard-modal-actions .btn-small {
    background: #ddd;
    color: #555;
}

.clipboard-modal-actions .btn-small:hover {
    background: #ccc;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Section divider */
.section-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

/* Slow loading hint */
.slow-hint {
    margin-top: 16px;
    font-size: 13px;
    color: #888;
}

.slow-hint a {
    color: #555;
    text-decoration: underline;
    cursor: pointer;
}

.slow-hint a:hover {
    color: #333;
}

/* Small modal variant */
.modal-small {
    max-width: 480px;
}

/* OS tab switcher */
.os-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #ddd;
    margin: 16px 0 0 0;
}

.os-tab-btn {
    background: none;
    border: none;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 500;
    color: #777;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s, border-color 0.2s;
}

.os-tab-btn:hover {
    color: #333;
}

.os-tab-btn.active {
    color: #444;
    border-bottom-color: #444;
}

.os-panel {
    display: none;
    padding: 12px 0 4px 0;
}

.os-panel.active {
    display: block;
}

/* Terminal command blocks */
.terminal-block {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-family: monospace;
    overflow-x: auto;
    margin: 8px 0;
    user-select: all;
}

/* Ollama settings hint row */
.ollama-hint-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.ollama-hint-row .settings-hint {
    margin: 0;
    flex: 1;
}

/* Share idea row above generate button */
.share-idea-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

/* Share modal options */
.share-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.btn-share-option {
    background: #999;
    color: white;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
}

.btn-share-option:hover {
    background: #444;
}

.share-status {
    margin-top: 12px;
    font-size: 13px;
    color: #333;
    font-weight: bold;
}

/* Share row wrapping */
.btn-row {
    flex-wrap: wrap;
    align-items: center;
}

@media (max-width: 600px) {
    .tab-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .btn-row {
        flex-direction: column;
    }

    .open-in-row {
        flex-direction: column;
    }

    .btn-open-in {
        width: 100%;
        text-align: center;
    }
}
