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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: #1e1e1e;
    color: #d4d4d4;
    height: 100vh;
    overflow: hidden;
}

/* Fixed Header Styles */
.fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: #1e1e1e;
    border-bottom: 1px solid #3e3e42;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
}

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

.logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.logo-link:hover {
    opacity: 0.8;
}

.mixedbread-logo {
    height: 18px;
    width: auto;
}

.logo-text {
    font-size: 16px;
    font-weight: 500;
    color: #d4d4d4;
}

.header-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.github-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: #d4d4d4;
    text-decoration: none;
    transition: all 0.2s ease;
    background: transparent;
}

.github-link:hover {
    background: #2d2d30;
    color: #ffffff;
}

.github-link svg {
    width: 18px;
    height: 18px;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Landing Page Styles */
.landing-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90vh;
    background: #1e1e1e;
    padding: 110px 20px 40px 20px;
}

.landing-content {
    max-width: 700px;
    width: 100%;
    text-align: center;
}

.landing-title {
    font-size: 64px;
    font-weight: 500;
    margin-bottom: 16px;
    color: #d4d4d4;
    letter-spacing: -0.02em;
}

.landing-title em {
    font-style: italic;
    font-weight: 600;
}

.landing-subtitle {
    font-size: 16px;
    color: #a8a8a8;
    margin-bottom: 48px;
    font-weight: 400;
}

.landing-subtitle svg {
    vertical-align: middle;
    display: inline-block;
    margin: 0 2px;
    margin-top: -3px;
}

.landing-input-section {
    margin-bottom: 20px;
}

.landing-textarea-wrapper {
    position: relative;
    width: 100%;
}

.landing-textarea {
    width: 100%;
    background: #252526;
    border: 1px solid #3e3e42;
    color: #d4d4d4;
    padding: 14px 16px 50px 16px;
    border-radius: 8px;
    font-size: 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    transition: all 0.2s;
    resize: none;
    min-height: 120px;
}

.landing-textarea:hover {
    border-color: #5e5e5e;
    background-color: #2d2d30;
}

.landing-textarea:focus {
    outline: none;
    border-color: #3e3e42;
    background-color: #252526;
}

.landing-textarea::placeholder {
    color: #6e6e6e;
}

.landing-controls-overlay {
    position: absolute;
    bottom: 12px;
    left: 8px;
    right: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
}

.landing-controls-overlay > * {
    pointer-events: auto;
}

.landing-repo-btn {
    background: #2d2d30;
    border: 1px solid #3e3e42;
    color: #d4d4d4;
    padding: 8px 32px 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a8a8a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.landing-repo-btn:hover {
    border-color: #5e5e5e;
    background-color: #3e3e42;
}

.landing-repo-btn:focus {
    outline: none;
    border-color: white;
}

.landing-submit-icon-btn {
    background: #3e3e42;
    border: 1px solid #4e4e4e;
    color: #d4d4d4;
    width: 33px;
    height: 33px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.landing-submit-icon-btn svg {
    width: 18px;
    height: 18px;
    stroke: #d4d4d4;
}

.landing-submit-icon-btn:hover {
    background: #4e4e4e;
    border-color: #5e5e5e;
}

.landing-submit-icon-btn:active {
    background: #3e3e42;
}

.landing-submit-icon-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(158, 158, 158, 0.2);
}

.suggestion-chips {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.suggestion-chip {
    background: #2d2d30;
    border: 1px solid #3e3e42;
    color: #a8a8a8;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.suggestion-chip:hover {
    background: #3e3e42;
    border-color: #5e5e5e;
    color: #d4d4d4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.suggestion-chip:active {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.suggestion-chip:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(158, 158, 158, 0.2);
}

@media (max-width: 768px) {
    .landing-title {
        font-size: 48px;
    }
    
    .landing-subtitle {
        font-size: 16px;
        margin-bottom: 32px;
    }
    
    .landing-textarea {
        min-height: 100px;
    }
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

header {
    background: transparent;
    border-bottom: 1px solid #3e3e42;
    padding: 20px 24px 5px 24px;
    position: relative;
}

header h1 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #d4d4d4;
    padding-left: 40px;
}

.back-btn {
    position: absolute;
    left: 24px;
    top: 15px;
    background: #2d2d30;
    border: 1px solid #3e3e42;
    color: #d4d4d4;
    padding: 6px 6px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: #3e3e42;
    border-color: #5e5e5e;
}

.back-btn:active {
    background: #2d2d30;
}

.back-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(158, 158, 158, 0.2);
}

.back-btn svg {
    display: block;
}

.controls {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.url-config {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.url-input-group {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.url-input-group label {
    font-size: 13px;
    color: #a8a8a8;
    font-weight: 500;
}

.url-input-group input {
    flex: 1;
    background: #252526;
    border: 1px solid #3e3e42;
    color: #d4d4d4;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    transition: border-color 0.2s, background 0.2s;
}

.url-input-group input:focus {
    outline: none;
    border-color: white;
    background: #252526;
}

#repo-select {
    background: #252526;
    border: 1px solid #3e3e42;
    color: #d4d4d4;
    padding: 8px 32px 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    min-width: 120px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a8a8a8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

#repo-select:focus {
    outline: none;
    border-color: white;
    background: #252526;
}

#prompt-input {
    flex: 1;
    background: #252526;
    border: 1px solid #3e3e42;
    color: #d4d4d4;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s, background 0.2s;
}

#prompt-input:focus {
    outline: none;
    border-color: white;
    background: #252526;
}

button {
    background: white;
    border: 1px solid #e0e0e0;
    color: #1e1e1e;
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.02), transparent);
    opacity: 0;
    transition: opacity 0.15s ease;
}

button:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

button:hover::before {
    opacity: 1;
}

button:active {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    background: #eeeeee;
}

button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

button:disabled {
    background: #3e3e42;
    border-color: #3e3e42;
    color: #a8a8a8;
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
    transform: none;
}

button:disabled::before {
    display: none;
}

#clear-btn {
    background: #3e3e42;
    border-color: #4e4e4e;
    color: #d4d4d4;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#clear-btn:hover {
    background: #4e4e4e;
    border-color: #5e5e5e;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

#clear-btn:active {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#clear-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(158, 158, 158, 0.2);
}

.split-view {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    background: transparent;
    padding: 12px 24px;
    border-bottom: 1px solid #3e3e42;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: #d4d4d4;
}

.panel-status {
    font-size: 12px;
    color: #a8a8a8;
    padding: 4px 12px;
    background: #3e3e42;
    border: 1px solid #4e4e4e;
    border-radius: 12px;
    font-weight: 500;
}

.panel-status-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-timer {
    font-size: 12px;
    color: #a8a8a8;
    font-weight: 500;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

.panel-status.launching {
    background: #3e3e42;
    border-color: #4e4e4e;
    color: #a8a8a8;
}

.panel-status.streaming {
    background: rgba(22, 130, 93, 0.15);
    border-color: #16825d;
    color: #16825d;
}

.panel-status.error {
    background: rgba(244, 67, 54, 0.15);
    border-color: #f44336;
    color: #f44336;
}

.divider {
    width: 1px;
    background: #3e3e42;
    flex-shrink: 0;
}

.stream-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #1e1e1e;
}

.event-block {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    animation: slideIn 0.2s ease-out;
}

.event-icon {
    width: 14px;
    height: 14px;
    color: #a8a8a8;
    flex-shrink: 0;
}

.event-block .event-content {
    flex: 1;
    font-size: 14px;
    line-height: 1.6;
    color: #d4d4d4;
    word-wrap: break-word;
}

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

/* Event type specific colors */
.event-thinking .event-icon {
    color: #a8a8a8;
}

.event-thinking {
    align-items: flex-start;
}

.thinking-label {
    font-weight: 500;
    color: #a8a8a8;
}

.event-tool .event-icon {
    color: #a8a8a8;
    margin-top: 2px; /* Align with text baseline */
}

.event-tool {
    flex-wrap: wrap;
    align-items: flex-start;
}

.event-tool .event-content {
    flex: 1;
    min-width: 0;
}

.event-tool .tool-header-clickable {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    gap: 8px;
    line-height: 1.4; /* Match event-content line-height */
}

.event-tool .tool-header-clickable:hover .tool-name {
    color: #ffffff;
}

.event-tool .tool-name {
    font-weight: normal;
    color: #d4d4d4;
    font-size: 14px;
    flex: 1;
    transition: color 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-tool .tool-command {
    background: rgba(255, 255, 255, 0.08);
    color: #a8a8a8;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 13px;
}

.event-tool .tool-chevron {
    width: 14px;
    height: 14px;
    color: #a8a8a8;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.event-tool .tool-params {
    font-size: 13px;
    color: #9cdcfe;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5;
    margin-top: 8px;
}

/* Tool result sections */

.tool-result {
    flex-basis: 100%;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #3e3e42;
    margin-left: 0; /* Already inside padded event-tool container */
}

.tool-result-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    color: #a8a8a8;
}

.tool-result.success .tool-result-title {
    color: #16825d;
}

.tool-result.error .tool-result-title {
    color: #f44336;
}

.tool-result-content {
    margin-top: 8px;
}

.tool-result-content pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    border: 1px solid #3e3e42;
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    color: #d4d4d4;
}

.tool-result.error .tool-result-content pre {
    background: rgba(244, 67, 54, 0.1);
    border-color: #f44336;
    color: #ff6b6b;
}

.tool-result-content .tool-code-block {
    margin: 0;
}

