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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    line-height: 1.6;
    color: #333;
    background-color: #f4f7f9;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

header h1 {
    font-size: 2.8em;
    color: #2c3e50;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 1.2em;
    color: #555;
    margin-bottom: 5px;
}

.powered-by {
    font-size: 0.9em;
    color: #777;
    font-style: italic;
    margin-bottom: 10px;
}

.version-info {
    font-size: 0.95em;
    color: #444;
    margin-top: 10px;
    background-color: #eafaf1;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #c8e6c9;
    display: inline-block;
}

.version-info a {
    color: #1a73e8;
    text-decoration: none;
    font-weight: 500;
}

.version-info a:hover {
    text-decoration: underline;
}

main {
    max-width: 900px;
    margin: 0 auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

section {
    margin-bottom: 40px;
    padding-bottom: 25px;
    border-bottom: 1px solid #eee;
}

section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

h2 {
    font-size: 1.8em;
    color: #34495e;
    margin-bottom: 20px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e0e0e0;
}

h3 {
    font-size: 1.4em;
    color: #16a085;
    margin-top: 25px;
    margin-bottom: 15px;
}

h4 {
    font-size: 1.1em;
    color: #2980b9;
    margin-top: 15px;
    margin-bottom: 10px;
}

p {
    margin-bottom: 15px;
    color: #444;
}

ul {
    list-style-position: inside;
    margin-left: 20px;
    margin-bottom: 15px;
}

li {
    margin-bottom: 8px;
    color: #555;
}

strong {
    color: #2c3e50;
}

.score {
    background-color: #e8f6f3;
    border-left: 4px solid #1abc9c;
    padding: 10px 15px;
    margin: 15px 0;
    font-weight: bold;
    color: #16a085;
}

/* Input Area Styling */
#input-section .input-area {
    margin-top: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px dashed #ccc;
    border-radius: 5px;
}

#input-section textarea,
#input-section input[type="text"],
#input-section select {
    display: block;
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1em;
    margin-bottom: 10px;
    resize: vertical;
}

#input-section button {
     display: block;
     width: fit-content; 
     margin: 10px 0 0 auto; 
     padding: 10px 20px;
     background-color: #3498db; 
     color: white;
     border: none;
     border-radius: 4px;
     cursor: pointer; 
     font-size: 1em;
     transition: background-color 0.3s ease;
}
#input-section button:hover {
    background-color: #2980b9; 
}

/* Input Options (Radio Buttons) */
.input-options {
    display: flex;
    flex-wrap: wrap; 
    gap: 15px; 
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.input-options label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1em;
    color: #333;
}

.input-options input[type="radio"] {
    margin-right: 5px;
    cursor: pointer;
}

/* Loading Indicator Styling */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
    padding: 10px;
    background-color: #eef2f5;
    border-radius: 4px;
    border: 1px solid #d1d9e0;
}

.loading-indicator span {
    margin-left: 10px;
    font-size: 0.95em;
    color: #34495e;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border-left-color: #3498db;
    animation: spin 1s ease infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Settings Styling */
#settings-section .settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

#settings-section fieldset {
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 5px;
}

#settings-section legend {
    font-weight: bold;
    color: #34495e;
    padding: 0 5px;
}

#settings-section select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.95em;
}

#settings-section .expert-selection div {
    margin-bottom: 8px;
}

#settings-section .expert-selection label {
    margin-left: 5px;
    cursor: pointer;
    display: inline-block; 
    vertical-align: middle; 
}

#settings-section .expert-selection input[type="checkbox"] {
    vertical-align: middle; 
}

/* Output Sections Styling */
.output-section {
    background-color: #fdfdfd;
    padding: 25px;
    margin-top: 20px;
    border: 1px solid #eee;
    border-radius: 5px;
}

.output-section h2, .output-section h3 {
     border-bottom: none; 
}
.output-section h3 {
    color: #2c3e50; 
}

.expert-prompts .expert-prompt {
    background-color: #ffffff;
    border: 1px solid #e7e7e7;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.expert-prompts .expert-prompt h3 {
     margin-top: 0; 
     color: #16a085; 
     border-bottom: 1px solid #eee;
     padding-bottom: 10px;
     margin-bottom: 15px;
}

.expert-prompts .expert-prompt h4 {
     color: #2980b9; 
     margin-top: 20px;
}

.expert-prompts .expert-prompt ul {
    list-style-type: disc; 
    margin-left: 25px;
}

/* Combined Prompt Section */
#combined-prompt-output h2 {
    color: #8e44ad; 
}

#combinedPromptContainer {
    position: relative;
}

.prompt-actions {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.prompt-actions button {
    padding: 8px 15px;
    background-color: #9b59b6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}

.prompt-actions button:hover {
    background-color: #8e44ad;
}

#combinedPromptContainer pre {
    background-color: #f0eafc;
    color: #333;
    border: 1px solid #d5c6e0;
    padding: 20px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#combinedPromptContainer pre code {
    font-family: inherit;
    font-size: 1em;
    line-height: 1.6;
}

/* Code Block Styling */
pre {
    background-color: #282c34; 
    color: #abb2bf;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 15px; 
}

code.hljs {
    font-family: 'Fira Code', 'Courier New', Courier, monospace; 
    font-size: 0.9em;
}

/* Project List Modal Styling */
.project-list-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #777;
}

.close-button:hover {
    color: #333;
}

.project-list {
    max-height: 60vh;
    overflow-y: auto;
    margin-top: 15px;
    padding: 10px 0;
    border-top: 1px solid #eee;
}

.project-item {
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.project-item:hover {
    background-color: #f5f8ff;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.project-item h4 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.2em;
}

.project-item p {
    margin: 5px 0;
    color: #666;
    font-size: 0.9em;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    font-size: 0.9em;
    color: #777;
}

footer p a {
    color: #1a73e8; 
    text-decoration: none;
    font-weight: 500;
}

footer p a:hover {
    text-decoration: underline;
}

/* Responsive adjustments (optional but good practice) */
@media (max-width: 768px) {
    #settings-section .settings-grid {
        grid-template-columns: 1fr; 
    }
    header h1 {
        font-size: 2.2em;
    }
    main {
        padding: 20px;
    }
     .input-options {
         gap: 10px; 
     }
     .input-options label {
         font-size: 0.95em;
     }
}