:root {
  --primary-color: #007aff; /* macOS Blue */
  --secondary-color: #5ac8fa; /* Light Blue */
  --background-color: #f0f0f5; /* Light Gray */
  --text-color: #000; /* Black */
  --border-color: #d1d1d1; /* Light Border */
  --button-color: #007aff; /* macOS Blue */
  --button-hover-color: #005bb5; /* Darker Blue */
  --input-background-color: #ffffff; /* White */
  --input-text-color: #000; /* Black */
  --console-background-color: #f7f7f7; /* Light Gray */
  --console-text-color: #000; /* Black */
  --glow-color: rgba(0, 122, 255, 0.5); /* Glow effect color */
  --shadow-color: rgba(0, 0, 0, 0.2); /* Shadow effect color */
}

/* General Styles */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  margin: 0;
  padding: 0;
}

/* New Layout Styles */
.main-layout {
  display: flex;
  min-height: 100vh;
  background-color: var(--background-color);
}

.left-sidebar {
  width: 300px;
  background-color: var(--box-color);
  border-right: 1px solid var(--border-color);
  padding: 12px;
  overflow-y: auto;
  max-height: 100vh;
}

.main-content {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  max-height: 100vh;
}

.right-sidebar {
  width: 250px;
  background-color: var(--box-color);
  border-left: 1px solid var(--border-color);
  padding: 20px;
  overflow-y: auto;
  max-height: 100vh;
}

.sidebar-block {
  margin-bottom: 8px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
}

.sidebar-block-header {
  background-color: var(--button-color);
  color: white;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  transition: background-color 0.3s ease;
  font-size: 14px;
}

.sidebar-block-header:hover {
  background-color: var(--button-hover-color);
}

.sidebar-block-content {
  padding: 10px;
  display: none;
  background-color: white;
  box-sizing: border-box;
  overflow: hidden;
}

.sidebar-block-content.active {
  display: block;
}

.sidebar-block-header .toggle-icon {
  transition: transform 0.3s ease;
  font-size: 12px;
}

.sidebar-block-header.active .toggle-icon {
  transform: rotate(180deg);
}

.main-content-section {
  display: none;
  background-color: var(--box-color);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.main-content-section.active {
  display: block;
}

.right-sidebar-section {
  background-color: var(--box-color);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 12px;
}

.right-sidebar-section h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.1em;
}

.right-sidebar-section p {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 0.9em;
}

.logo-section {
  text-align: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.logo-section img {
  width: 80px;
  height: 80px;
}

@media (max-width: 1024px) {
    .main-layout {
        flex-direction: column;
    }
  
  .left-sidebar, .right-sidebar {
    width: 100%;
    max-height: none;
  }
  
  .left-sidebar {
    order: 1;
  }
  
  .main-content {
    order: 2;
  }
  
  .right-sidebar {
    order: 3;
  }
}

/* Responsive layout for Agent/Adapters tab */
@media (max-width: 768px) {
    #agentAdapters .tab-content-inner > div[style*="display: flex"] {
        flex-direction: column !important;
    }
    
    #agentAdapters .config-group {
        width: 100% !important;
    }
}

/* Adapter Preview Layout */
.adapter-preview-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 20px;
    min-height: 600px;
}

.adapter-list-panel {
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 250px);
}

.adapter-list-panel h3 {
    margin: 0 0 15px 0;
    color: var(--button-color);
    font-size: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--button-color);
}

.adapters-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.adapter-card {
    background-color: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.adapter-card:hover {
    border-color: var(--button-color);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.15);
    transform: translateY(-2px);
}

.adapter-card.selected {
    border-color: var(--button-color);
    background-color: rgba(0, 122, 255, 0.1);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
}

.adapter-card-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.adapter-card-content {
    flex: 1;
    min-width: 0;
}

.adapter-card-name {
    font-size: 15px;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 4px;
}

.adapter-card-description {
    font-size: 12px;
    color: #666;
    line-height: 1.3;
}

/* Preview Panel */
.adapter-preview-panel {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 250px);
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #999;
}

.preview-placeholder-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.preview-placeholder h3 {
    color: #666;
    margin-bottom: 10px;
}

