/**
 * Output Panel Components
 * Output sections, character summary, and prompt display
 */

/* Output Panel Sections */
.output-section {
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(139, 92, 246, 0.2);
}

.section-header h3 {
    color: #374151;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

/* Output Text Areas */
.output-text {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    font-family: 'Space Grotesk', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #374151;
    overflow-y: auto;
    min-height: 120px;
    max-height: 200px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.output-text::-webkit-scrollbar {
    width: 6px;
}

.output-text::-webkit-scrollbar-track {
    background: rgba(139, 92, 246, 0.1);
    border-radius: 3px;
}

.output-text::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 3px;
}

.output-text::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.5);
}

/* Output Button Groups */
.output-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Specific Section Styling */
.base-section {
    border-left: 4px solid #8b5cf6;
}

.summary-section {
    border-left: 4px solid #10b981;
}

.character-section {
    border-left: 4px solid #f59e0b;
}

/* Toggle States */
/* Undesired toggle styling moved to buttons.css for consistency */

/* Character Summary Specific */
#summary-text {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.2);
}

/* Character Output Specific */
#character-output {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.2);
}

/* Base Output Specific */
#base-output {
    background: rgba(139, 92, 246, 0.05);
    border-color: rgba(139, 92, 246, 0.2);
}

/* Empty State Styling */
.output-text:empty::before {
    content: 'No content generated yet...';
    color: #9ca3af;
    font-style: italic;
}

/* Modal Styles */
.version-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.version-modal.active {
    display: flex;
}

.version-modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.version-modal-header {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.version-modal-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.version-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

/* All version modal styles moved to css/components/version-modal.css */

.version-history {
    max-height: 200px;
    overflow-y: auto;
    background: rgba(139, 92, 246, 0.05);
    border-radius: 8px;
    padding: 15px;
}

.version-history-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

.version-history-item:last-child {
    border-bottom: none;
}

.version-history-version {
    font-weight: 600;
    color: #8b5cf6;
}

.version-history-date {
    color: #6b7280;
    font-size: 12px;
}

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

/* Responsive Output Panel */
@media (max-width: 768px) {
    .output-section {
        padding: 15px;
    }
    
    .output-text {
        font-size: 12px;
        padding: 12px;
    }
    
    .output-buttons {
        flex-direction: column;
    }
    
    .version-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .version-modal-header {
        padding: 15px 20px;
    }
    
    .version-info-section {
        padding: 15px 20px;
    }
}

/* Settings Modal Specific Styles - match version modal aesthetics */
/* Settings modal inherits base modal structure but gets specific styling for purple body */
#settings-modal .version-modal-content {
    background: linear-gradient(135deg, 
        rgb(45, 25, 80) 0%, 
        rgb(52, 30, 95) 25%, 
        rgb(60, 35, 110) 50%, 
        rgb(52, 30, 95) 75%, 
        rgb(45, 25, 80) 100%);
    border: 1px solid rgba(255, 123, 71, 0.3);
}

#settings-modal .version-modal-header {
    background: #ff7b47;
    color: #191970;
}

#settings-modal .version-modal-title {
    color: #191970;
}

.settings-section {
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 123, 71, 0.2);
    color: white;
    font-family: 'Space Grotesk', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

.settings-section:last-child {
    border-bottom: none;
    border-radius: 0 0 16px 16px;
}

.settings-section h4 {
    color: #ff7b47;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 0;
    border-bottom: none;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 12px;
    background: rgba(255, 123, 71, 0.1);
    border: 1px solid rgba(255, 123, 71, 0.2);
    transition: all 0.15s ease;
}

.setting-item:hover {
    background: rgba(255, 123, 71, 0.15);
    border-color: rgba(255, 123, 71, 0.3);
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-description {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.5;
    flex: 1;
    font-family: 'Space Grotesk', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
}

/* Preferences button styling moved to buttons.css for consistency */

/* Section header layout for integrated preferences button */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h3 {
    margin: 0;
    flex: 1;
}

/* Preferences button integrated styling moved to buttons.css for consistency */
    margin-left: 12px;
    flex-shrink: 0;
}

/* Preferences button hover removed - now handled in forms.css */

/* Legacy form settings header (now unused but kept for compatibility) */
.form-settings-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    padding: 0 20px;
}

/* Modal button overrides for better styling */
#settings-modal-body .content-toggle,
#settings-modal-body .subcategory-toggle,
#settings-modal-body .optional-toggle {
    min-width: 140px;
    justify-content: center;
    font-size: 14px;
    padding: 8px 16px;
}

/* ============================================================================
   HORIZONTAL TOGGLE SWITCH - ADULT MODE |OFF/ON| Style
   ============================================================================ */

/* Horizontal toggle layout */
.setting-item.horizontal-toggle {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.setting-label {
    font-size: 14px;
    font-weight: 600;
    color: #ff7b47;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    min-width: 120px;
}

.toggle-container {
    display: flex;
    align-items: center;
}

/* Sliding toggle switch */
.switch-toggle {
    position: relative;
    width: 80px;
    height: 32px;
    background: rgba(80, 80, 80, 0.8);
    border: 1px solid rgba(80, 80, 80, 0.5);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px;
    overflow: hidden;
    color: white !important; /* Override .btn color: #374151 */
}

.switch-toggle.on {
    background: #ff7b47;
    border-color: rgba(255, 123, 71, 0.6);
}

.switch-toggle.off {
    background: rgba(139, 92, 246, 0.8);
    border-color: rgba(139, 92, 246, 0.5);
}

/* Sliding button inside the switch */
.switch-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 28px;
    height: 28px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.switch-toggle.on .switch-slider {
    transform: translateX(48px);
}

.switch-toggle.off .switch-slider {
    transform: translateX(0);
}

/* Text labels inside switch */
.switch-text {
    position: absolute;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
    line-height: 1;
    top: 50%;
    transform: translateY(-50%);
}

/* Text color overrides - maximum specificity to override ALL inheritance */
button.switch-toggle .switch-text.off-text,
.switch-toggle .switch-text.off-text,
span.switch-text.off-text {
    left: 8px;
    color: white !important;
}

button.switch-toggle .switch-text.on-text,
.switch-toggle .switch-text.on-text,
span.switch-text.on-text {
    right: 8px;
    color: #191970 !important;
}

button.switch-toggle.off .switch-text.on-text {
    color: rgba(255, 255, 255, 0.3) !important;
}

button.switch-toggle.on .switch-text.off-text {
    color: rgba(25, 25, 112, 0.3) !important;
}

@media (max-width: 768px) {
    .settings-section {
        padding: 20px;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px;
    }
    
    .setting-item.toggle-style {
        gap: 10px;
    }
    
    .setting-description {
        margin-left: 0;
    }
    
    .settings-section h4 {
        font-size: 16px;
        margin-bottom: 15px;
    }
}