* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 16px;
    color: #1f2937;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 24px;
}

header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

header h1 {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 8px;
    font-weight: 700;
}

.subtitle {
    color: #6b7280;
    font-size: 1rem;
    font-weight: 400;
}

.section {
    margin-bottom: 30px;
}

.section h2 {
    color: #1f2937;
    margin-bottom: 16px;
    font-size: 1.5rem;
    font-weight: 600;
}

.hidden {
    display: none !important;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.nav-tab {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    font-family: inherit;
}

.nav-tab:hover {
    color: #667eea;
    background: #f9fafb;
}

.nav-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

/* Search and Filter Bar */
.search-filter-bar {
    margin-bottom: 30px;
}

.search-container {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.category-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 6px 14px;
    border: 1px solid #d1d5db;
    background: white;
    color: #6b7280;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.category-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

.category-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

/* No Results Message */
.no-results {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.1rem;
}

/* Ready Prompts Grid */
.ready-prompts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.ready-prompt-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
}

.ready-prompt-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.ready-prompt-card .ready-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #10b981;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.ready-prompt-card h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.3rem;
    padding-right: 80px;
}

.ready-prompt-card .category-tag {
    display: inline-block;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.ready-prompt-card .copy-ready-btn {
    margin-top: 15px;
    width: 100%;
    padding: 10px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.ready-prompt-card .copy-ready-btn:hover {
    background: #5568d3;
}

/* Ready Prompts Split View */
.ready-prompts-split-view {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 16px;
    margin-top: 16px;
    height: calc(100vh - 280px);
    min-height: 600px;
}

.ready-prompts-list {
    background: #ffffff;
    border-radius: 8px;
    padding: 16px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
}

.prompts-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.prompts-list-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.1rem;
    font-weight: 600;
}

.prompt-count {
    color: #6b7280;
    font-size: 0.85rem;
    background: #f3f4f6;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 500;
}

.category-filters-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.category-filter-btn {
    padding: 5px 12px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
    font-weight: 500;
}

.category-filter-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

.category-filter-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.prompts-list-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.prompt-list-item {
    background: white;
    border-radius: 6px;
    padding: 8px 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
}

.prompt-list-item:hover {
    background: #f9fafb;
    border-color: #667eea;
    transform: translateX(2px);
}

.prompt-list-item.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

.prompt-list-item.active .prompt-icon {
    filter: brightness(0) invert(1);
}

.prompt-list-item .prompt-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    line-height: 1;
}

.prompt-list-item .prompt-info {
    flex: 1;
    min-width: 0;
}

.prompt-list-item .prompt-name {
    font-weight: 500;
    font-size: 0.875rem;
    margin: 0;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.prompt-list-item.active .prompt-name {
    color: white;
}

.ready-prompt-preview {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ready-prompt-preview .preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
    gap: 12px;
}

.ready-prompt-preview .preview-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.15rem;
    flex: 1;
    font-weight: 600;
}

.ready-prompt-preview .preview-content {
    flex: 1;
    overflow-y: auto;
    background: #f9fafb;
    border-radius: 6px;
    padding: 16px;
}

.ready-prompt-preview .preview-content pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #374151;
}

/* Responsive Design for Split View */
@media (max-width: 968px) {
    .ready-prompts-split-view {
        grid-template-columns: 1fr;
        height: auto;
        min-height: auto;
    }
    
    .ready-prompts-list {
        max-height: 400px;
    }
    
    .ready-prompt-preview {
        min-height: 400px;
    }
    
    .category-filters-mini {
        gap: 4px;
    }
    
    .category-filter-btn {
        padding: 4px 10px;
        font-size: 0.75rem;
    }
}

/* Template Grid */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.template-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.template-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.template-card h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.template-card p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

.template-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

/* Form Styles */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

#template-title {
    margin: 0;
}

.description {
    color: #666;
    margin-bottom: 25px;
    font-size: 1rem;
    line-height: 1.6;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group label .required {
    color: #e74c3c;
    margin-left: 3px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-item label {
    margin: 0;
    font-weight: normal;
    cursor: pointer;
}

/* Buttons */
.btn-primary,
.btn-success,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-2px);
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Preview Section */
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.preview-container {
    background: #1e1e1e;
    border-radius: 12px;
    padding: 20px;
    max-height: 600px;
    overflow-y: auto;
}

#prompt-preview {
    color: #d4d4d4;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
}

/* Consistent preview content styling for all preview sections */
.preview-content pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #374151;
}

.preview-content pre code {
    background: rgba(102, 126, 234, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    color: #667eea;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #10b981;
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.toast.hidden {
    display: none;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Project Section Styles */
.project-options {
    margin-bottom: 20px;
}

.option-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}

.option-tab {
    padding: 5px 12px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
    font-weight: 500;
    font-family: inherit;
}

.option-tab:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

.option-tab.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.project-content {
    margin-top: 24px;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.project-card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

/* Upload Area Styles */
.upload-area {
    max-width: 800px;
    margin: 0 auto;
}

/* API Key Section */
.api-key-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.api-key-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 600;
    color: #1f2937;
    font-size: 0.95rem;
}

.api-key-info {
    font-weight: 400;
    color: #6b7280;
    font-size: 0.85rem;
}

.api-key-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.api-key-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
    background: white;
    transition: border-color 0.2s ease;
}

.api-key-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.api-key-help {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

.api-key-help a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.api-key-help a:hover {
    text-decoration: underline;
}

.api-key-status {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
}

.api-key-status.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.api-key-status.info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.api-key-status.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.upload-box {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 48px 24px;
    text-align: center;
    background: #f9fafb;
    transition: all 0.3s ease;
}

.upload-box:hover {
    border-color: #667eea;
    background: #f3f4f6;
}

.upload-box.dragover {
    border-color: #667eea;
    background: #ede9fe;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.upload-box h3 {
    color: #1f2937;
    margin-bottom: 8px;
    font-size: 1.25rem;
}

.upload-box p {
    color: #6b7280;
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.file-info {
    margin-top: 16px;
    color: #667eea;
    font-weight: 500;
    font-size: 0.9rem;
}

#scope-processing {
    text-align: center;
    padding: 48px 24px;
}

.processing-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

#scope-processing p {
    color: #6b7280;
    font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    header h1 {
        font-size: 2rem;
    }

    .template-grid {
        grid-template-columns: 1fr;
    }

    .preview-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .action-buttons {
        width: 100%;
    }

    .action-buttons button {
        flex: 1;
        min-width: 120px;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .upload-box {
        padding: 32px 16px;
    }

    .option-tabs {
        gap: 4px;
    }

    .option-tab {
        padding: 4px 10px;
        font-size: 0.75rem;
    }

    .api-key-input-group {
        flex-direction: column;
    }

    .api-key-input-group button {
        width: 100%;
    }

    .api-key-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