.preview-placeholder p {
    color: #999;
    font-size: 14px;
}

.preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--button-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.preview-loading p {
    color: #666;
    font-size: 14px;
}

.preview-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.preview-error-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.preview-error h3 {
    color: #dc3545;
    margin-bottom: 10px;
}

.preview-error p {
    color: #666;
    font-size: 14px;
}

/* Preview Content */
.preview-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
}

.preview-header h3 {
    color: var(--button-color);
    margin: 0 0 10px 0;
    font-size: 24px;
}

.preview-description {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.preview-sections {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.preview-section {
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

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

.preview-section-header h4 {
    color: var(--button-color);
    margin: 0;
    font-size: 18px;
}

.preview-section-meta {
    color: #666;
    font-size: 12px;
    font-style: italic;
}

.preview-code-container,
.preview-states-container {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.preview-code,
.preview-states {
    margin: 0;
    padding: 15px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    max-height: 500px;
    overflow-y: auto;
}

.preview-code code,
.preview-states code {
    color: #333;
}

.preview-states-info {
    margin-top: 10px;
    color: #666;
    font-size: 12px;
    font-style: italic;
    text-align: right;
}

.preview-error-message {
    padding: 15px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
}

.preview-error-message p {
    margin: 0;
    color: #856404;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 1024px) {
    .adapter-preview-layout {
        grid-template-columns: 1fr;
    }
    
    .adapter-list-panel,
    .adapter-preview-panel {
        max-height: none;
    }
}

.container {
  max-width: 1250px;
  margin: 0 auto;
  padding: 5px;
}

.header {
  background-color: var(--primary-color);
  color: var(--background-color);
  padding: 20px;
  text-align: center;
  border-radius: 8px;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.box {
  background-color: var(--input-background-color);
  border-radius: 8px;
  box-shadow: 0 4px 6px var(--shadow-color);
  padding: 20px;
  transition: all 0.3s ease;
}

h1, h2 {
  margin-top: 0;
}

#userInput {
  width: 95%;
  height: 100px;
  background-color: var(--input-background-color);
  color: var(--input-text-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 10px;
  font-size: 14px;
  resize: vertical;
}

#consoleOutput {
  background-color: var(--console-background-color);
  color: var(--console-text-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 10px;
  height: 100px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 14px;
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  background-color: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-bar-fill {
  height: 20px;
  background-color: var(--button-color);
  width: 0;
  transition: width 0.3s;
}

/* Button */
button {
  background-color: var(--button-color);
  color: var(--input-background-color);
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

button:hover {
  background-color: var(--button-hover-color);
  transform: scale(1.05);
}

button:disabled {
  background-color: #95a5a6;
  cursor: not-allowed;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

#retryBtn, #submitBtn, #confirmationBlock button {
  box-shadow: 0 0 10px var(--glow-color);
}

#retryBtn:hover, #submitBtn:hover, #confirmationBlock button:hover {
  box-shadow: 0 0 20px var(--glow-color);
}

.button-group {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  gap: 6px;
}

#confirmationBlock {
  margin-top: 20px;
  text-align: center;
}

#confirmationBlock button {
  margin: 0 10px;
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.tab-btn {
  background-color: transparent;
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
  color: var(--text-color);
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tab-btn:hover {
  background-color: var(--input-background-color);
  color: var(--secondary-color);
}

.tab-btn.active {
  border-bottom: 2px solid var(--button-color);
  font-weight: bold;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Static Text in Tab Bar */
.tab-text {
  align-self: center;
  font-size: 16px;
  color: var(--text-color);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-left: auto;
}

/* Input and Console Sections */
.input-console-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.input-section, .console-section, .image-section {
  flex: 1 1 45%;
  background-color: var(--input-background-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 4px var(--shadow-color);
}

/* Input Field */
input[type="text"] {
  width: 100%;
  padding: 10px;
  background-color: var(--input-background-color);
  color: var(--input-text-color);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 16px;
  margin-bottom: 20px;
}

.image-section {
  grid-column: span 2;
  text-align: center;
}

.results-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.result-box {
  background-color: var(--input-background-color);
  border-radius: 8px;
  box-shadow: 0 2px 4px var(--shadow-color);
  padding: 15px;
}

.result-box img {
  max-width: 100%;
  height: auto;
}

/* Tooltip Styles */
.select-container label[title],
.training-params label[title],
input[type="checkbox"] + label[title],
label[title][for] {
  position: relative;
  cursor: help;
  padding-left: 20px;
  padding-right: 0;
}
.select-container label[title]::before,
.training-params label[title]::before,
input[type="checkbox"] + label[title]::before,
label[title][for]::before {
  content: '\2753'; /* Unicode for circled question mark */
  position: absolute;
  left: 4px;
  top: 25%;
  transform: translateY(-50%);
  font-size: 10px;
  color: #888;
  margin-right: 8px;
  pointer-events: none;
}
.select-container label[title]:hover::before,
.training-params label[title]:hover::before,
input[type="checkbox"] + label[title]:hover::before,
label[title][for]:hover::before {
  color: var(--primary-color);
}

@media (max-width: 768px) {
  .input-console-container {
      flex-direction: column;
  }

  .input-section, .console-section, .image-section {
      flex: 1 1 100%;
  }
}

/* Real-time Render Display */
#realTimeRenderDisplay {
    margin-top: 20px;
    padding: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    text-align: center;
    box-shadow: 0 4px 8px var(--shadow-color);
    transition: all 0.3s ease;
    display: none;
}

#realTimeRenderDisplay:hover {
    box-shadow: 0 6px 12px var(--shadow-color);
    transform: translateY(-2px);
}

#realTimeRenderPhaseTitle {
    color: var(--primary-color);
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#realTimeRenderImage {
    max-width: 100%;
    max-height: 800px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-color);
    margin: 10px 0;
    transition: all 0.3s ease;
}

/* #realTimeRenderImage:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 8px var(--shadow-color);
} */

#realTimeRenderStatus {
    color: var(--text-color);
    font-style: italic;
    margin: 10px 0;
    padding: 8px;
    background-color: rgba(0, 122, 255, 0.1);
    border-radius: 4px;
    border-left: 4px solid var(--primary-color);
}

#realTimeRenderCarousel {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
    max-height: 1000px;
    overflow-y: auto;
    padding: 10px;
}

#realTimeRenderCarousel > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-color);
    transition: all 0.3s ease;
    min-width: 200px;
    max-width: 700px;
}

/* #realTimeRenderCarousel > div:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color);
} */

#realTimeRenderCarousel img {
    max-width: 100%;
    max-height: 500px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 5px;
    transition: all 0.3s ease;
}

