/* Basic Resets */
html{
  height:100%;
}

body {
  display:flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: Arial, sans-serif;
  height:100%;
  background-color: #f0f0f0;
  font-weight: 100;
  color: black;
  position: relative;
}

.brainstormer-content{
  display: flex;
  margin: 0;
  padding: 0;
  height: 100vh;
}
/* Layout Components */
#map-container {
  flex: 2;
  height: 100%;
  border-right: 1px solid var(--border-color-grey);
  position: relative;
  overflow: hidden;
  background-color: white;
}

#sidebar {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: #f8f8f8;
  max-width: 100%;
  width:500px;
  transition: transform 0.3s, opacity 0.3s ease;
  position: absolute;
  top:0;
  right:0;
  z-index:1000;
}

#toggle-btn{
    aspect-ratio: 1;
    height: 50px;
    font-size:x-large;
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 12px 24px;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    align-self: flex-start;
    display:flex;
    position:absolute;
    align-items:center;
    right:20px;
    top:20px;
    justify-content: center;
}

#toggle-btn-text{
  transform:rotate(180deg)
}

#toggle-btn-sidebar {
    margin-left:20px;
    margin-right:20px;
    margin-top:20px;
    aspect-ratio: 1;
    height: 50px;
    font-size:x-large;
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 12px 24px;
    margin-top: 1rem;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    align-self: flex-start;
    display:flex;
    align-items:center;
}

#sidebar.collapsed {
  transform: translateX(100%);
  pointer-events: none; /* Prevent interaction with the hidden sidebar */
}

#sidebar.hidden {
    display: none; /* Completely hide the sidebar after moving out */
}

#input-container,
#info-container {
  padding: 20px;
  display: flex;
  flex-direction: column;
}

#info-container {
  flex: 1 1 auto;
  overflow: hidden;
}

/* Header Styles */
h2 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #444;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.header-text i {
  margin-right: 10px;
  color: #4CAF50;
}

.icon-container {
  display: flex;
  align-items: center;
}

/* Navigation and Controls */
.top-buttons {
  position: fixed;
  top: 20px;
  left: 20px;
  display: flex;
  gap: 10px;
  z-index: 1000;
}

.top-buttons a {
  text-decoration: none;
  font-size: 14px;
  padding: 5px 12px;
  border: 1px solid black;
  border-radius: 4px;
  display: flex;
  align-items: center;
}

.node-contextmenu {
  position: absolute;
  width: auto;
  height: auto;
  display: flex;
  flex-direction:column
}
.node-contextmenu > button{
    color: black;
}
.node-contextmenu > button:hover{
  cursor: pointer;
}
.addnode-dialog{
  z-index: 1002;
  position:absolute;
  top: 50%; /* 50% from the top */
  left: 50%; /* 50% from the left */
  transform: translate(-50%, -50%); /* Center the element */
  padding: 20px; /* Optional padding */
  background-color: #f8f8f8;
  color: black;
  width: auto;
  height: auto
}

.addnode-textarea{
  min-width: 600px;
  min-height: 150px;
  position: relative;
  margin-bottom: 10px
}
.addnode-submit-btn{
  position: absolute;
  bottom: 0;
  right: 95px;
  background-color: #4CAF50;
  border-color:#4CAF50;
  border-radius: 4px;
  color:white;
  height: 25px;
  width: 70px;
}
.addnode-submit-btn:hover{
  cursor: pointer;
}
.addnode-cancel-btn:hover{
  cursor: pointer;
}
.addnode-cancel-btn{
  position: absolute;
  bottom: 0;
  right: 20px;
  color:white;
  border-radius: 4px;
  background-color: red;
  height: 25px;
  border-color: red;
  width: 70px;
}
.logout-button {
  color: #007bff;
  border-color: #007bff;
  background-color: #fff;
}

.logout-button:hover {
  background-color: #007bff;
  color: #fff;
}

.feedback-button {
  color: #fff;
  background-color: #28a745;
  border-color: #28a745;
}

.feedback-button:hover {
  background-color: #218838;
  border-color: #1e7e34;
}

.feedback-button .feedback-icon {
  margin-right: 8px;
}

.admin-button{
  color: black;
  border-color: black;
  background-color: #fff;
}
.admin-button:hover {
  background-color: #aaa;
}


