/* CinePrompt Pro - Compact Clean Design (Universal) */

/* Reset and Base */
.cpw-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.cpw-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin: 20px 0;
}

/* Compact Header */
.cpw-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 20px;
}

.cpw-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.cpw-header p {
    font-size: 14px;
    margin: 0;
    opacity: 0.9;
}

/* Main Layout - Simple Grid */
.cpw-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
}

@media (min-width: 768px) {
    .cpw-main {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
        padding: 24px;
    }
}

/* Clean Panel Design */
.cpw-panel {
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    overflow: hidden;
}

.cpw-panel-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e1e5e9;
    padding: 16px 20px;
}

.cpw-panel-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: #2d3748;
}

.cpw-panel-header p {
    font-size: 13px;
    color: #718096;
    margin: 0;
}

.cpw-content {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Simple Controls */
.cpw-realtime-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.cpw-toggle-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4a5568;
}

.cpw-toggle-switch {
    width: 44px;
    height: 24px;
    background: #cbd5e0;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.cpw-toggle-switch.active {
    background: #48bb78;
}

.cpw-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cpw-toggle-switch.active::after {
    transform: translateX(20px);
}

.cpw-status-badge {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cpw-status-ready {
    background: #c6f6d5;
    color: #22543d;
}

.cpw-status-generating {
    background: #fed7d7;
    color: #c53030;
}

/* Simple Mode Selector */
.cpw-mode-selector {
    display: flex;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 4px;
    margin-bottom: 16px;
}

.cpw-mode-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #718096;
    transition: all 0.2s;
}

