/* AI Chat Application Styles */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background-color: #4a6cf7;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 1.8rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info a {
    color: white;
    text-decoration: none;
    background-color: #6c8eff;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.user-info a:hover {
    background-color: #80a1ff;
}

.chat-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 300px;
    background-color: white;
    border-right: 1px solid #e0e0e0;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

.settings-section h3 {
    margin-bottom: 1rem;
    color: #4a6cf7;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.settings-section label {
    display: block;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #555;
}

.settings-section textarea,
.settings-section input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.settings-section input[type="text"] {
    min-height: auto;
    height: 40px;
}

#clear-chat-btn {
    background-color: #ff6b6b;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    margin-top: auto;
    font-size: 1rem;
    transition: background-color 0.3s;
}

#clear-chat-btn:hover {
    background-color: #ff5252;
}

.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #fafafa;
}

.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

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

.user-message {
    align-self: flex-end;
    background-color: #4a6cf7;
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-message {
    align-self: flex-start;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.message-sender {
    font-weight: bold;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.chat-input-area {
    padding: 1.5rem;
    background-color: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 0.5rem;
}

#message-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 24px;
    resize: none;
    height: 50px;
    font-family: inherit;
}

#send-btn {
    background-color: #4a6cf7;
    color: white;
    border: none;
    padding: 0 1.5rem;
    border-radius: 24px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

#send-btn:hover {
    background-color: #6c8eff;
}

.install-main,
.login-main,
.register-main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

form {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 500px;
}

form h2 {
    margin-bottom: 1.5rem;
    color: #4a6cf7;
    text-align: center;
}

label {
    display: block;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: #555;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
}

button {
    width: 100%;
    background-color: #4a6cf7;
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    margin-top: 1.5rem;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #6c8eff;
}

.error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 1px solid #ffcdd2;
}

.success-message {
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 1px solid #c8e6c9;
}

form p {
    text-align: center;
    margin-top: 1rem;
}

form a {
    color: #4a6cf7;
    text-decoration: none;
}

@media (max-width: 768px) {
    .chat-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        max-height: 300px;
    }
    
    .user-info {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-end;
    }
    
    .message {
        max-width: 90%;
    }
    
    header {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}
