:root {
    --font-family-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    --text-xs: .75rem;
    --text-xs--line-height: 1.33333;
    --text-sm: .875rem;
    --text-sm--line-height: 1.42857;
    --text-base: 1rem;
    --text-base--line-height: 1.5;
    --text-lg: 1.125rem;
    --text-lg--line-height: 1.55556;
    --text-xl: 1.25rem;
    --text-xl--line-height: 1.4;
    --text-2xl: 1.5rem;
    --text-2xl--line-height: 1.33333;
    --text-3xl: 1.875rem;
    --text-3xl--line-height: 1.2;
    --text-4xl: 2.25rem;
    --text-4xl--line-height: 1.11111;
    --text-5xl: 3rem;
    --text-5xl--line-height: 1;
    --text-7xl: 4.5rem;
    --text-7xl--line-height: 1;

    --font-size-base: 1rem;
    --font-size-sm: .875rem;
    --font-size-lg: 1.125rem;
    --line-height-base: 1.5;

    --text-primary: #333;
    --bg-primary: #fff;
}
/*
@media (min-width: 768px) {
    :root {
        --font-size-base: 1rem;
        --font-size-sm: .875rem;
        --font-size-lg: 1.125rem;
    }
}
@media (min-width: 1024px) {
    :root {
        --font-size-base: 1.125rem;
        --font-size-sm: 1rem;
        --font-size-lg: 1.5rem;
        --line-height-base: 
    }
}
*/
  
/* Base styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family-sans);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-primary);
}

body {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Sidebar styles */
.sidebar {
    width: 280px;
    background-color: #f5f5f7;
    padding: 20px;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100vh;
    transition: transform 0.3s ease;
    z-index: 10;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 30px;
}

.menu-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    color: #0066cc;
    cursor: pointer;
}

.menu-item svg {
    margin-right: 10px;
}

/*
.upload-area {
    border: 1px dashed #ccc;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    margin: 10px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}*/
.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    border: 1px dashed #ccc;
    border-radius: 8px;
    padding: 15px;
}

.upload-area .upload-icon-label {
    display: flex;
    align-items: center;
    gap: 8px;
}
.upload-area .file-upload {
    cursor: pointer;
    color: #4259ff;
}
.upload-area.dragover {
    background-color: #e6f7ff;
    border-color: #1890ff;
}

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

.file-item {
    display: flex;
    align-items: center;
    padding: 10px 5px;
    margin-bottom: 5px;
    border-radius: 4px;
    position: relative;
}

.file-item.selected {
    background-color: #e6e6e6;
}

.file-item input[type="checkbox"] {
    margin-right: 10px;
}

.file-item .delete-icon {
    position: absolute;
    right: 5px;
    color: #888;
    cursor: pointer;
}

.sidebar-section {
    margin-top: 20px;
}

/* Main content area styles */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-primary);
    height: 100vh;
    position: relative;
}

.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 140px; /* Space for the fixed footer */
}

.message {
    margin-bottom: 30px;
    max-width: 99%;
}

.message.user-message {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.message-header {
    margin-bottom: 5px;
    font-size: 0.9em;
    color: #666;
}

.message-content {
    padding: 15px;
    /*background-color: #f9f9f9;*/
    border-radius: 24px;
}
.message-content .filename {
    font-weight: bold;
}

.user-message .message-content {
    max-width: 80%;
    word-wrap: break-word;
    white-space: pre-wrap;
    background-color: #f9f9f9;
}

/* Chat footer with input */
.chat-footer {
    position: fixed;
    bottom: 0;
    right: 0;
    width: calc(100% - 280px);
    background-color: #fff;
    padding: 15px 20px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.input-area {
    padding: 15px;
    background-color: #f5f5f7;
    border-radius: 16px;
    display: flex;
    align-items: flex-end; /* Align items to the bottom for textarea */
}

/* Auto-expanding textarea */
.input-area textarea {
    flex: 1;
    padding: 10px;
    border: none;
    background-color: transparent;
    font-size: 16px;
    outline: none;
    resize: none;
    overflow: hidden; /* Hide scrollbar */
    line-height: 1.5;
    max-height: calc(7 * 1.5em + 20px); /* Maximum height for 7 lines */
    min-height: calc(1 * 1.5em + 20px); /* Minimum height for 1 line */
}

.send-button {
    background-color: #e0e0e0;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    min-width: 36px; /* Ensure fixed width */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-left: 8px;
}

.send-button:hover {
    background-color: #d0d0d0;
}

/* 중단 버튼 스타일 추가 */
.send-button.stop-button {
    background-color: #ffebeb;
}

.send-button.stop-button:hover {
    background-color: #ffd1d1;
}

/* 중단 버튼 내부 아이콘 사이즈 조정 */
.send-button.stop-button svg rect {
    rx: 1px; /* 모서리 살짝 둥글게 */
}

.disclaimer {
    text-align: center;
    margin-top: 10px;
    font-size: 12px;
    color: #888;
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 20;
    cursor: pointer;
    background-color: #fff;
    border-radius: 4px;
    padding: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 5px 0;
    border-radius: 3px;
}

/* Mobile responsive styles */
@media screen and (max-width: 768px) {
    body {
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        transform: translateX(-100%);
        width: 80%;
        max-width: 300px;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        width: 100%;
    }
    
    .chat-footer {
        width: 100%;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .messages-container {
        padding-top: 60px; /* Space for the mobile toggle button */
    }
}

/* For very small screens */
@media screen and (max-width: 480px) {
    .message {
        max-width: 100%;
    }
    
    .input-area {
        padding: 10px;
    }
    
    .input-area textarea {
        font-size: 14px;
    }
}
