/* Agent Builder Styles */

/* =====================================================================
   NEW WORKFLOW BUTTON
   ===================================================================== */
.new-workflow-btn {
    padding: 4px 12px;
    font-size: 13px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #9ca3af;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.new-workflow-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f3f4f6;
    border-color: #3b82f6;
}

.new-workflow-btn:active {
    transform: scale(0.95);
}

/* =====================================================================
   SAVE STATUS INDICATOR
   ===================================================================== */
.save-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.save-status:empty {
    display: none;
}

.status-draft {
    color: #9ca3af;
    background: rgba(156, 163, 175, 0.1);
}

.status-saved {
    color: #34d399;
    background: rgba(52, 211, 153, 0.1);
}

.status-saving {
    color: #9ca3af;
    font-style: italic;
}

.status-unsaved {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.15);
}

/* =====================================================================
   SAVE PROMPT MODAL
   ===================================================================== */
#save-prompt-modal.hidden {
    display: none;
}

/* =====================================================================
   WORKFLOW CARD BUTTON STATES (Dashboard)
   ===================================================================== */
.workflow-card button:disabled {
    cursor: not-allowed;
}

.workflow-card button:disabled:hover {
    transform: none;
}

/* =====================================================================
   TWO-BUTTON ARCHITECTURE: Chat vs Build
   Textarea full width, buttons in row below (right-aligned)
   ===================================================================== */

/* Button row - sits below textarea, right-aligned */
.button-row {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Legacy class name support */
.send-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.chat-btn, .build-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    font-size: 14px;
}

.chat-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.build-btn {
    background: #3b82f6;
    color: white;
}

.build-btn:hover {
    background: #2563eb;
}

.build-btn.stop-btn-active {
    background: #dc2626;
    border-color: #dc2626;
}

.build-btn.stop-btn-active:hover {
    background: #b91c1c;
}

.btn-icon {
    font-size: 16px;
}

.btn-text {
    font-size: 14px;
}

/* Keyboard shortcut hints - subtle inline text, no background box */
.kbd-hint {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    margin-left: 6px;
    font-size: 11px;
    font-weight: 400;
    font-family: monospace;
    opacity: 0.4;
    color: inherit;
    box-shadow: none;
    transition: opacity 0.15s ease;
}

/* Increase visibility on button hover */
.chat-btn:hover .kbd-hint,
.build-btn:hover .kbd-hint {
    opacity: 0.6;
}

/* Loading states - legacy class kept for compatibility, actual loading handled by .btn-loading */
.chat-btn.loading, .build-btn.loading {
    pointer-events: none;
}

/* Building indicator - fixed top right notification */
.building-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    display: none;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #3b82f6;
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
}

.building-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =====================================================================
   SEND BUTTON — Unified input (replaces chat-btn/build-btn pair)
   ===================================================================== */
.send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: 1px solid rgba(37, 99, 235, 0.5);
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    font-size: 14px;
    background: #2563eb;
    color: white;
    width: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.send-btn:hover {
    background: #1d4ed8;
    border-color: rgba(29, 78, 216, 0.7);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-btn .btn-icon {
    display: flex;
    align-items: center;
}

.send-btn .btn-icon svg {
    width: 16px;
    height: 16px;
}

.send-btn.loading {
    pointer-events: none;
}

/* =====================================================================
   PLAN CARD — Workflow plan preview before building
   ===================================================================== */
.plan-card {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 12px;
    padding: 16px;
    margin: 4px 0;
}

.plan-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.plan-card-title {
    font-weight: 600;
    color: #e5e7eb;
    font-size: 15px;
}

.plan-complexity {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: auto;
}

.plan-complexity-simple { background: rgba(34, 197, 94, 0.2); color: #86efac; }
.plan-complexity-moderate { background: rgba(234, 179, 8, 0.2); color: #fde047; }
.plan-complexity-complex { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }

.plan-card-summary {
    color: #d1d5db;
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.plan-trigger {
    color: #9ca3af;
    font-size: 13px;
    margin-bottom: 10px;
}

.plan-trigger strong {
    color: #d1d5db;
}

.plan-steps {
    list-style: decimal;
    padding-left: 20px;
    margin: 8px 0 12px;
    color: #d1d5db;
    font-size: 13px;
    line-height: 1.8;
}

.plan-service-badge {
    font-size: 11px;
    background: rgba(255, 255, 255, 0.1);
    padding: 1px 6px;
    border-radius: 4px;
    color: #93c5fd;
    margin-left: 4px;
}

.plan-services {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.plan-service-tag {
    font-size: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 3px 10px;
    border-radius: 6px;
    color: #d1d5db;
}

.plan-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.plan-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.plan-btn-primary {
    background: #3b82f6;
    color: white;
}

.plan-btn-primary:hover {
    background: #2563eb;
}

.plan-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.plan-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Responsive: Stack buttons on very small screens */
@media (max-width: 400px) {
    .button-row,
    .send-buttons {
        flex-direction: column;
        gap: 6px;
    }

    .send-btn, .chat-btn, .build-btn {
        width: 100%;
    }

    .kbd-hint {
        display: none;
    }

    .plan-card-actions {
        flex-direction: column;
    }
}

/* =====================================================================
   WELCOME EXAMPLE BUTTONS
   ===================================================================== */
.welcome-example-btn {
    transition: background-color 0.15s, box-shadow 0.15s;
}

.welcome-example-btn:hover {
    background-color: rgba(34, 197, 94, 0.25);
}

.welcome-example-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.6);
    background-color: rgba(34, 197, 94, 0.25);
}

/* =====================================================================
   MODE DROPDOWN (ChatGPT-style compact selector)
   ===================================================================== */
.mode-dropdown-wrapper {
    position: relative;
    padding: 8px 12px 0;
}

.mode-dropdown-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
    line-height: 1.4;
}

.mode-dropdown-trigger:hover {
    color: #e5e7eb;
    background: rgba(255, 255, 255, 0.06);
}

.mode-dropdown-chevron {
    font-size: 10px;
    opacity: 0.6;
    transition: transform 0.15s ease;
}

.mode-dropdown-wrapper.open .mode-dropdown-chevron {
    transform: rotate(180deg);
}

.mode-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 12px;
    z-index: 50;
    min-width: 280px;
    background: #1f2937;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    margin-top: 4px;
}

.mode-dropdown-wrapper.open .mode-dropdown-menu {
    display: block;
}

.mode-dropdown-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    text-align: left;
    color: #d1d5db;
    transition: background 0.12s ease;
    line-height: 1.3;
}

.mode-dropdown-option:hover {
    background: rgba(255, 255, 255, 0.06);
}

.mode-dropdown-option.active {
    background: rgba(59, 130, 246, 0.1);
}

.mode-dropdown-check {
    width: 16px;
    min-width: 16px;
    font-size: 12px;
    color: #3b82f6;
    padding-top: 2px;
    text-align: center;
}

.mode-dropdown-option-name {
    font-size: 14px;
    font-weight: 500;
    color: #f3f4f6;
    white-space: nowrap;
}

.mode-dropdown-option-desc {
    display: block;
    font-size: 12px;
    color: #6b7280;
    font-weight: 400;
    margin-top: 1px;
}

/* Stack name + desc vertically */
.mode-dropdown-option {
    flex-wrap: wrap;
}

.mode-dropdown-option-name,
.mode-dropdown-option-desc {
    flex-basis: calc(100% - 24px);
}

