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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.header-actions {
    display: flex;
    gap: 10px;
}

h1, h2, h3 {
    color: #2c3e50;
}

.btn {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    border: none;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

.sessions-list {
    margin-top: 20px;
}

.session-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: white;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.session-link {
    color: #2c3e50;
    text-decoration: none;
    font-weight: 500;
    flex-grow: 1;
}

.session-date {
    color: #7f8c8d;
    font-size: 14px;
    margin: 0 15px;
}

.delete-btn {
    color: #e74c3c;
    text-decoration: none;
    font-size: 14px;
}

.chat-container {
    display: flex;
    gap: 20px;
    height: calc(100vh - 120px);
}

.sidebar {
    width: 300px;
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.upload-form {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pdf-list {
    flex-grow: 1;
    overflow-y: auto;
}

.pdf-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.pdf-name {
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

.analyze-btn {
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
}

.chat-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.chat-messages {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
}

.message {
    margin-bottom: 15px;
    max-width: 80%;
}

.message.user {
    margin-left: auto;
}

.message.assistant {
    margin-right: auto;
}

.message.system {
    margin: 10px auto;
    max-width: 90%;
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
}

.message-content {
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.user .message-content {
    background-color: #3498db;
    color: white;
    border-radius: 8px 8px 0 8px;
}

.assistant .message-content {
    background-color: #f1f1f1;
    color: #333;
    border-radius: 8px 8px 8px 0;
}

.message-time {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 5px;
    text-align: right;
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.message-form {
    display: flex;
    padding: 15px;
    border-top: 1px solid #eee;
}

textarea {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    resize: none;
    height: 60px;
    font-family: inherit;
}

.send-btn {
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0 20px;
    margin-left: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.send-btn:hover {
    background-color: #2980b9;
}