/* #realTimeRenderCarousel img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px var(--shadow-color);
} */

#realTimeRenderCarousel p {
    font-size: 12px;
    color: var(--text-color);
    margin: 0;
    font-weight: bold;
    text-align: center;
    word-wrap: break-word;
    max-width: 100%;
}

/* Loading Circle Styles */
.loading-circle {
    border: 8px solid var(--border-color);
    border-top: 8px solid var(--button-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    display: none;
    margin-left: 10px;
}

.loading-circle-left {
    margin-right: 10px;
    margin-left: 0;
}

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

/* Loading Overlay Styles */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

#loadingOverlay .loading-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 300px;
    width: 90%;
}

#loadingOverlay .loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--button-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px auto;
}

#loadingOverlay .loading-message {
    margin: 0;
    color: var(--text-color);
    font-size: 16px;
    font-weight: 500;
}

/* Training Parameters Styles */
.training-params {
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.training-params input {
    width: 100px;
    padding: 5px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.training-params label {
  color: var(--text-color);
  font-weight: bold;
  font-size: 12px;
}

/* Form Select Styles */
.form-select {
    width: 200px;
    padding: 5px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: white;
    color: var(--text-color);
}

/* Applications Checklist Styles */
.applications-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.application-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.application-item input[type="checkbox"] {
    margin: 0;
}

.application-item label {
  color: var(--text-color);
  font-size: 12px;
}

/* Config Section Styles */
.config-section {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.config-group {
  border: 1px solid var(--border-color);
  padding: 8px;
  border-radius: 4px;
  margin-bottom: 8px;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.config-group h3 {
  margin-top: 0;
  color: var(--text-color);
  font-size: 1em;
  margin-bottom: 8px;
}

/* Select Container Styles */
.select-container {
  margin-bottom: 8px;
}

.select-container label {
  display: block;
  margin-bottom: 3px;
  color: var(--text-color);
  font-weight: bold;
  font-size: 12px;
}

.select-container select {
  width: 100%;
  padding: 6px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: white;
  color: var(--text-color);
  font-size: 12px;
}

.select-container select:focus {
    outline: none;
    border-color: var(--button-color);
}

/* Checkbox Container Styles */
.checkbox-container {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.checkbox-container input[type="checkbox"] {
    margin: 0;
}

.checkbox-container label {
  color: var(--text-color);
  font-size: 12px;
  margin: 0;
}

/* Agent Parameters Styles */
.agent-params {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  box-sizing: border-box;
}

.agent-adapter-group {
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: #f9f9f9;
}

.agent-adapter-group h4 {
  margin-top: 0;
  margin-bottom: 6px;
  color: var(--text-color);
  font-size: 0.9em;
}

.adapter-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Interface Guide Styles */
#interfaceGuideContent {
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 5px;
}

#interfaceGuideContent h1,
#interfaceGuideContent h2,
#interfaceGuideContent h3,
#interfaceGuideContent h4 {
    color: var(--text-color);
    margin-top: 15px;
    margin-bottom: 10px;
}

#interfaceGuideContent h1 {
    font-size: 1.4em;
    border-bottom: 2px solid var(--button-color);
    padding-bottom: 5px;
}

#interfaceGuideContent h2 {
    font-size: 1.2em;
    color: var(--button-color);
}

#interfaceGuideContent h3 {
    font-size: 1.1em;
}

