body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

body::before {
    content: none; /* Disable the pseudo-element that adds the GIF */
}

.layout {
    display: flex;
    height: 100vh;
    width: 100%;
}

.sidebar {
    width: 20%;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
}

.main-content {
    width: 80%;
    height: 100vh;
    padding: 20px;
    background: #ffffff;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.search-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: calc(100% - 40px);
    background: #ffffff;
}

#queryInput {
    height: calc(100% - 100px);
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    resize: none;
}

button {
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #0056b3;
}

.toast {
    visibility: hidden;
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #4CAF50;
    color: white;
    padding: 16px;
    border-radius: 4px;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.toast.show {
    visibility: visible;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

@keyframes fadein {
    from {opacity: 0;}
    to {opacity: 1;}
}

@keyframes fadeout {
    from {opacity: 1;}
    to {opacity: 0;}
}

.response-area {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    background-color: rgba(249, 249, 249, 0.8);
    font-size: 14px;
    line-height: 1.6;
}

.stream-content {
    flex: 1;
    background-color: #ffffff;
    border-radius: 4px;
    font-size: 16px;
    color: #333;
    margin: 15px 0;
    padding: 15px;
    overflow-y: auto;
    word-wrap: break-word;
    padding: 10px;
}

/* Error and loading states */
.error-message {
    color: #d9534f;
    background-color: #f2dede;
    border: 1px solid #ebccd1;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.warning-message {
    color: #8a6d3b;
    background-color: #fcf8e3;
    border: 1px solid #faebcc;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.loading-indicator {
    text-align: center;
    color: #666;
    padding: 20px;
    font-style: italic;
    background-image: linear-gradient(to right, #f0f0f0, #f8f8f8, #f0f0f0);
    background-size: 200% 100%;
    animation: loading-gradient 1.5s infinite;
}

@keyframes loading-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Streaming content styles */
.raw-streaming-content {
    background-color: #f8f9fa;
    padding: 15px;
    border-left: 4px solid #007bff;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: monospace;
    line-height: 1.5;
    max-height: 60vh;
    overflow-y: auto;
    margin: 10px 0;
}

/* Styling for markdown-rendered content */
.markdown-content {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #333;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
    color: #000;
}

.markdown-content h3 {
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.3em;
}

.markdown-content ul, 
.markdown-content ol {
    padding-left: 2em;
    margin-bottom: 1em;
}

.markdown-content li {
    margin-bottom: 0.5em;
}

.markdown-content p {
    margin-bottom: 1em;
}

.markdown-content strong {
    font-weight: 600;
}

.markdown-content code {
    background-color: rgba(27, 31, 35, 0.05);
    border-radius: 3px;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 85%;
    padding: 0.2em 0.4em;
}

.markdown-content blockquote {
    border-left: 4px solid #dfe2e5;
    color: #6a737d;
    padding: 0 1em;
    margin: 0 0 1em;
}

.markdown-content hr {
    height: 0.25em;
    padding: 0;
    margin: 24px 0;
    background-color: #e1e4e8;
    border: 0;
}

.stream-status {
    padding: 8px 15px;
    background-color: #e2f0ff;
    border-left: 4px solid #007bff;
    color: #004085;
    font-size: 0.9em;
    margin-bottom: 10px;
    border-radius: 3px;
    font-family: monospace;
    animation: pulse 1.5s infinite;
    width: calc(100% - 30px);
}

.stream-status.error {
    background-color: #f8d7da;
    border-left-color: #dc3545;
    color: #721c24;
}

@keyframes pulse {
    0% { background-color: #e2f0ff; }
    50% { background-color: #d1e6ff; }
    100% { background-color: #e2f0ff; }
}

/* Formatted content styles */
.controls-container {
    padding: 15px;
    background-color: #ffffff;
}

.final-response {
    padding: 15px;
    background-color: #ffffff;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

/* Control entry styles */
.control-entry {
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-left: 4px solid #007bff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.control-header {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 12px;
    padding-bottom: 8px;
    color: #0056b3;
    border-bottom: 1px solid #e9ecef;
}

.control-property {
    margin-bottom: 8px;
    padding: 4px 0;
    line-height: 1.5;
}

.control-property strong {
    color: #495057;
    font-weight: 600;
    min-width: 150px;
    display: inline-block;
}

.activity-list {
    margin-top: 10px;
    padding-left: 25px;
}

.activity-item {
    margin-bottom: 8px;
    line-height: 1.5;
}

.activity-list {
    margin: 10px 0 15px 0;
    padding: 10px 10px 10px 30px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border-left: 2px solid #6c757d;
    list-style-type: disc;
}

.activity-item {
    margin-bottom: 6px;
    line-height: 1.4;
}

/* Fallback and error recovery styles */
.error-recovery {
    padding: 15px;
    border-left: 4px solid #ffc107;
    background-color: #fff8e1;
    margin-bottom: 15px;
}

.fallback-notice {
    padding: 8px;
    background-color: #fff3cd;
    border-left: 3px solid #ffc107;
    color: #856404;
    font-size: 0.9em;
    margin-top: 10px;
}

/* Headers */
h3 {
    color: #333;
    margin-top: 20px;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

/* Debug panel styles */
.debug-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 400px;
    height: 200px;
    background-color: rgba(0, 0, 0, 0.85);
    color: #00ff00;
    padding: 10px;
    font-family: monospace;
    font-size: 12px;
    overflow-y: auto;
    z-index: 9999;
    border-top-left-radius: 8px;
    display: none;
}

.debug-entry {
    margin-bottom: 4px;
    border-bottom: 1px dashed rgba(0, 255, 0, 0.3);
    padding-bottom: 3px;
}

/* Modal styles */
.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1000; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

.modal-content {
  background-color: #fefefe;
  margin: 10% auto; /* 10% from the top and centered */
  padding: 20px;
  border: 1px solid #888;
  width: 400px; /* Could be more or less, depending on screen size */
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: black;
  text-decoration: none;
  cursor: pointer;
}