/* Common Prompt Engineering Styles */

.version-selector {
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.version-selector:focus {
    outline: none;
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(185, 240, 64, 0.1);
}

/* View Toggle */
.view-toggle {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface);
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--muted);
    transition: background 0.2s, color 0.2s;
}

.view-toggle-btn:hover {
    background: var(--bg);
    color: var(--text);
}

.view-toggle-btn.active {
    background: var(--brand-color);
    color: #000;
}

.view-toggle-btn + .view-toggle-btn {
    border-left: 1px solid var(--border);
}

/* Search Box */
.prompt-search-box {
    position: relative;
    min-width: 140px;
    width: 220px;
    flex-shrink: 1;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 36px 8px 12px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.prompt-search-box:focus-within {
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(185, 240, 64, 0.1);
}

#promptSearchInput {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    width: 100%;
    padding: 0;
    color: var(--text);
}

#promptSearchInput::placeholder {
    color: rgba(55, 53, 47, 0.4);
}

.prompt-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: none;
    color: #666;
    font-size: 20px;
    line-height: 1;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
    transition: all 0.2s;
}

.prompt-search-clear:hover {
    background: #f5f5f5;
    color: #333;
}

/* Prompts Table Container */
.prompts-table-container {
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow-x: auto;
}

/* Prompts Table */
.prompts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.prompts-table-th {
    text-align: left;
    padding: 10px 12px;
    background: var(--bg);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.prompts-table-th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s, color 0.2s;
}

.prompts-table-th.sortable:hover {
    background: #e9ecef;
    color: var(--text);
}

.prompts-table-th.sortable.active {
    color: var(--text);
    background: #e2e8f0;
}

.prompts-table-th .sort-indicator {
    display: inline-block;
    width: 16px;
    text-align: center;
    margin-left: 4px;
    font-size: 10px;
}

.prompts-table-row {
    transition: background 0.15s;
    min-height: 52px;
}

.prompts-table-row:hover {
    background: var(--bg);
}

.prompts-table-row:not(:last-child) .prompts-table-td {
    border-bottom: 1px solid var(--border);
}

.prompts-table-td {
    padding: 12px 10px;
    vertical-align: middle;
}

.prompts-table-name {
    font-weight: 500;
    color: var(--text);
}

.prompt-name-text {
    display: inline-block;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.prompts-table-version {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
}

.prompts-table-purpose,
.prompts-table-model {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 12px;
}

.prompts-table-date {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.prompts-table-actions {
    text-align: right;
    white-space: nowrap;
    padding-right: 16px;
}

/* Client column */
.prompts-table-client {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-display-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.03em;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Compact badges for table view */
.status-badge-compact,
.type-badge-compact {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Small button variant */
.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Version History Modal */
.version-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
}

.version-history-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.version-history-item:hover {
    border-color: var(--brand-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.version-history-item.current {
    border-color: var(--brand-color);
    background: rgba(185, 240, 64, 0.05);
}

.version-history-meta {
    flex: 1;
    min-width: 0;
}

.version-history-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.version-history-version {
    font-weight: 600;
    font-size: 16px;
    color: var(--text);
}

.version-history-status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.version-history-status.live {
    background: #f0fff4;
    border: 1px solid #c6f6d5;
    color: #22543d;
}

.version-history-status.test {
    background: #fffbf0;
    border: 1px solid #fbd38d;
    color: #744210;
}

.version-history-status.archived {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    color: #4a5568;
}

.version-history-current-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: var(--brand-color);
    color: #000;
}

.version-history-dates {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
}

.version-history-preview {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    background: var(--surface);
    padding: 8px;
    border-radius: 4px;
    max-height: 60px;
    overflow: hidden;
    white-space: pre-wrap;
    word-break: break-word;
}

.version-history-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.version-history-empty {
    text-align: center;
    padding: 32px;
    color: var(--muted);
}

.version-history-loading {
    text-align: center;
    padding: 32px;
    color: var(--muted);
}