/* Loading Spinner */
.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
}

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

/* File Upload Area */
.upload-container {
  position: relative;
  border: 2px dashed #e0e0e0;
  border-radius: 6px;
  background-color: #fff;
  transition: border-color 0.3s ease;
  margin-bottom: 20px;
  min-height: 150px;
}

.upload-container.drag-over {
  border-color: #4CAF50;
}

.process-textarea {
  width: 100%;
  min-height: 150px;
  padding: 15px;
  border: none;
  resize: vertical;
  font-size: 16px;
  line-height: 1.5;
  background: transparent;
  position: relative;
  z-index: 2;
}

.process-textarea::placeholder {
  color: #888;
  font-size: 16px;
}

.process-textarea:focus {
  outline: none;
}

/* Upload Instructions and Feedback */
.overlay-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  background-color: transparent;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 3;
  opacity: 1;
  visibility: visible;
  pointer-events: none;
}

.process-textarea:not(:placeholder-shown) + .overlay-placeholder {
  opacity: 0;
  visibility: hidden;
}

.process-textarea:placeholder-shown ~ .generate-btn {
  opacity: 0;
  visibility: hidden;
}

.upload-instructions {
  color: #999;
  transform: translateY(20px);
}

.upload-icon {
  font-size: 20px;
  margin-bottom: 8px;
  opacity: 0.5;
  pointer-events: none;
}

.drag-drop-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  pointer-events: none;
  color: #999;
}

.browse-text {
  margin: 4px 0 0 0;
  font-size: 13px;
  line-height: 1.4;
  pointer-events: none;
  color: #999;
}

.browse-link {
  color: #4CAF50;
  text-decoration: none;
  pointer-events: auto;
  cursor: pointer;
  display: inline-block;
  padding: 2px 4px;
  position: relative;
  z-index: 4;
  font-weight: 500;
}

.browse-link:hover {
  text-decoration: underline;
}

/* File Preview */
.file-preview-overlay {
  position: absolute;
  inset: 0;
  background: white;
  border-radius: 6px;
  overflow: hidden;
  z-index: 4;
  display: none;
}

.file-preview-overlay img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.file-preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.file-preview-remove:hover {
  background: #f0f0f0;
}

.file-preview-filename {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.5);
  color: white;
  padding: 8px 12px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Graph Visualization */
.sub-node-group {
  cursor: pointer;
}

.link {
  stroke: #999;
  stroke-opacity: 0.6;
}

.node-group text {
  pointer-events: none;
  text-shadow: 0 1px 0 #fff,
               1px 0 0 #fff,
               0 -1px 0 #fff,
               -1px 0 0 #fff;
}

.node-tooltip {
  position: absolute;
  text-align: left;
  width: 200px;
  padding: 10px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-color-grey);
  border-radius: 5px;
  pointer-events: none;
  z-index: 10;
  display: none;
}

/* Workarounds List */
#workarounds-list {
  flex: 1 1 auto;
  overflow-y: auto;
  list-style-type: none;
  margin: 0;
  padding: 0;
}

#workarounds-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.workaround-item {
  margin: 2px 0;
  padding: 0;
  list-style: none;
}

.workaround-card {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 10px;
}

.workaround-card:hover {
  border-color: #4CAF50;
  box-shadow: 0 2px 6px rgba(76, 175, 80, 0.2);
}

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

.expand-icon {
  margin-right: 10px;
  cursor: pointer;
  color: #4CAF50;
  font-size: 16px;
}

.workaround-text {
  flex: 1;
  font-size: 14px;
  color: #333;
  cursor: pointer;
}

.nested {
  display: none;
  margin-top: 5px;
  margin-left: 5px;
}

.active > .workaround-card > .nested {
  display: block;
}

/* Selected States */
.selected {
  border-color: #4CAF50;
  background-color: #e8f5e9;
}

/* Download Button */
.download-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: #888;
  text-decoration: none;
}

.download-icon:hover {
  color: #45a049;
}

/* App Controls */
#start-button {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  margin-top: 1rem;
  cursor: pointer;
  border-radius: 25px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  align-self: flex-start;
}

#start-button:hover {
  background-color: #45a049;
  transform: translateY(-2px);
}