.cpw-mode-btn.active {
    background: white;
    color: #2d3748;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Compact Tabs */
.cpw-tab-container {
    margin-bottom: 16px;
}

.cpw-tab-row-1, .cpw-tab-row-2 {
    display: grid;
    gap: 8px;
    margin-bottom: 8px;
}

.cpw-tab-row-1 {
    grid-template-columns: repeat(4, 1fr);
}

.cpw-tab-row-2 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 767px) {
    .cpw-tab-row-1,
    .cpw-tab-row-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

.cpw-tab-btn {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    color: #718096;
    padding: 10px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cpw-tab-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.cpw-tab-btn:hover:not(.active) {
    background: #edf2f7;
    border-color: #cbd5e0;
}

/* Tab Content */
.cpw-tab-content {
    display: none;
}

.cpw-tab-content.active {
    display: block;
}

/* Clean Form Elements */
.cpw-field-group {
    margin-bottom: 16px;
    padding: 16px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.cpw-field-group.cpw-featured {
    background: #ebf8ff;
    border-color: #3182ce;
}

.cpw-field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cpw-featured .cpw-field-label {
    color: #3182ce;
}

.cpw-input,
.cpw-select,
.cpw-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 14px;
    color: #2d3748;
    background: white;
    transition: border-color 0.2s;
    margin: 4px 0;
    font-family: inherit;
}

.cpw-input:focus,
.cpw-select:focus,
.cpw-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.cpw-input::placeholder,
.cpw-textarea::placeholder {
    color: #a0aec0;
}

.cpw-textarea {
    resize: vertical;
    min-height: 60px;
}

.cpw-main-input {
    min-height: 100px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
}

.cpw-select option {
    padding: 8px;
}

/* Simple Buttons */
.cpw-inspiration-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.cpw-inspiration-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.cpw-inspiration-btn:hover {
    background: #5a67d8;
}

.cpw-preset-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 12px 0;
}

@media (max-width: 767px) {
    .cpw-preset-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.cpw-preset-btn {
    background: #edf2f7;
    border: 1px solid #e2e8f0;
    color: #4a5568;
    padding: 10px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s;
}

.cpw-preset-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e0;
}

/* Generate Button Container */
.cpw-generate-btn-container {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

/* Generate Button */
.cpw-generate-btn {
    background: #48bb78;
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s;
}

.cpw-generate-btn:hover {
    background: #38a169;
}

.cpw-generate-btn:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
}

/* Simple Loading */
.cpw-ai-loading {
    text-align: center;
    padding: 40px 20px;
    background: #f7fafc;
    border: 2px dashed #cbd5e0;
    border-radius: 6px;
    margin-bottom: 16px;
}

.cpw-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

.cpw-loading-text {
    color: #667eea;
    font-size: 14px;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Clean Prompt Display */
.cpw-prompt-display {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 16px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #2d3748;
    white-space: pre-wrap;
    overflow-y: auto;
    min-height: 200px;
    max-height: 400px;
}

.cpw-prompt-display.has-content {
    background: #ebf8ff;
    border-color: #3182ce;
}

.cpw-prompt-display .cpw-placeholder {
    color: #a0aec0;
    font-style: italic;
    text-align: center;
    padding-top: 40px;
    font-family: inherit;
}

/* Action Buttons */
.cpw-prompt-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}

@media (max-width: 767px) {
    .cpw-prompt-actions {
        grid-template-columns: 1fr;
    }
}

.cpw-action-btn {
    background: #edf2f7;
    border: 1px solid #e2e8f0;
    color: #4a5568;
    padding: 10px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s;
}

.cpw-action-btn:hover:not(:disabled) {
    background: #e2e8f0;
    border-color: #cbd5e0;
}

.cpw-action-btn:disabled {
    background: #f7fafc;
    color: #a0aec0;
    cursor: not-allowed;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .cpw-wrapper {
        padding: 0 10px;
    }
    
    .cpw-main {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 16px;
    }
    
    .cpw-content {
        padding: 16px;
        max-height: 60vh;
    }
    
    .cpw-header {
        padding: 16px;
    }
    
    .cpw-header h1 {
        font-size: 20px;
    }
    
    .cpw-header p {
        font-size: 13px;
    }
    
    .cpw-field-group {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .cpw-prompt-display {
        min-height: 150px;
        max-height: 300px;
    }
    
    .cpw-realtime-controls {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .cpw-main {
        grid-template-columns: 1fr;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .cpw-wrapper {
        padding: 0 20px;
    }
    
    .cpw-main {
        padding: 32px;
        gap: 32px;
    }
    
    .cpw-content {
        max-height: 75vh;
    }
}

/* Light theme (default) overrides */
.cpw-container.light-theme {
    /* Already light by default */
}

/* Dark theme option */
.cpw-container.dark-theme {
    background: #2d3748;
    border-color: #4a5568;
}

.cpw-container.dark-theme .cpw-panel {
    background: #2d3748;
    border-color: #4a5568;
}

.cpw-container.dark-theme .cpw-panel-header {
    background: #4a5568;
    border-color: #718096;
}

.cpw-container.dark-theme .cpw-panel-header h2 {
    color: #f7fafc;
}

.cpw-container.dark-theme .cpw-panel-header p {
    color: #cbd5e0;
}

.cpw-container.dark-theme .cpw-input,
.cpw-container.dark-theme .cpw-select,
.cpw-container.dark-theme .cpw-textarea {
    background: #4a5568;
    border-color: #718096;
    color: #f7fafc;
}

.cpw-container.dark-theme .cpw-input:focus,
.cpw-container.dark-theme .cpw-select:focus,
.cpw-container.dark-theme .cpw-textarea:focus {
    border-color: #667eea;
}

.cpw-container.dark-theme .cpw-field-group {
    background: #4a5568;
    border-color: #718096;
}

.cpw-container.dark-theme .cpw-field-label {
    color: #f7fafc;
}

.cpw-container.dark-theme .cpw-prompt-display {
    background: #4a5568;
    border-color: #718096;
    color: #f7fafc;
}

/* Print styles */
@media print {
    .cpw-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .cpw-header,
    .cpw-prompt-actions,
    .cpw-mode-selector,
    .cpw-tab-container,
    .cpw-realtime-controls,
    .cpw-generate-btn {
        display: none;
    }
    
    .cpw-main {
        grid-template-columns: 1fr;
    }
    
    /* CinePrompt Pro - Simple Dropdown Design */

/* Remove the complex tab system and replace with simple dropdowns */

/* Hide the complex tab navigation */
.cpw-tab-container,
.cpw-tab-row-1,
.cpw-tab-row-2,
.cpw-tab-btn {
    display: none !important;
}

/* Show all tab content at once in a simple layout */
.cpw-tab-content {
    display: block !important;
    margin-bottom: 20px;
}

/* Simple section headers instead of tabs */
.cpw-section-header {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 6px 6px 0 0;
    padding: 12px 16px;
    margin: 20px 0 0 0;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    border-bottom: none;
}

.cpw-section-content {
    border: 1px solid #e1e5e9;
    border-top: none;
    border-radius: 0 0 6px 6px;
    padding: 16px;
    background: white;
    margin-bottom: 0;
}

/* Alternative 1: Simple Collapsible Sections */
.cpw-collapsible-section {
    margin-bottom: 16px;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    overflow: hidden;
}

.cpw-section-toggle {
    width: 100%;
    background: #f8f9fa;
    border: none;
    padding: 12px 16px;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.cpw-section-toggle:hover {
    background: #e9ecef;
}

.cpw-section-toggle.active {
    background: #e3f2fd;
    color: #1565c0;
}

.cpw-toggle-icon {
    font-size: 12px;
    transition: transform 0.2s;
}

.cpw-section-toggle.active .cpw-toggle-icon {
    transform: rotate(180deg);
}

.cpw-collapsible-content {
    display: none;
    padding: 16px;
    background: white;
    border-top: 1px solid #e1e5e9;
}

.cpw-collapsible-content.active {
    display: block;
}

/* Alternative 2: Simple Category Dropdown */
.cpw-category-selector {
    margin-bottom: 20px;
}

.cpw-category-dropdown {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 14px;
    color: #2d3748;
    background: white;
    cursor: pointer;
}

.cpw-category-dropdown:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Simplified form layout - all in one view */
.cpw-simple-form {
    display: grid;
    gap: 20px;
}

/* Group related fields */
.cpw-field-group-simple {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}

.cpw-field-group-simple h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    padding-bottom: 8px;
    border-bottom: 1px solid #e1e5e9;
}

/* Simplified field labels */
.cpw-simple-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 6px;
}

/* Grid layout for form fields */
.cpw-field-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 768px) {
    .cpw-field-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .cpw-field-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* Compact preset buttons */
.cpw-preset-simple {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.cpw-preset-btn-simple {
    background: white;
    border: 1px solid #cbd5e0;
    color: #4a5568;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.cpw-preset-btn-simple:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Clean main input area */
.cpw-vision-section {
    background: white;
    border: 2px solid #667eea;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.cpw-vision-section h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
}

/* Option 3: Accordion Style (Most Similar to Your Reference) */
.cpw-accordion {
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
}

.cpw-accordion-header {
    background: #f8f9fa;
    padding: 14px 18px;
    cursor: pointer;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.cpw-accordion-header:hover {
    background: #e9ecef;
}

.cpw-accordion-header.active {
    background: #667eea;
    color: white;
}

.cpw-accordion-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.cpw-accordion-icon {
    font-size: 12px;
    transition: transform 0.2s;
}

.cpw-accordion-header.active .cpw-accordion-icon {
    transform: rotate(180deg);
}

.cpw-accordion-content {
    display: none;
    padding: 18px;
    background: white;
}

.cpw-accordion-content.active {
    display: block;
}

/* Simplified mobile layout */
@media (max-width: 767px) {
    .cpw-field-grid {
        grid-template-columns: 1fr;
    }
    
    .cpw-section-toggle,
    .cpw-accordion-header {
        padding: 12px 14px;
        font-size: 13px;
    }
    
    .cpw-field-group-simple {
        padding: 16px;
    }
}

/* Clean dropdown styling */
.cpw-simple-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 14px;
    color: #2d3748;
    background: white;
    margin-bottom: 12px;
}

.cpw-simple-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.cpw-simple-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 14px;
    color: #2d3748;
    background: white;
    margin-bottom: 12px;
}

.cpw-simple-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.cpw-simple-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 14px;
    color: #2d3748;
    background: white;
    resize: vertical;
    min-height: 80px;
}

.cpw-simple-textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}
}