/* Main styles for the Nature Tech Solutions Finder */

:root {
    --color-primary: #0ef;
    --color-secondary: #08a;
    --color-background: #121212;
    --color-surface: #1e1e2e;
    --color-text: #F1F1F1;
    --color-text-secondary: #A0A0A0;
    --border-color: #313142;
    --shadow-color: rgba(0, 0, 0, 0.4);
}

/* Base styling */
body {
    background: linear-gradient(135deg, #1a1a1a 0%, #121212 100%);
    color: var(--color-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    padding: 20px;
    margin: 0;
    min-height: 100vh;
    line-height: 1.6;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Chat container */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px);
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(30, 30, 46, 0.3);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px var(--shadow-color);
    border: 1px solid var(--border-color);
}

/* Messages area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 20px;
}

/* Message styles */
.message {
    display: flex;
    margin-bottom: 20px;
}

.user-message {
    justify-content: flex-end;
}

.ai-message {
    justify-content: flex-start;
}

.message-content {
    max-width: 85%;
    padding: 15px;
    border-radius: 18px;
    position: relative;
}

.user-message .message-content {
    background: var(--color-primary);
    color: #000;
    border-bottom-right-radius: 5px;
}

.ai-message .message-content {
    background: var(--color-surface);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 5px;
}

.message-content p {
    margin: 0 0 10px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

/* AI content styling */
.ai-content {
    line-height: 1.6;
}

.ai-content h3 {
    margin-top: 0;
    color: var(--color-primary);
    font-weight: 600;
}

.ai-content ul {
    padding-left: 20px;
    margin: 10px 0;
}

.ai-content li {
    margin-bottom: 5px;
}

/* Search results styling */
.search-results {
    margin-top: 15px;
}

.search-results h3 {
    margin-top: 0;
    font-size: 18px;
    color: var(--color-primary);
}

.result-item {
    background: rgba(30, 30, 46, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.company-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.company-header h4 {
    margin: 0;
    font-size: 18px;
    color: var(--color-primary);
}

.company-details {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.details-left, .details-right {
    flex: 1;
    min-width: 250px;
}

.details-left p, .details-right p {
    margin: 5px 0;
    font-size: 14px;
}

/* Input area */
.chat-input-container {
    padding: 20px;
    background: rgba(20, 20, 35, 0.7);
    border-top: 1px solid var(--border-color);
    position: relative;
}

.chat-form {
    width: 100%;
    position: relative;
}

/* Button positioning fixes */
.chat-input-box {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    overflow: visible;
}

.chat-input {
    flex: 1;
    padding: 12px;
    padding-right: 50px !important;
    width: calc(100% - 50px);
    box-sizing: border-box;
    background-color: #232330;
    color: var(--color-text);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.5;
    resize: none;
}

/* Add styling for placeholder text */
.chat-input::placeholder {
    color: var(--color-text-secondary);
    opacity: 0.7;
}

.send-button {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background-color: var(--color-primary);
    border: none;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    margin: 0;
}

.spinner-icon, .arrow-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
}

.button-spinner {
    border: 2px solid rgba(0, 0, 0, 0.3);
    border-top: 2px solid #000;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Settings panel */
.settings-container {
    display: none; /* Hide settings by default */
    margin-top: 20px;
    margin-bottom: 10px;
}

.settings-toggle {
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    text-decoration: underline;
}

.settings-panel {
    display: none;
    background: rgba(20, 20, 35, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 10px;
    padding: 15px;
}

.settings-panel.open {
    display: block;
}

.settings-content {
    margin-bottom: 15px;
}

/* Debug section styling */
.debug-section {
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    margin-top: 10px;
    font-size: 14px;
}

.debug-details {
    margin-bottom: 10px;
}

.debug-details summary {
    cursor: pointer;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.debug-details pre {
    background: rgba(0, 0, 0, 0.2);
    padding: 10px;
    overflow-x: auto;
    border-radius: 4px;
    font-size: 12px;
    margin: 10px 0;
}

/* Error message styling */
.error-message {
    color: #ff6b6b;
    padding: 10px;
    border: 1px solid #ff6b6b;
    border-radius: 8px;
    background: rgba(255, 107, 107, 0.1);
    margin-bottom: 15px;
}

/* Loading indicator */
.loading-indicator {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 35, 0.85);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 5px 15px var(--shadow-color);
    z-index: 100;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    border-top: 4px solid #000;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .chat-container {
        height: calc(100vh - 20px);
        border-radius: 8px;
    }
    
    .company-details {
        flex-direction: column;
        gap: 10px;
    }
    
    .chat-input {
        padding: 12px;
        font-size: 14px;
    }
}

/* Humanized section styling */
.humanized-section {
    margin-top: 10px;
}

.ai-summary {
    line-height: 1.7;
}

.ai-summary h3 {
    color: var(--color-primary);
    margin-top: 0;
}

.ai-summary ul {
    padding-left: 20px;
}

/* Debug Panel Styles */
.debug-tools {
    position: fixed;
    bottom: 10px;
    right: 10px;
    z-index: 1000;
}

.debug-toggle-button {
    display: none;
    background-color: #34495e;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.server-logs-panel {
    display: none;
    position: fixed;
    bottom: 50px;
    right: 10px;
    width: 80%;
    max-width: 800px;
    max-height: 60vh;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    overflow: hidden;
}

.server-logs-header {
    background: #34495e;
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.server-logs-header h3 {
    margin: 0;
}

.close-button, .refresh-logs-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
    padding: 5px 10px;
}

.refresh-logs-button {
    background: #2c3e50;
    border-radius: 4px;
    margin-right: 10px;
}

.server-logs-content {
    padding: 15px;
    overflow-y: auto;
    max-height: calc(60vh - 50px);
    font-family: monospace;
    font-size: 12px;
    line-height: 1.4;
    background: #f8f9fa;
}

.server-logs-content pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}
