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

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background-color: #efefef;
}

/* Top Bar */
.top-bar {
    background-color: #0a0a0a;
    color: #ffffff;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e97100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
}

.top-bar h1 {
    font-size: 24px;
    font-weight: 300;
    color: #ffffff;
    margin: 0;
    letter-spacing: 0.5px;
}

.top-bar-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Base button styling for all top bar buttons */
.top-bar-buttons button,
.top-bar-buttons a {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Uniform button styling - all buttons use debug button color */
.browser-button,
.new-chat-button,
.debug-button,
.logout-button {
    background: linear-gradient(135deg, #444444 0%, #555555 100%);
    color: rgba(255, 255, 255, 0.9);
}

.browser-button:hover,
.new-chat-button:hover,
.debug-button:hover,
.logout-button:hover {
    background: linear-gradient(135deg, #555555 0%, #666666 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
    color: white;
}

.browser-button:active,
.new-chat-button:active,
.debug-button:active,
.logout-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.2s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-content {
    background-color: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background-color: #0a0a0a;
    color: white;
    padding: 20px 24px;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #9b59b6;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 300;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Policy content styling for file modal */
#fileModalBody .policy-content {
    max-width: 100%;
    line-height: 1.6;
}

#fileModalBody .policy-content h1 {
    color: #0a0a0a;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid #e97100;
    font-weight: 300;
    font-size: 36px;
}

#fileModalBody .policy-content h2 {
    color: #222222;
    margin-top: 35px;
    margin-bottom: 18px;
    font-weight: 300;
    font-size: 28px;
}

#fileModalBody .policy-content h3 {
    color: #3a3a3a;
    margin-top: 25px;
    margin-bottom: 12px;
    font-weight: 400;
    font-size: 20px;
}

#fileModalBody .policy-content h4 {
    color: #3a3a3a;
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 500;
    font-size: 16px;
}

#fileModalBody .policy-content p {
    line-height: 1.6;
    margin-bottom: 15px;
    color: #3a3a3a;
}

#fileModalBody .policy-content ul,
#fileModalBody .policy-content ol {
    margin-left: 30px;
    margin-bottom: 15px;
}

#fileModalBody .policy-content li {
    margin-bottom: 8px;
    line-height: 1.6;
}

#fileModalBody .policy-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

#fileModalBody .policy-content table th,
#fileModalBody .policy-content table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

#fileModalBody .policy-content table th {
    background-color: #222222;
    color: white;
    font-weight: 500;
}

#fileModalBody .policy-content table tr:nth-child(even) {
    background-color: #f7f8f9;
}

#fileModalBody .policy-content code {
    background-color: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #d63384;
}

#fileModalBody .policy-content pre {
    background-color: #f4f4f4;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 15px 0;
    border-left: 3px solid #e97100;
}

#fileModalBody .policy-content pre code {
    background-color: transparent;
    padding: 0;
    color: #333;
}

#fileModalBody .policy-content blockquote {
    border-left: 4px solid #e97100;
    padding-left: 16px;
    margin: 12px 0;
    color: #666;
    font-style: italic;
}

#fileModalBody .policy-content a {
    color: #e97100;
    text-decoration: underline;
}

#fileModalBody .policy-content a:hover {
    color: #ff8800;
}

#fileModalBody .policy-content strong {
    font-weight: 600;
    color: #0a0a0a;
}

#fileModalBody .policy-content em {
    font-style: italic;
}

#fileModalBody .policy-content hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 16px 0;
}

.context-section {
    margin-bottom: 24px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.context-section-header {
    background-color: #f5f5f5;
    padding: 12px 16px;
    font-weight: 600;
    color: #0a0a0a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #9b59b6;
}

.context-section-content {
    padding: 16px;
    background-color: #fafafa;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
    color: #333;
}

.token-badge {
    background-color: #9b59b6;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.cache-badge {
    background-color: #27ae60;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    margin-left: 8px;
}

.empty-state {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 24px;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    background-color: #ffffff;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #f5f5f5;
}

.message {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.message.user {
    align-items: flex-end;
}

.message.assistant {
    align-items: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.5;
}

.message.user .message-bubble {
    background-color: #e97100;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-bubble {
    background-color: #ffffff;
    color: #333333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message.assistant .message-bubble h3 {
    color: #e97100;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    margin-top: 0;
}

.message.assistant .message-bubble p {
    margin-bottom: 8px;
    color: #333333;
}

.message.assistant .message-bubble p:last-child {
    margin-bottom: 0;
}

.message.assistant .message-bubble h1,
.message.assistant .message-bubble h2,
.message.assistant .message-bubble h3,
.message.assistant .message-bubble h4,
.message.assistant .message-bubble h5,
.message.assistant .message-bubble h6 {
    color: #0a0a0a;
    margin-top: 16px;
    margin-bottom: 8px;
    font-weight: 600;
}

.message.assistant .message-bubble h1 {
    font-size: 24px;
    border-bottom: 2px solid #e97100;
    padding-bottom: 8px;
}

.message.assistant .message-bubble h2 {
    font-size: 20px;
}

.message.assistant .message-bubble h3 {
    font-size: 18px;
    color: #e97100;
}

.message.assistant .message-bubble h4 {
    font-size: 16px;
}

.message.assistant .message-bubble h5,
.message.assistant .message-bubble h6 {
    font-size: 14px;
}

.message.assistant .message-bubble ul,
.message.assistant .message-bubble ol {
    margin-left: 24px;
    margin-bottom: 12px;
    padding-left: 8px;
}

.message.assistant .message-bubble li {
    margin-bottom: 6px;
    line-height: 1.6;
}

.message.assistant .message-bubble ul li {
    list-style-type: disc;
}

.message.assistant .message-bubble ol li {
    list-style-type: decimal;
}

.message.assistant .message-bubble code {
    background-color: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #d63384;
}

.message.assistant .message-bubble pre {
    background-color: #f4f4f4;
    padding: 12px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 12px 0;
    border-left: 3px solid #e97100;
}

.message.assistant .message-bubble pre code {
    background-color: transparent;
    padding: 0;
    color: #333;
}

.message.assistant .message-bubble blockquote {
    border-left: 4px solid #e97100;
    padding-left: 16px;
    margin: 12px 0;
    color: #666;
    font-style: italic;
}

.message.assistant .message-bubble table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
}

.message.assistant .message-bubble table th,
.message.assistant .message-bubble table td {
    border: 1px solid #e0e0e0;
    padding: 8px 12px;
    text-align: left;
}

.message.assistant .message-bubble table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

.message.assistant .message-bubble table tr:nth-child(even) {
    background-color: #fafafa;
}

.message.assistant .message-bubble a {
    color: #e97100;
    text-decoration: underline;
}

.message.assistant .message-bubble a:hover {
    color: #ff8800;
}

.message.assistant .message-bubble a.md-file-link {
    color: #0066cc;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
}

.message.assistant .message-bubble a.md-file-link:hover {
    color: #0052a3;
    text-decoration: underline;
}

.message.assistant .message-bubble strong {
    font-weight: 600;
    color: #0a0a0a;
}

.message.assistant .message-bubble em {
    font-style: italic;
}

.message.assistant .message-bubble hr {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 16px 0;
}

.cache-info {
    font-size: 11px;
    color: #999999;
    margin-top: 4px;
    font-style: italic;
}

.chat-input-container {
    padding: 20px;
    background-color: #ffffff;
    border-top: 1px solid #e0e0e0;
    position: relative;
}

/* Pre-warming overlay */
.prewarm-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: opacity 0.3s ease;
}

