body {
    font-family: sans-serif;
    margin: 20px;
    background-color: #f4f4f4;
}

h1 {
    color: #333;
    text-align: center;
}

p {
    text-align: center;
    color: #555;
}

.section {
    background-color: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section h2 {
    margin: 0;
    color: #0056b3;
    padding-bottom: 10px;
    flex-grow: 1;
}

.toggle-btn {
    background: none;
    border: none;
    color: #0056b3;
    font-size: 1.2em;
    cursor: pointer;
    padding: 0 10px;
}

.toggle-btn:hover {
    color: #003d7a;
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.toggle-icon.collapsed {
    transform: rotate(-90deg);
}

.section-header + hr {
    margin-top: 0;
    margin-bottom: 15px;
    border: 0;
    border-top: 2px solid #eee;
}

#api-config-section div {
    margin-bottom: 10px;
}

#api-config-section label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

/* OAuth Section Styles */
.oauth-section {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f0f7ff;
    border-radius: 8px;
    border: 1px solid #cce5ff;
}

.oauth-btn {
    background-color: #0066cc !important;
    color: white;
    padding: 12px 20px !important;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.oauth-btn:hover {
    background-color: #0052a3 !important;
}

.oauth-info {
    margin-top: 8px;
    color: #0066cc;
    font-size: 0.9em;
    text-align: center;
}

.manual-config-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.section-label {
    font-weight: bold;
    color: #555;
    margin-bottom: 15px;
}

/* Model Selection Dropdown */
#model-id-select {
    width: calc(100% - 22px);
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

#api-config-section input[type="text"],
#api-config-section input[type="url"],
#api-config-section input[type="password"],
#api-config-section select {
    width: calc(100% - 22px); /* Account for padding and border */
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Include padding and border in element's total width and height */
}

#api-config-section button {
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    margin-top: 10px;
}

#api-config-section button:hover:not(:disabled) {
    background-color: #0056b3;
}

#api-config-section button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

#delete-profile-btn {
    background-color: #dc3545 !important; /* Red */
}

#delete-profile-btn:hover:not(:disabled) {
    background-color: #c82333 !important;
}

.profile-controls {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.profile-controls > div {
    flex-grow: 1;
}

#api-config-section hr {
    margin-top: 20px;
    margin-bottom: 20px;
    border: 0;
    border-top: 1px solid #eee;
}

#prompt-section label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

#prompt-section textarea {
    width: calc(100% - 22px); /* Account for padding and border */
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: inherit; /* Use body font */
    font-size: 1em;
    margin-bottom: 10px;
}

/* Attachment Section Styles */
.attachment-section {
    margin: 15px 0;
}

.attachment-section label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.attachment-section input[type="file"] {
    margin-bottom: 10px;
    width: 100%;
}

.attachments-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.attachment-preview {
    position: relative;
    width: 100px;
    height: 100px;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
}

.attachment-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-preview .pdf-preview {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    color: #495057;
    font-size: 0.8em;
    text-align: center;
    padding: 5px;
}

.attachment-preview .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background-color: rgba(255, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#prompt-section button {
    padding: 10px 15px;
    background-color: #28a745; /* Green */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
}

#prompt-section button:hover {
    background-color: #218838;
}

#outline-section .output-display {
    background-color: #e9ecef;
    padding: 15px;
    border-radius: 4px;
    min-height: 100px;
    margin-bottom: 10px;
    border: 1px solid #ced4da;
    overflow-y: auto;
}

/* Markdown Styling */
.output-display h1, 
.output-display h2, 
.output-display h3, 
.output-display h4, 
.output-display h5, 
.output-display h6 {
    color: #0056b3;
    margin-top: 1em;
    margin-bottom: 0.5em;
}

.output-display h1 {
    font-size: 1.8em;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.3em;
}

.output-display h2 {
    font-size: 1.5em;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.3em;
}

.output-display h3 {
    font-size: 1.3em;
}

.output-display p {
    margin: 0.5em 0;
    text-align: left;
    color: #333;
}

.output-display ul, 
.output-display ol {
    margin: 0.5em 0;
    padding-left: 2em;
}

.output-display li {
    margin: 0.3em 0;
}

.output-display code {
    background-color: #f8f9fa;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
}

.output-display pre {
    background-color: #f8f9fa;
    padding: 1em;
    border-radius: 4px;
    overflow-x: auto;
    margin: 0.5em 0;
}

.output-display pre code {
    background-color: transparent;
    padding: 0;
}

.output-display blockquote {
    border-left: 4px solid #ced4da;
    padding-left: 1em;
    margin-left: 0;
    color: #6c757d;
}

.output-display table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
}

.output-display th, 
.output-display td {
    border: 1px solid #dee2e6;
    padding: 0.5em;
    text-align: left;
}

.output-display th {
    background-color: #f8f9fa;
}

#outline-section textarea {
    width: calc(100% - 22px); /* Account for padding and border */
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: monospace; /* Use monospace for editing code/outlines */
    font-size: 0.9em;
    margin-bottom: 10px;
}

#outline-section .button-group {
    display: flex;
    gap: 10px; /* Space between buttons */
}

#outline-section button {
    padding: 10px 15px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
}

#outline-section button:disabled {
    background-color: #6c757d; /* Grey out disabled buttons */
    cursor: not-allowed;
}

#edit-outline-btn {
    background-color: #ffc107; /* Yellow */
    color: #333;
}
#edit-outline-btn:hover:not(:disabled) {
    background-color: #e0a800;
}

#approve-outline-btn {
    background-color: #17a2b8; /* Teal */
}
#approve-outline-btn:hover:not(:disabled) {
    background-color: #138496;
}

#website-display-section iframe {
    width: 100%;
    height: 500px; /* Adjust height as needed */
    border: 1px solid #ccc;
    border-radius: 4px;
}

#action-section button {
     padding: 10px 15px;
    background-color: #6f42c1; /* Purple */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
}

#action-section button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

#action-section button:hover:not(:disabled) {
    background-color: #5a32a3;
}


/* Step-by-Step UI Flow Styles */
.nav-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 1em;
}

.nav-btn:hover {
    background-color: #5a6268;
}

/* Always visible button style */
.fixed-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1001; /* Ensure it's above other elements, including fullscreen overlay */
    background-color: #dc3545 !important; /* Use red like delete */
    color: white;
    border: none;
    border-radius: 4px;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 1em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.fixed-btn:hover {
    background-color: #c82333 !important;
}


/* Fullscreen Preview Styles */
#fullscreen-preview {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #fff;
    z-index: 1000;
}

#fullscreen-iframe {
    width: 100%;
    height: calc(100% - 60px); /* Account for overlay controls */
    border: none;
}

.overlay-controls {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background-color: #343a40;
}

.overlay-controls button {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    color: white;
}

#exit-fullscreen-btn {
    background-color: #6c757d;
}

#exit-fullscreen-btn:hover {
    background-color: #5a6268;
}

#save-fullscreen-btn {
    background-color: #28a745;
}

#save-fullscreen-btn:hover {
    background-color: #218838;
}

/* Progress Indicator */
.step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.step {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #e9ecef;
    margin: 0 5px;
    position: relative;
}

.step.active {
    background-color: #007bff;
}

.step.completed {
    background-color: #28a745;
}

.step::after {
    content: '';
    position: absolute;
    top: 9px;
    left: 20px;
    width: 100%;
    height: 2px;
    background-color: #e9ecef;
}

.step:last-child::after {
    display: none;
}

.step.completed::after {
    background-color: #28a745;
}