.tool-result-content .tool-code-block pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    border: 1px solid #3e3e42;
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    color: #d4d4d4;
}

.tool-result-content .tool-code-block pre code {
    background: transparent;
    padding: 0;
    color: inherit;
    font-size: inherit;
}

.event-status .event-icon {
    color: #a8a8a8;
}

.event-error .event-icon {
    color: #f44336;
}

/* Simple text events (streaming/intermediate) */
.event-text {
    display: block;
}

.event-text .event-content {
    padding: 12px;
    background: #2d2d30;
    border-radius: 6px;
    border: 1px solid #3e3e42;
    font-size: 14px;
    line-height: 1.6;
    color: #d4d4d4;
}

/* Final response styling with copy button and markdown */
.event-text.final-response {
    display: block;
    position: relative;
}

.event-text.final-response .event-content {
    padding: 16px;
    background: #2d2d30;
    border-radius: 6px;
    border: 1px solid #3e3e42;
}

/* Extra top padding when copy button is present */
.event-text.final-response:has(.copy-button) .event-content {
    padding-top: 40px;
}

/* Copy button styling */
.copy-button {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #3e3e42;
    border: 1px solid #4e4e4e;
    color: #a8a8a8;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    width: 28px;
    height: 28px;
    z-index: 10;
}

.copy-button:hover {
    background: #4e4e4e;
    border-color: #5e5e5e;
    color: #d4d4d4;
}

.copy-button:active {
    background: #3e3e42;
}

.copy-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(158, 158, 158, 0.2);
}

/* Icon visibility states */
.copy-button .copy-icon {
    display: block;
    transition: opacity 0.2s ease;
}

.copy-button .check-icon {
    display: none;
    transition: opacity 0.2s ease;
}

.copy-button.copied .copy-icon {
    display: none;
}

.copy-button.copied .check-icon {
    display: block;
}

/* Markdown styling for final responses */
.markdown-content h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 8px 0 4px 0;
    color: #d4d4d4;
    border-bottom: 1px solid #3e3e42;
    padding-bottom: 4px;
}

.markdown-content h2 {
    font-size: 20px;
    font-weight: 600;
    margin: 6px 0 3px 0;
    color: #d4d4d4;
}

.markdown-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 4px 0 2px 0;
    color: #d4d4d4;
}

.markdown-content p {
    margin: 2px 0;
    line-height: 1.4;
}

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

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

.markdown-content code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 13px;
    color: #9cdcfe;
}

.markdown-content pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 4px 0;
    border: 1px solid #3e3e42;
}

.markdown-content pre code {
    background: transparent;
    padding: 0;
    color: #d4d4d4;
    font-size: 13px;
    line-height: 1.5;
}

.markdown-content ul,
.markdown-content ol {
    margin: 4px 0;
    padding-left: 24px;
}

.markdown-content li {
    margin: 1px 0;
    line-height: 1.4;
}

.markdown-content a {
    color: #2196f3;
    text-decoration: none;
}

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


/* Scrollbar styling */
.stream-container::-webkit-scrollbar {
    width: 10px;
}

.stream-container::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.stream-container::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 5px;
}

.stream-container::-webkit-scrollbar-thumb:hover {
    background: #4e4e4e;
}

.thinking-indicator {
    display: inline-block;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Usage Summary Styling */
.usage-summary {
    margin-top: 24px;
    padding: 16px;
    background: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 8px;
    animation: slideIn 0.2s ease-out;
}

.usage-summary-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    color: #d4d4d4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.usage-icon {
    width: 16px;
    height: 16px;
    color: #a8a8a8;
}

.usage-summary-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.usage-metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.usage-label {
    font-size: 11px;
    color: #a8a8a8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.usage-value {
    font-size: 16px;
    color: #d4d4d4;
    font-weight: 600;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

/* Models section */
.usage-models {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #3e3e42;
}

.usage-models-header {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #a8a8a8;
    margin-bottom: 12px;
}

.usage-model {
    padding: 12px 0;
}

.usage-model:not(:last-child) {
    border-bottom: 1px solid #3e3e42;
}

.model-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.model-icon {
    width: 14px;
    height: 14px;
    color: #a8a8a8;
    flex-shrink: 0;
}

.model-name {
    flex: 1;
    font-size: 13px;
    color: #d4d4d4;
    font-weight: 500;
}

.model-cost {
    font-size: 13px;
    color: #d4d4d4;
    font-weight: 600;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

.model-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-left: 22px;
}

.model-metric {
    display: flex;
    align-items: center;
    gap: 6px;
}

.model-metric-label {
    font-size: 11px;
    color: #a8a8a8;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.model-metric-value {
    font-size: 12px;
    color: #d4d4d4;
    font-weight: 500;
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
}

@media (max-width: 768px) {
    .usage-summary-content {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}