.prewarm-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.prewarm-content {
    background-color: #ffffff;
    padding: 40px 60px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    text-align: center;
    max-width: 400px;
}

.prewarm-title {
    font-size: 20px;
    font-weight: 500;
    color: #0a0a0a;
    margin-bottom: 16px;
}

.prewarm-message {
    font-size: 16px;
    color: #666;
    margin-bottom: 24px;
}

.prewarm-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    font-size: 16px;
    font-family: inherit;
    resize: none;
    min-height: 48px;
    max-height: 150px;
    transition: all 0.3s ease;
}

.chat-input:focus {
    outline: none;
    border-color: #e97100;
    box-shadow: 0 0 0 3px rgba(233, 113, 0, 0.1);
}

.chat-input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.send-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.send-button {
    background-color: #e97100;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.send-button:hover:not(:disabled) {
    background-color: #ff8800;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(233, 113, 0, 0.3);
}

.send-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.loading-indicator {
    display: none;
    padding: 12px 16px;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    max-width: 70%;
    color: #666666;
}

.loading-indicator.active {
    display: block;
}

.loading-dots {
    display: inline-block;
}

.loading-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #e97100;
    margin: 0 2px;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.welcome-message {
    text-align: left;
    padding: 60px 20px;
    color: #666666;
    max-width: 900px;
    margin: 0 auto;
}

.welcome-message h2 {
    font-size: 32px;
    font-weight: 300;
    color: #0a0a0a;
    margin-bottom: 16px;
    text-align: left;
}

.welcome-message p {
    font-size: 16px;
    max-width: 100%;
    margin: 0 0 20px 0;
    line-height: 1.6;
    text-align: left;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #cccccc;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #999999;
}

.example-question {
    display: block;
    color: #e97100;
    cursor: pointer;
    padding: 8px 12px;
    margin: 4px 0;
    border-radius: 8px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.example-question:hover {
    background-color: #fff5eb;
    border-color: #e97100;
    color: #ff8800;
    transform: translateX(4px);
}

.example-question:active {
    transform: translateX(2px);
}

/* Authentication Modal Styles */
.auth-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: fadeIn 0.2s ease;
}

.auth-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.auth-modal-content {
    background-color: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.auth-modal-header {
    background-color: #0a0a0a;
    color: white;
    padding: 20px 24px;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    border-bottom: 3px solid #9b59b6;
}

.auth-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 300;
}

.auth-modal-body {
    padding: 24px;
}

.auth-form-group {
    margin-bottom: 20px;
}

.auth-form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
    font-size: 14px;
}

.auth-form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.auth-form-group input:focus {
    outline: none;
    border-color: #9b59b6;
    box-shadow: 0 0 0 3px rgba(155, 89, 182, 0.1);
}

.auth-form-group input.otp-input {
    font-size: 24px;
    letter-spacing: 8px;
    text-align: center;
    font-weight: 600;
}

.auth-button {
    width: 100%;
    padding: 12px;
    background-color: #9b59b6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-button:hover:not(:disabled) {
    background-color: #8e44ad;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(155, 89, 182, 0.3);
}

.auth-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.auth-error {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 8px;
    display: none;
}

.auth-error.show {
    display: block;
}

.auth-success {
    color: #27ae60;
    font-size: 14px;
    margin-top: 8px;
    display: none;
}

.auth-success.show {
    display: block;
}

.auth-step {
    display: none;
}

.auth-step.active {
    display: block;
}

.auth-info {
    color: #666;
    font-size: 13px;
    margin-top: 8px;
}
    </style>