#interfaceGuideContent p {
    margin-bottom: 10px;
    line-height: 1.4;
}

#interfaceGuideContent ul,
#interfaceGuideContent ol {
    margin-bottom: 10px;
    padding-left: 20px;
}

#interfaceGuideContent li {
    margin-bottom: 5px;
    line-height: 1.3;
}

#interfaceGuideContent code {
    background-color: #f4f4f4;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

#interfaceGuideContent pre {
    background-color: #f4f4f4;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 10px 0;
}

#interfaceGuideContent blockquote {
    border-left: 4px solid var(--button-color);
    margin: 10px 0;
    padding-left: 15px;
    color: #666;
}

/* Loading and Error Message Styles */
.loading-message {
    text-align: center;
    padding: 20px;
    color: #666;
}

.error-message {
    padding: 10px;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    color: #856404;
}

/* Application Overview Styles */
.applications-overview {
    padding: 10px 0;
}

.applications-overview h3 {
    color: var(--button-color);
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-color);
}

/* Overview Layout - Side by Side */
.overview-layout {
    display: grid;
    grid-template-columns: 30% 70%;
    gap: 30px;
    margin-bottom: 20px;
}

.applications-section {
    min-height: 400px;
}

.configuration-section {
    min-height: 400px;
}

/* Compact Application Grid */
.app-grid-compact {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 600px;
    overflow-y: auto;
    padding: 5px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--input-background-color);
}

.app-card-compact {
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 1px 3px var(--shadow-color);
    transition: all 0.3s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.app-card-compact:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px var(--shadow-color);
    border-color: var(--button-color);
}

.app-card-compact.selected {
    border-color: var(--button-color);
    background-color: rgba(0, 122, 255, 0.1);
    box-shadow: 0 2px 6px var(--shadow-color);
}

.app-card-compact h4 {
    margin: 0 0 8px 0;
    color: var(--button-color);
    font-size: 1em;
    font-weight: bold;
}

.app-card-compact.selected h4 {
    color: var(--button-color);
}

.app-details-compact {
    font-size: 0.8em;
    line-height: 1.3;
}

.app-details-compact p {
    margin: 3px 0;
    color: var(--text-color);
}

/* Configuration Selection Compact */
.config-selection-compact {
    padding: 15px;
    background-color: var(--input-background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-color);
}

