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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 100%);
    color: #e0e0e0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.container {
    width: 90%;
    max-width: 800px;
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Login Screen */
.login-screen {
    padding: 60px 40px;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

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

.login-screen h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-screen p {
    color: #999;
    margin-bottom: 40px;
}

.password-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #e0e0e0;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.password-input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.08);
}

.login-button {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.error-message {
    color: #ff6b6b;
    margin-top: 20px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.error-message.show {
    opacity: 1;
}

/* Chat Interface */
.chat-interface {
    display: none;
    flex-direction: column;
    height: 80vh;
    max-height: 800px;
}

.chat-header {
    padding: 20px 30px;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h2 {
    font-size: 1.4em;
    font-weight: 500;
}

.chat-header h2 small {
    font-size: 0.7em;
    color: #999;
    font-weight: normal;
}

.logout-button {
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.logout-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    max-width: 70%;
    padding: 15px 20px;
    border-radius: 15px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.user-message {
    align-self: flex-end;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.assistant-message {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Markdown Styling */
.assistant-message h1 { font-size: 1.5em; margin: 0.5em 0; }
.assistant-message h2 { font-size: 1.3em; margin: 0.5em 0; }
.assistant-message h3 { font-size: 1.1em; margin: 0.5em 0; }
.assistant-message p { margin: 0.5em 0; line-height: 1.6; }
.assistant-message ul, .assistant-message ol { margin: 0.5em 0; padding-left: 1.5em; }
.assistant-message li { margin: 0.25em 0; }
.assistant-message code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}
.assistant-message pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 1em;
    border-radius: 5px;
    overflow-x: auto;
    margin: 0.5em 0;
}
.assistant-message pre code {
    background: none;
    padding: 0;
}
.assistant-message blockquote {
    border-left: 4px solid #667eea;
    padding-left: 1em;
    margin: 0.5em 0;
    color: #999;
}
.assistant-message table {
    border-collapse: collapse;
    margin: 0.5em 0;
    width: 100%;
}
.assistant-message th, .assistant-message td {
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5em;
    text-align: left;
}
.assistant-message th {
    background: rgba(255, 255, 255, 0.05);
}
.assistant-message a {
    color: #667eea;
    text-decoration: none;
}
.assistant-message a:hover {
    text-decoration: underline;
}
.assistant-message strong {
    font-weight: 600;
    color: #f0f0f0;
}
.assistant-message em {
    font-style: italic;
}
.assistant-message hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin: 1em 0;
}

.chat-input-container {
    padding: 20px 30px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Dropdowns Container */
.dropdowns-container {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.dropdown-wrapper {
    flex: 1;
    min-width: 200px;
}

.prompt-dropdown {
    width: 100%;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #e0e0e0;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.prompt-dropdown:hover {
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.08);
}

.prompt-dropdown:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.08);
}

.prompt-dropdown option {
    background: #1a1a2e;
    color: #e0e0e0;
    padding: 10px;
}

.chat-input-wrapper {
    display: flex;
    gap: 15px;
}

.chat-input {
    flex: 1;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #e0e0e0;
    font-size: 16px;
    transition: all 0.3s ease;
}

.chat-input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.08);
}

.send-button {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.send-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.loading-indicator {
    display: none;
    align-self: flex-start;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    margin-bottom: 20px;
}

.loading-indicator::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Export Buttons */
.export-buttons-container {
    display: flex;
    gap: 10px;
    padding: 15px 30px;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    justify-content: center;
    flex-wrap: wrap;
}

.export-button {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #e0e0e0;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.export-button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.export-button:active {
    transform: translateY(0);
}

.button-icon {
    font-size: 16px;
}

/* Success notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    background: rgba(40, 167, 69, 0.9);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideInRight 0.3s ease;
    z-index: 1000;
}

.notification.error {
    background: rgba(220, 53, 69, 0.9);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
