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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #000;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    padding: 40px 20px;
    background-color: #406766;
    color: white;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-text {
    flex: 1;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 300;
}

.header-actions {
    display: flex;
    align-items: center;
}

/* Prompts Dropdown */
.prompts-dropdown {
    position: relative;
}

.prompts-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background-color: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.prompts-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

.prompts-btn svg {
    flex-shrink: 0;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
}

.prompts-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background-color: #406766;
    border-radius: 8px;
    min-width: 280px;
    max-width: 350px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    overflow: hidden;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-header {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.9rem;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.prompts-list {
    max-height: 300px;
    overflow-y: auto;
}

.prompt-item-empty {
    padding: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.prompt-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.prompt-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.prompt-item.active {
    background-color: rgba(255, 255, 255, 0.15);
    border-left: 3px solid white;
}

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

.prompt-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    width: 100%;
    margin: 0;
}

.prompt-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #406766;
    flex-shrink: 0;
    margin: 0;
}

.prompt-item-title {
    display: inline-block;
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
    vertical-align: middle;
}

.prompt-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

.prompt-check-icon {
    color: white;
    flex-shrink: 0;
}

.prompt-edit-btn,
.prompt-delete-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.prompt-edit-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.prompt-delete-btn:hover {
    background-color: rgba(255, 0, 0, 0.2);
    color: #ff6b6b;
}

.prompt-edit-btn.disabled,
.prompt-delete-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.prompt-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
}

.public-badge {
    background-color: rgba(64, 103, 102, 0.8);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.dropdown-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

.add-prompt-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: white;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.add-prompt-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Main Content - Three Modules */
.main-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* Module Styling */
.module {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.module:hover {
    border-color: #406766;
    box-shadow: 0 4px 12px rgba(64, 103, 102, 0.15);
}

.module h2 {
    background-color: #406766;
    color: white;
    padding: 20px;
    font-size: 1.3rem;
    font-weight: 500;
}

.module-content {
    padding: 25px;
    min-height: 400px;
}

/* Upload Area */
.upload-area {
    border: 3px dashed #406766;
    border-radius: 8px;
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
}

.upload-area:hover {
    background-color: rgba(64, 103, 102, 0.05);
    border-color: #2d4b4a;
}

.upload-area.drag-over {
    background-color: rgba(64, 103, 102, 0.1);
    border-color: #2d4b4a;
    transform: scale(1.02);
}

.upload-area svg {
    color: #406766;
    margin-bottom: 15px;
}

.upload-text {
    font-size: 1.1rem;
    color: #000;
    font-weight: 500;
    margin-bottom: 8px;
}

.file-types {
    font-size: 0.9rem;
    color: #666;
}

/* File Info */
.file-info {
    background-color: #f9f9f9;
    border: 2px solid #406766;
    border-radius: 8px;
    padding: 20px;
}

.file-details {
    margin-bottom: 20px;
}

.file-details p {
    margin-bottom: 10px;
    font-size: 1rem;
}

.file-details strong {
    color: #406766;
}

/* Textarea */
textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s ease;
    background-color: white;
}

textarea:focus {
    outline: none;
    border-color: #406766;
}

/* Checkbox Group */
.checkbox-group {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.checkbox-label:hover {
    background-color: rgba(64, 103, 102, 0.05);
    border-color: #406766;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: #406766;
    flex-shrink: 0;
}

.checkbox-text {
    font-weight: 500;
    color: #000;
    display: block;
    margin-bottom: 4px;
}

.checkbox-desc {
    font-size: 0.85rem;
    color: #666;
    display: block;
}

.checkbox-label input[type="checkbox"]:checked ~ .checkbox-text {
    color: #406766;
}

/* Process Section */
.process-section {
    text-align: center;
}

.process-note {
    margin-top: 15px;
    color: #666;
    font-size: 0.9rem;
}

/* Progress Section */
.progress-section {
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background-color: #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 15px;
    border: 2px solid #406766;
}

.progress-fill {
    height: 100%;
    background-color: #406766;
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 500;
}

.progress-text {
    font-size: 1.1rem;
    color: #406766;
    font-weight: 600;
}

/* Output Section */
.output-section {
    text-align: center;
}

.success-message {
    margin-bottom: 30px;
}

.success-message svg {
    margin-bottom: 15px;
}

.success-message h3 {
    color: #406766;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.output-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 15px 35px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn-primary:hover:not(:disabled) {
    background-color: #2d4b4a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(64, 103, 102, 0.3);
}

.btn-primary:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-secondary {
    background-color: white;
    color: #406766;
    border: 2px solid #406766;
}

.btn-secondary:hover {
    background-color: #406766;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(64, 103, 102, 0.3);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.modal-content h3 {
    color: #406766;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.modal-content p {
    margin-bottom: 25px;
    color: #000;
    font-size: 1.05rem;
}

/* Prompt Modal */
.prompt-modal-content {
    max-width: 600px;
    text-align: left;
    padding: 0;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 30px;
    border-bottom: 2px solid #f0f0f0;
}

.modal-header h3 {
    margin: 0;
    color: #406766;
    font-size: 1.5rem;
}

.modal-close {
    background: #f5f5f5;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
}

.modal-close:hover {
    background: #e0e0e0;
    color: #000;
}

.modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 30px;
    border-top: 2px solid #f0f0f0;
}

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

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

.form-label {
    display: block;
    margin-bottom: 12px;
    color: #333;
    font-weight: 500;
    font-size: 0.95rem;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
    background-color: white;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #406766;
}

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

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.radio-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    padding: 18px 20px;
    background-color: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.radio-label:hover {
    background-color: #f8f9fa;
    border-color: #406766;
    box-shadow: 0 2px 8px rgba(64, 103, 102, 0.1);
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 24px;
    height: 48px;
    min-width: 24px;
    min-height: 48px;
    border: 2px solid #ddd;
    border-radius: 12px;
    margin-right: 16px;
    margin-top: 0;
    flex-shrink: 0;
    position: relative;
    transition: all 0.3s ease;
    background-color: #f5f5f5;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.radio-label:hover .radio-custom {
    border-color: #406766;
    background-color: #f0f0f0;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: #28a745;
    background-color: #e8f5e9;
    box-shadow: inset 0 2px 4px rgba(40, 167, 69, 0.2);
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background-color: #28a745;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.4);
    transition: all 0.3s ease;
}

.radio-label input[type="radio"]:not(:checked) + .radio-custom::after {
    content: '';
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background-color: #bbb;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.radio-label input[type="radio"]:checked ~ .radio-content .radio-title {
    color: #28a745;
    font-weight: 600;
}

.radio-label.checked {
    background-color: #f0f9f4;
    border-color: #28a745;
    border-width: 2.5px;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.15);
}

.radio-content {
    flex: 1;
}

.radio-title {
    display: block;
    font-weight: 500;
    color: #000;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.radio-desc {
    display: block;
    font-size: 0.85rem;
    color: #666;
    line-height: 1.4;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.loading-overlay.show {
    display: flex;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-overlay p {
    color: white;
    font-size: 1.2rem;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-actions {
        width: 100%;
        justify-content: center;
    }
    
    .dropdown-menu {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .module-content {
        padding: 20px;
        min-height: auto;
    }
    
    .output-buttons {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-header,
    .modal-footer {
        padding: 20px;
    }
}
