/* ============================================================================
   PROMPT GENERATION PAGE - COMPLETE STYLES
   Single consolidated file for all prompt generation page styling
   ============================================================================ */

/* Module Container */
#prompt-generation-module {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

#normal-view-content {
    width: 100%;
    max-width: 100%;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* Parameters Section - Collapsible */
.parameters-container {
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

.parameters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-input, #1e293b);
    border: 1px solid var(--border, #334155);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.parameters-header:hover {
    background: var(--bg-hover, #1e293b);
    border-color: var(--primary, #007acc);
}

.parameters-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.parameters-toggle-icon {
    font-size: 14px;
    color: var(--text-secondary, #94a3b8);
    transition: transform 0.3s ease;
}

.parameters-header.expanded .parameters-toggle-icon {
    transform: rotate(90deg);
}

.parameters-header-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.param-preview-compact {
    flex: 1;
    padding: 6px 12px;
    background: var(--bg-main, #0f172a);
    border: 1px solid var(--border, #334155);
    border-radius: 4px;
    font-family: input-mono, 'Monaco', 'Courier New', monospace;
    font-size: 11px;
    color: var(--text-terminal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 600px;
}

.parameters-edit-btn {
    padding: 6px 12px;
    background: var(--primary, #007acc);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.parameters-edit-btn:hover {
    background: var(--primary-hover, #005a9e);
    transform: translateY(-1px);
}

.parameters-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.parameters-content.expanded {
    max-height: 800px;
    padding-top: 16px;
}

.params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

.param-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.param-field label {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
}

.param-field select,
.param-field input {
    padding: 10px;
    background: var(--bg-input, #1a1a1a);
    border: 1px solid var(--border, #444);
    border-radius: 6px;
    color: var(--text-primary, #757575);
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.param-field select:focus,
.param-field input:focus {
    outline: none;
    border-color: var(--primary, #007acc);
}

.param-preview {
    margin-top: 16px;
    padding: 12px;
    background: var(--bg-main, #0d1117);
    border: 1px solid var(--border, #444);
    border-radius: 6px;
    font-family: input-mono, 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    color: var(--text-terminal)
}

/* Generated Prompts Section */
.prompts-wrapper {
    position: relative;
    min-height: 100px;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 6px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary, #007acc);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    margin-top: 12px;
    color: var(--text-primary, #e0e0e0);
    font-size: 14px;
}

/* Prompt List Container */
#generatedPrompts {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    min-height: 50px;
}

/* Individual Prompt Card - Horizontal Layout */
#generatedPrompts .prompt-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-input, #1e293b);
    border: 1px solid var(--border, #334155);
    border-radius: 6px;
    transition: all 0.2s ease;
}

#generatedPrompts .prompt-item:hover {
    border-color: var(--primary, #007acc);
    background: var(--bg-hover, #1e293b);
}

/* Checkbox */
#generatedPrompts .prompt-selector {
    margin: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary, #007acc);
    flex-shrink: 0;
}

/* Title */
#generatedPrompts .prompt-title {
    font-size: 35px;
    font-weight: 600;
    color: rgb(255 255 255 / 10%);
    white-space: nowrap;
    min-width: 80px;
    flex-shrink: 0;
}

/* Prompt Content Container */
#generatedPrompts .prompt-content-compact {
    flex: 1;
    min-width: 0;
}

/* Textarea */
#generatedPrompts .prompt-text {
    width: 100%;
    min-height: 100px;
    max-height: 250px;
    background: var(--bg-main, #0f172a);
    border: 1px solid var(--border, #334155);
    border-radius: 4px;
    color: var(--text-terminal);
    font-size: 12px;
    font-family: input-mono, 'Monaco', 'Consolas', 'Courier New', monospace;
    resize: vertical;
    transition: all 0.2s ease;
    line-height: 1.25;
}

#generatedPrompts .prompt-text:focus {
    outline: none;
    border-color: var(--primary, #007acc);
    background: var(--bg-focus, #1e293b);
    box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.1);
}

/* Action Buttons Container */
#generatedPrompts .prompt-actions-compact {
    display: flex;
    gap: 6px;
    flex-direction: column;
}

/* Button Base Styles */
#generatedPrompts .prompt-actions-compact button {
    padding: 4px 12px;
    font-size: 10px;
    font-weight: 400;
    text-transform: uppercase;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

#generatedPrompts .prompt-actions-compact button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#generatedPrompts .prompt-actions-compact button:active {
    transform: translateY(0);
}

#generatedPrompts .prompt-actions-compact button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Copy Button */
#generatedPrompts .copy-prompt {
    background: #475569;
    color: #fff;
}

#generatedPrompts .copy-prompt:hover {
    background: #64748b;
}

/* Delete Button */
#generatedPrompts .delete-prompt {
    background: #dc2626;
    color: #fff;
}

#generatedPrompts .delete-prompt:hover {
    background: #ef4444;
}

/* Midjourney Button */
#generatedPrompts .send-midjourney {
    background: #7c3aed;
    color: #fff;
}

#generatedPrompts .send-midjourney:hover {
    background: #8b5cf6;
}

/* Ideogram Button */
#generatedPrompts .send-ideogram {
    background: #2563eb;
    color: #fff;
}

#generatedPrompts .send-ideogram:hover {
    background: #3b82f6;
}

/* Batch Actions Section */
.batch-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    background: var(--bg-input, #1e293b);
    border: 1px solid var(--border, #334155);
    border-radius: 6px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.batch-send-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary, #94a3b8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 8px;
}

.batch-actions .action-button {
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 400;
    text-transform: uppercase;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.batch-actions .action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.batch-actions .action-button i {
    font-size: 14px;
}

/* Select All Header */
.prompts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-input, #1e293b);
    border: 1px solid var(--border, #334155);
    border-radius: 6px;
    margin-bottom: 12px;
}

.select-all-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.select-all-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary, #007acc);
}

.select-all-label {
    font-weight: 600;
    color: var(--text-primary, #e2e8f0);
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}

.selected-count {
    color: var(--text-secondary, #94a3b8);
    font-size: 12px;
    margin-left: auto;
}

/* Responsive Design */
@media (max-width: 1200px) {
    /* Hide button text, keep icons only */
    #generatedPrompts .prompt-actions-compact button span {
        display: none;
    }
    
    #generatedPrompts .prompt-actions-compact button {
        padding: 8px;
    }
}

@media (max-width: 768px) {
    #generatedPrompts .prompt-item {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    #generatedPrompts .prompt-content-compact {
        order: 3;
        flex-basis: 100%;
    }
    
    #generatedPrompts .prompt-actions-compact {
        order: 4;
        flex-basis: 100%;
        justify-content: flex-end;
    }
    
    .batch-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .batch-send-label {
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    .batch-actions .action-button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    #normal-view-content {
        padding: 12px;
    }
    
    .params-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    #generatedPrompts .prompt-title {
        min-width: 60px;
        font-size: 12px;
    }
    
    #generatedPrompts .prompt-text {
        font-size: 12px;
    }
}

/* Empty State */
#generatedPrompts:empty::after {
    content: "No prompts generated yet. Use the AI Chat to generate prompts.";
    display: block;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary, #94a3b8);
    font-size: 14px;
    font-style: italic;
}