.config-selection-compact .config-selection-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.config-selection-compact .config-selection-card {
    padding: 12px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 1px 3px var(--shadow-color);
}

.config-selection-compact .config-selection-card h4 {
    margin: 0 0 8px 0;
    color: var(--button-color);
    font-size: 0.9em;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .overview-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .applications-section,
    .configuration-section {
        min-height: auto;
    }
}

/* Original Grid Styles (kept for backward compatibility) */
.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.app-card {
    background-color: var(--input-background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px var(--shadow-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

.app-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color);
    border-color: var(--button-color);
}

.app-card.selected {
    border-color: var(--button-color);
    background-color: rgba(0, 122, 255, 0.1);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.app-card h4 {
    margin: 0 0 10px 0;
    color: var(--button-color);
    font-size: 1.1em;
}

.app-card.selected h4 {
    color: var(--button-color);
}

.app-details {
    font-size: 0.9em;
    line-height: 1.4;
}

.app-details p {
    margin: 5px 0;
    color: var(--text-color);
}

/* Configuration Selection Styles */
.config-selection {
    margin-top: 20px;
    padding: 15px;
    background-color: var(--input-background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.config-selection h5 {
    margin: 0 0 15px 0;
    color: var(--button-color);
    font-size: 1.1em;
}

.config-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.config-button {
    background-color: var(--button-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}

.config-button:hover {
    background-color: var(--button-hover-color);
}

.config-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.config-dropdown {
    display: none;
    margin-top: 10px;
    padding: 10px;
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

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

.config-dropdown select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: white;
    color: var(--text-color);
    font-size: 0.9em;
}

.config-dropdown label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-color);
    font-weight: bold;
    font-size: 0.9em;
}

.config-dropdown p {
    margin: 5px 0;
    color: var(--text-color);
    font-size: 0.9em;
}

.config-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.config-actions button {
    padding: 6px 12px;
    font-size: 0.8em;
}

.config-actions .apply-btn {
    background-color: var(--button-color);
    color: white;
}

.config-actions .cancel-btn {
    background-color: #6c757d;
    color: white;
}

/* Button-based Configuration Selection Styles */
.config-option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.config-option-button {
    background-color: var(--input-background-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
}

.config-option-button:hover {
    border-color: var(--button-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.config-option-button.selected {
    border-color: var(--button-color);
    background-color: rgba(0, 123, 255, 0.1);
}

.config-option-button.selected::after {
    content: "✓";
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--button-color);
    font-weight: bold;
    font-size: 1.2em;
}

.config-option-title {
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 8px;
    font-size: 1.1em;
}

.config-option-description {
    color: var(--text-color);
    font-size: 0.9em;
    line-height: 1.4;
    margin-bottom: 5px;
}

.config-option-meta {
    color: #666;
    font-size: 0.8em;
    font-style: italic;
}

/* Overview Configuration Styles */
.config-option-btn {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: white;
    color: var(--text-color);
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    margin: 2px;
}

.config-option-btn:hover {
    border-color: var(--button-color);
    background-color: #f8f9fa;
}

.config-option-btn.selected {
    background-color: var(--button-color);
    border-color: var(--button-color);
    color: white;
}

.config-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.config-selection-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    background-color: var(--input-background-color);
}

.config-selection-card h4 {
    margin: 0 0 15px 0;
    color: var(--button-color);
}

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

.config-section-title {
    color: var(--button-color);
    margin: 0;
    font-size: 1.2em;
}

.config-clear-btn {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    cursor: pointer;
}

.config-clear-btn:hover {
    background-color: #c82333;
}

.no-options-message {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
    background-color: var(--input-background-color);
    border-radius: 4px;
    margin-top: 10px;
}

.download-btn {
    background-color: var(--button-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.download-btn:hover {
    background-color: var(--button-hover-color);
}

/* Selected Application Details Styles */
#selectedApplicationDetails {
    margin-top: 30px;
    padding: 20px;
    background-color: var(--input-background-color);
    border: 2px solid var(--button-color);
    border-radius: 8px;
    box-shadow: 0 4px 8px var(--shadow-color);
}

#selectedApplicationDetails h3 {
    color: var(--button-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

#selectedApplicationDetails h4 {
    color: var(--text-color);
    margin-bottom: 15px;
    font-size: 1.3em;
}

#selectedApplicationDetails h5 {
    color: var(--button-color);
    margin: 20px 0 10px 0;
    font-size: 1.1em;
}

.prerender-image-section {
    margin-bottom: 20px;
}

.prerender-image {
    max-width: 100%;
    max-height: 400px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 2px 4px var(--shadow-color);
    margin: 10px 0;
}

.readme-section {
    margin-bottom: 20px;
}

.readme-content {
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
    max-height: 500px;
    overflow-y: auto;
}

.readme-content h1,
.readme-content h2,
.readme-content h3,
.readme-content h4,
.readme-content h5,
.readme-content h6 {
    color: var(--button-color);
    margin: 15px 0 10px 0;
    font-weight: bold;
}

.readme-content h1 {
    font-size: 1.4em;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 5px;
}

.readme-content h2 {
    font-size: 1.2em;
}

.readme-content h3 {
    font-size: 1.1em;
}

.readme-content p {
    margin: 10px 0;
    line-height: 1.5;
}

.readme-content code {
    background-color: #e9ecef;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.readme-content pre {
    background-color: #e9ecef;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    margin: 10px 0;
    overflow-x: auto;
}

.readme-content pre code {
    background-color: transparent;
    padding: 0;
}

.readme-content a {
    color: var(--button-color);
    text-decoration: none;
}

.readme-content a:hover {
    text-decoration: underline;
}

.readme-content strong {
    font-weight: bold;
}

.readme-content em {
    font-style: italic;
}

/* Results Tab Styles */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.results-header h3 {
    color: var(--button-color);
    margin: 0;
}

.refresh-results-btn {
    background-color: var(--button-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.refresh-results-btn:hover {
    background-color: var(--button-hover-color);
}

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

.variance-result-card {
    background-color: var(--input-background-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px var(--shadow-color);
    transition: all 0.3s ease;
}

.variance-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.variance-result-card h4 {
    color: var(--button-color);
    margin: 0 0 10px 0;
    font-size: 1.1em;
}

.variance-result-card img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin: 10px 0;
}

.variance-result-info {
    font-size: 0.9em;
    color: var(--text-color);
    margin: 5px 0;
}

.no-results-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

/* Input Group Styles */
.input-group {
    margin-bottom: 15px;
    width: 100%;
    box-sizing: border-box;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-color);
    font-weight: bold;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.input-group input, .input-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: white;
    color: var(--text-color);
    box-sizing: border-box;
    max-width: 100%;
}

.input-group input:focus, .input-group textarea:focus {
    outline: none;
    border-color: var(--button-color);
}

.input-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Tab Navigation Styles */
.tab-navigation {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
    background-color: var(--box-color);
    border-radius: 8px 8px 0 0;
    padding: 0;
}

.tab-btn {
    background-color: transparent;
    border: none;
    padding: 15px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-color);
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px 8px 0 0;
    margin-right: 2px;
}

.tab-btn:hover {
    background-color: var(--input-background-color);
    color: var(--button-color);
}

.tab-btn.active {
    background-color: var(--button-color);
    color: white;
    border-bottom: 2px solid var(--button-color);
}

.tab-content {
    display: none;
    background-color: var(--box-color);
    border-radius: 0 0 8px 8px;
    padding: 0;
    margin-bottom: 20px;
}

.tab-content.active {
    display: block;
}

.tab-content-inner {
    padding: 20px;
}

/* Inline Styles for Specific Elements */
.button-group-margin-bottom {
    margin-bottom: 15px;
}

.update-status {
    margin-bottom: 15px;
    display: none;
}

.application-info {
    margin-top: 10px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 4px;
    display: none;
}

.import-config-file {
    display: none;
}

.config-group-margin-bottom {
    margin-bottom: 20px;
}

.instructions-observed-states-info {
    margin-top: 10px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 4px;
    display: none;
}

.instructions-observed-states-preview {
    margin-top: 10px;
    display: none;
}

.preview-text {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 8px;
}

.preview-content {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 12px;
    font-size: 0.85em;
    color: #333;
    overflow-x: auto;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.retry-btn-hidden {
    display: none;
}

.config-group-margin-top {
    margin-top: 20px;
}

.confirmation-block-hidden {
    display: none;
}

.train-model-btn {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: bold;
}

.training-status {
    margin-top: 15px;
    display: none;
}

.input-group-margin-bottom {
    margin-bottom: 10px;
}

.preset-label {
    font-size: 12px;
    margin-bottom: 5px;
}

.preset-select {
    width: 100%;
    padding: 8px;
    font-size: 12px;
}

.preset-description {
    margin-bottom: 10px;
    font-style: italic;
    color: #666;
    font-size: 11px;
}

.button-group-flex {
    display: flex;
    gap: 5px;
}

.load-preset-btn {
    flex: 1;
    padding: 8px;
    font-size: 12px;
}

.clear-preset-btn {
    display: none;
    flex: 1;
    padding: 8px;
    font-size: 12px;
}

.app-flex {
    flex: 1;
}

.app-name {
    font-size: 12px;
    color: #666;
}

.github-link {
    color: #0366d6;
    text-decoration: none;
    font-size: 12px;
    margin-left: 8px;
}

.update-btn {
    padding: 4px 8px;
    font-size: 12px;
}

.download-btn-small {
    padding: 4px 8px;
    font-size: 12px;
}

/* Ollama Model Refresh Button */
.ollama-refresh-btn {
    background-color: var(--button-color);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.ollama-refresh-btn:hover {
    background-color: var(--button-hover-color);
}

.ollama-refresh-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.llm-model-container {
    display: flex;
    gap: 5px;
    align-items: center;
}

.llm-model-container select {
    flex: 1;
}

/* Ollama Status Message */
.ollama-status-message {
    margin-bottom: 15px;
}

/* Disabled LLM Controls */
.llm-model-container select:disabled,
input[type="checkbox"]:disabled + label,
input[type="number"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f8f9fa;
    color: #6c757d;
}

.llm-model-container select:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
}

input[type="checkbox"]:disabled + label {
    color: #6c757d;
    cursor: not-allowed;
}

.ollama-refresh-btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Slider Styles for Q-Learning Parameters */
.slider-container {
    display: flex;
    flex-direction: column;
    gap: 0px;
    margin-bottom: 8px;
    width: 100%;
    box-sizing: border-box;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
}

.slider-label-text {
    color: var(--text-color);
    font-weight: bold;
    font-size: 12px;
    flex: 1;
    margin-right: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.slider-value {
    color: var(--button-color);
    font-weight: bold;
    font-size: 12px;
    background-color: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid var(--border-color);
    min-width: 40px;
    max-width: 50px;
    text-align: center;
    flex-shrink: 0;
}

.slider-wrapper {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

.slider-input {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--button-color);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.slider-input::-webkit-slider-thumb:hover {
    background: var(--button-hover-color);
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.slider-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--button-color);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.slider-input::-moz-range-thumb:hover {
    background: var(--button-hover-color);
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.slider-input::-webkit-slider-track {
    background: linear-gradient(to right, var(--button-color) 0%, var(--button-color) var(--slider-progress, 0%), #ddd var(--slider-progress, 0%), #ddd 100%);
    height: 6px;
    border-radius: 3px;
}

.slider-input::-moz-range-track {
    background: #ddd;
    height: 6px;
    border-radius: 3px;
    border: none;
}

.slider-input::-moz-range-progress {
    background: var(--button-color);
    height: 6px;
    border-radius: 3px;
}

.slider-ticks {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    font-size: 10px;
    color: #666;
    width: 100%;
    box-sizing: border-box;
    padding: 0;
}

.slider-tick {
    text-align: center;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* Sidebar Divider */
.sidebar-divider {
    border: none;
    border-top: 2px solid var(--button-color);
    margin: 15px 0 0 0;
    opacity: 0.3;
}

/* Social Media Links */
.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 10px;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--button-color);
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.social-link:hover {
    background-color: var(--button-hover-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