#instructions {
  position: absolute;
  bottom: 10px;
  left: 10px;
  font-size: 12px;
  color: #999;
  pointer-events: none;
  background-color: rgba(255, 255, 255, 0.8);
  padding: 5px;
  border-radius: 4px;
}

#app-version {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #999;
  text-align: center;
  pointer-events: none;
}

/* Settings Panel */
#settings-icon {
  cursor: pointer;
  font-size: 18px;
  color: #888;
  transition: color 0.3s;
}

#settings-icon:hover {
  color: #4CAF50;
}

#expert-panel {
  display: none;
  margin-top: 20px;
}
/* File Upload Alert */
.file-upload-alert {
  display: none;
  padding: 8px 12px;
  margin-bottom: 15px;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.4;
  transition: all 0.3s ease;
}

.file-upload-alert.error {
  background-color: #fee2e2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.file-upload-alert.success {
  background-color: #dcfce7;
  border: 1px solid #bbf7d0;
  color: #15803d;
}

/* Login Page Styles */
.container {
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.row {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-group {
  margin-bottom: 1.5rem;
}

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

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 4px;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn {
  display: inline-block;
  font-weight: 400;
  text-align: center;
  vertical-align: middle;
  user-select: none;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 4px;
  transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out,
              border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.btn-primary {
  color: #fff;
  background-color: #4CAF50;
  border: none;
  width: 100%;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: #45a049;
}

/* Alert Styles */
.alert {
  position: relative;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 4px;
}

.alert-danger {
  color: #721c24;
  background-color: #f8d7da;
  border-color: #f5c6cb;
}

.alert-warning {
  color: #856404;
  background-color: #fff3cd;
  border-color: #ffeeba;
}

.alert-success {
  color: #155724;
  background-color: #d4edda;
  border-color: #c3e6cb;
}

.alert-dismissible {
  padding-right: 4rem;
}

.alert-dismissible .close {
  position: absolute;
  top: 0;
  right: 0;
  padding: 1rem;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

/* Login page specific layout */
#login {
  color: #333;
  margin-bottom: 2rem;
  font-size: 2rem;
  font-weight: 500;
}

.context-hint {
  background-color: #fff3cd;
  border: 1px solid #ffeeba;
  border-radius: 4px;
  padding: 12px 15px;
  margin: 10px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #856404;
  animation: fadeIn 0.5s ease-in-out;
}

.context-hint i.fa-lightbulb {
    color: #856404;
    font-size: 16px;
}

.context-hint i.fa-cog {
    color: #495057;
    margin: 0 4px;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.pulse-attention {
    animation: pulse 1s ease-in-out 2;
}

.edit-btn {
  background-color: #f0f0f0;
  border: 1px solid var(--border-color-grey);
  color: #333;
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
.edit-btn:hover {
  background-color: #e0e0e0;
}

.add-example-btn {
  background: none;
  border: none;
  color: #007BFF;
  font-size: 16px;
  cursor: pointer;
  transition: color 0.3s ease;
  margin-left: 0;
}
.add-example-btn:hover {
  color: #0056b3;
}

.few-shot-row.add-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;

}

.modal-content h3 {
  font-size: 16px;
  font-weight: normal;
  margin-bottom: 10px;
}

#language-tabs {
  text-align: center;
  margin-bottom: 10px;
}
.lang-tab {
  margin: 0 3px;
  padding: 4px 6px;
  border: 1px solid var(--border-color-grey);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.lang-tab.active {
  background-color: #007BFF;
  color: #fff;
  border-color: #007BFF;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}
.modal-content {
  background-color: #fefefe;
  margin: 10% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 50%;
  border-radius: 5px;
  position: relative;
}
.close-modal {
  color: #aaa;
  position: absolute;
  right: 15px;
  top: 10px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}
.close-modal:hover,
.close-modal:focus {
  color: black;
}

.few-shot-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}
.few-shot-row input.few-shot-input {
  flex: 1;
  margin-left: 8px;
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
}
.remove-example-btn {
  background: transparent;
  border: none;
  color: #dc3545;
  font-size: 16px;
  cursor: pointer;
  margin-left: 8px;
}
.feedback-message {
  color: #28a745;
  font-size: 14px;
  margin-top: 8px;
  text-align: center;
  transition: opacity 0.5s ease;
}

