/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'SUIT', sans-serif;
}

body {
    font-family: 'SUIT', sans-serif;
    line-height: 1.6;
    color: #ffffff;
    background-color: #1c1c1e;
}

.base-link {
    color: #9DD158;
    text-decoration: none;
}

.auth-links {
    margin-top: 20px;
}

/* Login Page Styles */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0A0A0A 0%, #1A1A1A 50%, #2E7D32 100%);
    background-attachment: fixed;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background: #1c1c1e;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    text-align: center;
    border: 1px solid #3a3a3c;
}

.logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 20px;
}

.form-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: #ffffff;
    font-size: 14px;
}

.form-group input {
    padding: 14px 16px;
    border: 2px solid #3a3a3c;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 400;
    transition: all 0.3s ease;
    background: #2c2c2e;
    color: #ffffff;
}

.form-group input:focus {
    outline: none;
    border-color: #9DD158;
    background: #2c2c2e;
    box-shadow: 0 0 0 3px rgba(157, 209, 88, 0.2);
    transform: translateY(-1px);
}

.login-btn {
    padding: 14px 16px;
    background: linear-gradient(135deg, #9DD158 0%, #7CB342 100%);
    color: #0A0A0A;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    background: linear-gradient(135deg, #7CB342 0%, #2E7D32 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(157, 209, 88, 0.4);
}

.login-btn:active {
    transform: translateY(0);
}

/* Chat Page Styles */
.chat-container {
    display: flex;
    height: 100vh;
    background: #2c2c2e;
    font-family: 'SUIT', sans-serif;
    overflow: hidden; /* Prevent page scroll */
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: #1c1c1e;
    border-right: 1px solid #3a3a3c;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar.collapsed {
    width: 60px;
    overflow: visible; /* Allow tooltips and hover effects */
}

.sidebar.collapsed .sidebar-top {
    padding: 20px 8px;
    justify-content: center;
}

.sidebar-top {
    padding: 20px 16px;
    border-bottom: 1px solid #3a3a3c;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.sidebar-logo {
    width: 200px;
    flex-shrink: 0;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-logo {
    opacity: 0;
}

.sidebar-title {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .sidebar-title {
    opacity: 0;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    position: relative;
}

.sidebar.collapsed .sidebar-toggle {
    position: fixed;
    left: 12px;
    top: 28px;
    z-index: 1001;
    background: #3a3a3c;
    border: 1px solid #5a5a5c;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sidebar-toggle:hover {
    background: #3a3a3c;
}

.sidebar.collapsed .sidebar-toggle:hover {
    background: #4a4a4c;
    border-color: #6a6a6c;
}

.sidebar-toggle i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

/* Tooltip for collapsed toggle button */
.sidebar.collapsed .sidebar-toggle:hover::after {
    content: "Expand sidebar";
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
    background: #1a1a1a;
    color: #ffffff;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    border: 1px solid #3a3a3c;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sidebar-menu {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0; /* Allow shrinking */
    overflow: hidden; /* Prevent overflow */
}

.sidebar.collapsed .sidebar-menu {
    padding: 16px 8px;
    align-items: center;
}

.new-chat-btn {
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: 1px solid #5a5a5c;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
}

.sidebar.collapsed .new-chat-btn {
    width: 44px;
    height: 44px;
    padding: 12px;
    justify-content: center;
    border-radius: 50%;
    position: relative;
}

.new-chat-btn:hover {
    background: #3a3a3c;
    border-color: #6a6a6c;
}

.new-chat-btn i {
    font-size: 16px;
    flex-shrink: 0;
}

.new-chat-btn span {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .new-chat-btn span {
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

/* Tooltip for collapsed new chat button */
.sidebar.collapsed .new-chat-btn:hover::after {
    content: "New chat";
    position: absolute;
    left: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: #1a1a1a;
    color: #ffffff;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    border: 1px solid #3a3a3c;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.conversation-history {
    margin-top: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0; /* Allow shrinking */
    overflow: hidden; /* Prevent overflow from parent */
}

.section-title {
    display: flex;
    align-items: center;
    padding: 0 4px;
    margin-bottom: 8px;
}

.section-text {
    color: #9a9a9c;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .section-text {
    opacity: 0;
}

.conversation-list {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1; /* Take remaining space */
    min-height: 0; /* Allow shrinking */
    padding: 0 2px;
    scrollbar-width: thin;
    scrollbar-color: #5a5a5c transparent;
}

.conversation-list::-webkit-scrollbar {
    width: 4px;
}

.conversation-list::-webkit-scrollbar-track {
    background: transparent;
}

.conversation-list::-webkit-scrollbar-thumb {
    background: #5a5a5c;
    border-radius: 2px;
}

.conversation-list::-webkit-scrollbar-thumb:hover {
    background: #6a6a6c;
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #2c2c2e;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #5a5a5c;
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #6a6a6c;
}

.conversation-item {
    padding: 0;
    background: transparent;
    border: 1px solid #3a3a3c;
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
    word-break: break-word;
    position: relative;
    margin-bottom: 8px;
    overflow: hidden;
}

.conversation-item:hover {
    background: #3a3a3c;
    border-color: #5a5a5c;
}

.conversation-item.active {
    background: #9DD158;
    color: #000000;
    border-color: #9DD158;
}

.conversation-header {
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.conversation-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.conversation-title {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.conversation-preview {
    font-size: 12px;
    color: #bababa;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
}

.conversation-item.active .conversation-preview {
    color: #2c2c2e;
}

.conversation-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 2px;
}

.conversation-date {
    font-size: 11px;
    color: #9a9a9c;
    font-weight: 500;
}

.conversation-item.active .conversation-date {
    color: #2c2c2e;
}

.conversation-store {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #9a9a9c;
}

.conversation-item.active .conversation-store {
    color: #2c2c2e;
}

.store-icon {
    font-size: 10px;
    color: inherit;
}

.store-type {
    font-weight: 500;
}

.delete-conversation-btn {
    background: transparent;
    border: none;
    color: #9a9a9c;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    line-height: 1;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    opacity: 0.7;
}

.conversation-item:hover .delete-conversation-btn {
    opacity: 1;
    color: #ef5350;
}

.delete-conversation-btn:hover {
    background: rgba(239, 83, 80, 0.15);
    color: #ef5350 !important;
    transform: scale(1.1);
}

.conversation-item.active .delete-conversation-btn {
    color: #2c2c2e;
    opacity: 0.8;
}

.conversation-item.active:hover .delete-conversation-btn {
    opacity: 1;
    color: #d32f2f;
}

.conversation-item.active .delete-conversation-btn:hover {
    background: rgba(211, 47, 47, 0.15);
    color: #d32f2f !important;
}

/* Collapsed sidebar styles */
.sidebar.collapsed .conversation-history {
    opacity: 0;
    pointer-events: none;
    height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, height 0.3s ease;
}

.sidebar.collapsed .conversation-item {
    opacity: 0;
    transform: translateX(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Add a subtle indicator for conversation count in collapsed state */
.sidebar.collapsed .sidebar-menu::before {
    content: "";
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #9DD158;
    border-radius: 50%;
    opacity: 0.7;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid #3a3a3c;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar.collapsed .sidebar-footer {
    padding: 16px 8px;
    align-items: center;
}

.user-info {
    color: #ffffff;
    font-size: 14px;
    padding: 8px 0;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .user-info {
    opacity: 0;
    height: 0;
    padding: 0;
    overflow: hidden;
}

.change-password-btn,
.logout-btn {
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid #5a5a5c;
    border-radius: 6px;
    color: #ffffff;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.sidebar.collapsed .change-password-btn,
.sidebar.collapsed .logout-btn {
    width: 36px;
    height: 36px;
    padding: 8px;
    border-radius: 50%;
    justify-content: center;
}

.change-password-btn:hover,
.logout-btn:hover {
    background: #3a3a3c;
    border-color: #6a6a6c;
}

.change-password-btn i,
.logout-btn i {
    font-size: 12px;
    flex-shrink: 0;
}

.sidebar.collapsed .change-password-btn i,
.sidebar.collapsed .logout-btn i {
    font-size: 14px;
}

.sidebar.collapsed .change-password-btn span,
.sidebar.collapsed .logout-btn span {
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

/* Tooltips for collapsed buttons */
.sidebar.collapsed .change-password-btn:hover::after {
    content: "Change Password";
    position: absolute;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: #1a1a1a;
    color: #ffffff;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    border: 1px solid #3a3a3c;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.sidebar.collapsed .logout-btn:hover::after {
    content: "Logout";
    position: absolute;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: #1a1a1a;
    color: #ffffff;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    border: 1px solid #3a3a3c;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.language-switcher {
    display: flex;
    align-items: center;
}

.sidebar-footer .language-switcher {
    width: 100%;
}

.language-toggle {
    background: transparent;
    border: 1px solid #5a5a5c;
    border-radius: 6px;
    color: #ffffff;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.sidebar-footer .language-toggle {
    position: relative;
}

.sidebar.collapsed .sidebar-footer .language-toggle {
    width: 36px;
    height: 36px;
    padding: 8px;
    border-radius: 50%;
    justify-content: center;
}

.language-toggle:hover {
    background: #3a3a3c;
    border-color: #6a6a6c;
}

.language-toggle i {
    font-size: 12px;
    flex-shrink: 0;
}

.sidebar.collapsed .language-toggle i {
    font-size: 14px;
}

.language-text {
    display: flex;
    align-items: center;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .language-text {
    opacity: 0;
    position: absolute;
    pointer-events: none;
}

.language-separator {
    margin: 0 4px;
    color: #9a9a9c;
}

/* Tooltip for collapsed language toggle */
.sidebar.collapsed .language-toggle:hover::after {
    content: "Switch Language";
    position: absolute;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: #1a1a1a;
    color: #ffffff;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    border: 1px solid #3a3a3c;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Input Actions Styles */
.input-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.attach-btn {
    background: transparent;
    border: none;
    color: #9a9a9c;
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.attach-btn:hover {
    background: #5a5a5c;
    color: #ffffff;
}

/* Main Chat Area */
.main-chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #2c2c2e;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 0; /* Allow shrinking */
    scrollbar-width: thin;
    scrollbar-color: #5a5a5c #2c2c2e;
    background: #2c2c2e;
}

.message {
    display: flex;
    gap: 20px;
    max-width: 75%;
    margin-bottom: 0;
    align-items: flex-start;
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
    margin-left: 20%;
}

.message.assistant {
    align-self: flex-start;
    margin-right: 20%;
}

.message-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
}

.message-timestamp {
    font-size: 11px;
    color: #8e8e93; /* Gray timestamp */
    opacity: 0.7;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    flex-shrink: 0;
    margin-top: 2px;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #9DD158 0%, #7CB342 100%);
    color: #000000;
    border-color: rgba(157, 209, 88, 0.2);
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, #4a4a4c 0%, #3a3a3c 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.1);
}

.message-content {
    background: #3a3a3c;
    padding: 16px 20px;
    border-radius: 20px;
    color: #ffffff;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    min-width: 0;
    font-size: 15px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.message.user .message-content {
    background: linear-gradient(135deg, #9DD158 0%, #7CB342 100%);
    color: #000000;
    border-color: rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

.message.assistant .message-content {
    background: #3a3a3c;
    border-color: rgba(255, 255, 255, 0.1);
    position: relative;
    padding-bottom: 40px;
}

/* Add subtle animation for new messages */
.message {
    animation: messageSlideIn 0.3s ease-out;
}

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

/* Message content typography */
.message-content p {
    margin: 0 0 12px 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul,
.message-content ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message-content li {
    margin: 4px 0;
}

.message-content strong {
    font-weight: 600;
}

.message-content em {
    font-style: italic;
}

.message-content code {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.message.user .message-content code {
    background: rgba(0, 0, 0, 0.1);
}

/* Time stamps */
.message-time {
    font-size: 11px;
    color: #9a9a9c;
    margin-top: 4px;
    text-align: right;
    opacity: 0.7;
}

.message.user .message-time {
    color: rgba(0, 0, 0, 0.6);
    text-align: left;
}

/* Chat Input Container */
.chat-input-container {
    padding: 20px;
    border-top: 1px solid #3a3a3c;
    background: #3a3a3c;
}

.input-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    max-width: 800px;
    margin: 0 auto;
}

.message-input {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    padding: 12px 16px;
    border: 2px solid #5a5a5c;
    border-radius: 22px;
    background: transparent;
    color: #ffffff;
    font-size: 14px;
    font-family: 'SUIT', sans-serif;
    resize: none;
    outline: none;
    transition: all 0.2s ease;
    overflow: hidden;
}

.message-input::placeholder {
    color: #9a9a9c;
}

.message-input:focus {
    border-color: #9DD158;
    box-shadow: 0 0 0 2px rgba(157, 209, 88, 0.2);
}

.send-btn {
    width: 44px;
    height: 44px;
    background: #9DD158;
    border: none;
    border-radius: 50%;
    color: #000000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.send-btn:hover {
    background: #7CB342;
    transform: scale(1.05);
}

.send-btn:active {
    transform: scale(0.95);
}

.send-btn:disabled {
    background: #5a5a5c;
    color: #9a9a9c;
    cursor: not-allowed;
    transform: none;
}

/* Welcome Page Styles */
.welcome-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #2c2c2e;
    font-family: 'SUIT', sans-serif;
    overflow: auto;
    position: relative;
}

/* Top left corner Chat History button */
.top-left-buttons {
    position: absolute;
    top: 20px;
    left: 24px;
    z-index: 100;
}

.chat-history-btn {
    background: rgba(58, 58, 60, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid #5a5a5c;
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-family: 'SUIT', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.chat-history-btn:hover {
    background: rgba(157, 209, 88, 0.2);
    border-color: #9DD158;
    color: #9DD158;
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(157, 209, 88, 0.2);
}

/* Top right corner language switcher */
.top-right-buttons {
    position: absolute;
    top: 20px;
    right: 24px;
    z-index: 100;
}

.top-right-buttons .language-toggle {
    background: rgba(58, 58, 60, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid #5a5a5c;
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-family: 'SUIT', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.top-right-buttons .language-toggle:hover {
    background: rgba(157, 209, 88, 0.2);
    border-color: #9DD158;
    color: #9DD158;
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(157, 209, 88, 0.2);
}

.welcome-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 24px;
}

.welcome-greeting {
    margin-bottom: 40px;
}

.main-greeting {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.sub-greeting {
    font-size: 18px;
    font-weight: 400;
    color: #bababa;
    line-height: 1.4;
}

.welcome-input-container {
    width: 100%;
    max-width: 600px;
    margin-bottom: 40px;
}

.welcome-input-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    background: #3a3a3c;
    border: 2px solid #5a5a5c;
    border-radius: 25px;
    padding: 4px 4px 4px 20px;
    transition: all 0.2s ease;
}

.welcome-input-row:focus-within {
    border-color: #9DD158;
    box-shadow: 0 0 0 2px rgba(157, 209, 88, 0.2);
}

.welcome-input {
    flex: 1;
    min-height: 40px;
    max-height: 120px;
    padding: 12px 10px;
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 16px;
    font-family: 'SUIT', sans-serif;
    resize: none;
    outline: none;
    max-width: 80%;
}

.welcome-input::placeholder {
    color: #9a9a9c;
}

.welcome-send-btn {
    width: 40px;
    height: 40px;
    background: #9DD158;
    border: none;
    border-radius: 50%;
    color: #000000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.welcome-send-btn:hover {
    background: #7CB342;
    transform: scale(1.05);
}

.welcome-send-btn:active {
    transform: scale(0.95);
}

.welcome-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    width: 100%;
    max-width: 800px;
}

.action-card {
    background: #3a3a3c;
    border: 1px solid #5a5a5c;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-card:hover {
    background: #4a4a4c;
    border-color: #9DD158;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-icon {
    width: 44px;
    height: 44px;
    background: #9DD158;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #000000;
    flex-shrink: 0;
}

.card-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.card-content p {
    font-size: 14px;
    color: #bababa;
    line-height: 1.4;
}

/* Welcome Page Specific Elements */
.welcome-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0 20px 0;
    gap: 40px;
    overflow-y: auto;
    min-height: 0;
}

/* AI Icon */
.ai-icon-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.ai-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #9DD158 0%, #7CB342 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(157, 209, 88, 0.4);
    position: relative;
}

.ai-icon::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, #9DD158, #7CB342, #5a8a2e);
    border-radius: 22px;
    z-index: -1;
    opacity: 0.7;
    filter: blur(8px);
}

.checkmark {
    color: #000000;
    width: 24px;
    height: 24px;
}

/* Welcome Text */
.welcome-text {
    text-align: center;
    margin-bottom: 20px;
}

.ai-text {
    color: #9DD158;
    font-weight: 700;
}

.description {
    color: #bababa;
    font-size: 16px;
    line-height: 1.6;
    font-family: 'SUIT', sans-serif;
    margin-top: 16px;
}

.description p {
    margin: 4px 0;
}

/* Guide elements within description */
.description .guide-title {
    color: #9DD158;
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0 16px 0;
    font-family: 'SUIT', sans-serif;
}

.description .guide-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.description .guide-item {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.description .guide-label {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    font-family: 'SUIT', sans-serif;
}

.description .guide-example {
    color: #bababa;
    font-size: 13px;
    font-style: italic;
    padding-left: 8px;
    font-family: 'SUIT', sans-serif;
}

/* Welcome Chat Input */
.welcome-chat-input {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: #2c2c2e;
    border-top: 1px solid #3a3a3c;
    position: sticky;
    bottom: 0;
    z-index: 50;
}

.input-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #3a3a3c;
    border: 2px solid #5a5a5c;
    border-radius: 24px;
    padding: 8px 16px;
    box-shadow: 0 4px 20px rgba(157, 209, 88, 0.1);
    transition: all 0.2s ease;
}

.input-container:focus-within {
    border-color: #9DD158;
    box-shadow: 0 4px 20px rgba(157, 209, 88, 0.2);
}

/* Welcome Footer (Similar to sidebar footer) */
.welcome-footer {
    padding: 20px 24px;
    border-top: 1px solid #3a3a3c;
    background: #1c1c1e;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-footer .user-info {
    color: #ffffff;
}

.welcome-footer .user-info span {
    font-size: 16px;
    font-weight: 500;
    font-family: 'SUIT', sans-serif;
}

.footer-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

#welcomeUserName {
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
    font-family: 'SUIT', sans-serif;
    margin-right: 16px;
}

.language-separator {
    color: #8e8e93;
    margin: 0 4px;
}

.footer-btn {
    background: transparent;
    border: 1px solid #5a5a5c;
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'SUIT', sans-serif;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.footer-btn:hover {
    background: #3a3a3c;
    border-color: #9DD158;
    color: #9DD158;
}

.footer-btn.logout {
    color: #fca5a5;
    border-color: #dc2626;
}

.footer-btn.logout:hover {
    background: #dc2626;
    color: #ffffff;
    border-color: #b91c1c;
}


.copy-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: all 0.2s ease;
    font-size: 12px;
}

.copy-btn:hover {
    background: #f3f4f6;
}

.copy-btn:active {
    background: #e5e7eb;
    transform: scale(0.95);
}

/* Inline copy button at the bottom of assistant message content */
.message.assistant .message-row .copy-btn-inline {
    position: absolute;
    bottom: 8px;
    right: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
    transition: all 0.2s ease;
    font-size: 12px;
    flex-shrink: 0;
    z-index: 10;
}

.message.assistant .message-row .copy-btn-inline:hover {
    background: rgba(157, 209, 88, 0.1);
    border-color: rgba(157, 209, 88, 0.3);
    color: #9DD158;
    opacity: 1;
    transform: translateY(-1px);
}

.message.assistant .message-row .copy-btn-inline:active {
    transform: translateY(0) scale(0.95);
}


/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1001;
    background: rgba(58, 58, 60, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid #5a5a5c;
    color: #ffffff;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.mobile-menu-btn:hover {
    background: rgba(157, 209, 88, 0.2);
    border-color: #9DD158;
    color: #9DD158;
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(157, 209, 88, 0.2);
}

.mobile-menu-btn:active {
    transform: translateY(0) scale(0.95);
}

.mobile-menu-btn i {
    pointer-events: none;
}

/* Mobile Close Button */
.mobile-close-btn {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    margin-left: auto;
}

.mobile-close-btn:hover {
    background: rgba(220, 38, 38, 0.2);
    border-color: #dc2626;
    color: #dc2626;
}

.mobile-close-btn i {
    pointer-events: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar-toggle {
        display: none;
    }

    .chat-container {
        position: relative;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        background: #1c1c1e;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar.open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.3);
        z-index: -1;
    }
    
    .sidebar.collapsed {
        width: 60px;
        transform: translateX(-100%);
    }
    
    .sidebar.collapsed .sidebar-toggle {
        position: fixed;
        left: 8px;
        top: 20px;
        z-index: 1002;
    }
    
    .main-chat-area {
        width: 100%;
    }
    
    .message {
        max-width: 90%;
        margin-bottom: 0;
        gap: 12px;
    }
    
    .message.user {
        margin-left: 10%;
    }
    
    .message.assistant {
        margin-right: 10%;
    }
    
    .message-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .message-content {
        padding: 14px 16px;
        font-size: 14px;
        border-radius: 18px;
    }
    
    .chat-messages {
        padding: 20px 16px;
        gap: 20px;
    }
    
    .chat-input-container {
        padding: 16px;
    }
    
    .input-row {
        max-width: none;
    }
    
    .welcome-container {
        padding: 20px 16px;
    }
    
    .main-greeting {
        font-size: 28px;
    }
    
    .sub-greeting {
        font-size: 16px;
    }
    
    .welcome-actions {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .action-card {
        padding: 16px;
        min-height: 100px;
    }
    
    .card-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .card-content p {
        font-size: 13px;
    }
    
    /* Welcome page mobile styles */
    .top-left-buttons {
        top: 16px;
        left: 16px;
    }
    
    .chat-history-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .top-right-buttons {
        top: 16px;
        right: 16px;
    }
    
    .top-right-buttons .language-toggle {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .welcome-content {
        padding: 40px 16px 20px 16px;
        gap: 30px;
        min-height: 0;
        display: block;
    }
    
    .welcome-chat-input {
        padding: 16px;
        max-width: none;
    }
    
    .ai-icon {
        width: 64px;
        height: 64px;
    }
    
    .ai-icon::before {
        border-radius: 18px;
    }
    
    .description {
        font-size: 15px;
    }
    
    .description .guide-title {
        font-size: 15px;
        margin: 16px 0 12px 0;
    }
    
    .description .guide-items {
        gap: 10px;
    }
    
    .description .guide-label {
        font-size: 13px;
    }
    
    .description .guide-example {
        font-size: 12px;
    }
    
    .welcome-footer {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .footer-actions {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
    
    .footer-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1c1c1e;
}

::-webkit-scrollbar-thumb {
    background: #5a5a5c;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6a6a6c;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.modal-content {
    background: #2c2c2e;
    border: 1px solid #48484a;
    border-radius: 16px;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: slideUp 0.3s ease;
    margin: auto;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    cursor: auto;
}

/* Larger modal for change password */
#changePasswordModal .modal-content {
    max-width: 500px;
}

.modal-header {
    padding: 24px 24px 0 24px;
    border-bottom: 1px solid #48484a;
    background: #2c2c2e;
    border-radius: 16px 16px 0 0;
}

.modal-header h3 {
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
}

.modal-body {
    padding: 24px;
    background: #2c2c2e;
    max-height: 400px;
    overflow-y: auto;
}

.modal-body .form-group {
    margin-bottom: 20px;
}

.modal-body .form-group:last-child {
    margin-bottom: 0;
}

.modal-body .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #ffffff;
    font-size: 14px;
}

.modal-body .form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #48484a;
    border-radius: 12px;
    font-size: 16px;
    background: #1c1c1e;
    color: #ffffff;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.modal-body .form-group input:focus {
    outline: none;
    border-color: #9DD158;
    background: #1c1c1e;
    box-shadow: 0 0 0 3px rgba(157, 209, 88, 0.2);
    transform: translateY(-1px);
}

.modal-body .form-group input::placeholder {
    color: #8e8e93;
}

.modal-body p {
    margin: 0 0 16px 0;
    color: #ffffff;
    line-height: 1.5;
    font-size: 14px;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-warning {
    color: #ff453a !important;
    font-size: 14px;
    font-weight: 500;
    background: rgba(255, 69, 58, 0.1);
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid #ff453a;
}

.modal-footer {
    padding: 0 24px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: #2c2c2e;
    border-radius: 0 0 16px 16px;
}

.btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.btn-secondary {
    background: #48484a;
    color: #ffffff;
    border-color: #48484a;
}

.btn-secondary:hover {
    background: #5a5a5c;
    border-color: #5a5a5c;
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #ff453a 0%, #d70015 100%);
    color: #ffffff;
    border-color: #ff453a;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #d70015 0%, #a50000 100%);
    border-color: #d70015;
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, #9DD158 0%, #7CB342 100%);
    color: #0a0a0a;
    border-color: #9DD158;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #7CB342 0%, #2E7D32 100%);
    border-color: #7CB342;
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn:disabled:hover {
    transform: none;
}

/* Error and Success Messages */
.error-message {
    color: #ff453a;
    background: rgba(255, 69, 58, 0.1);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border-left: 4px solid #ff453a;
    margin-top: 16px;
}

.success-message {
    color: #32d74b;
    background: rgba(50, 215, 75, 0.1);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    border-left: 4px solid #32d74b;
    margin-top: 16px;
}

/* Modal Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* Mobile Responsive Modal */
@media (max-width: 768px) {
    .modal {
        padding: 16px;
    }
    
    .modal-content {
        width: 95%;
        max-width: none;
        margin: 0;
    }
    
    .modal-header {
        padding: 20px 20px 0 20px;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-footer {
        padding: 0 20px 20px 20px;
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }
}

/* Additional utility classes */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Social Sharing Styles */
.social-share-container {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.social-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 18px;
    color: #ffffff;
    text-decoration: none;
}

.social-share-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.social-share-btn.facebook {
    background: #1877f2;
}

.social-share-btn.twitter {
    background: #1da1f2;
}

.social-share-btn.linkedin {
    background: #0077b5;
}

.social-share-btn.telegram {
    background: #0088cc;
}

.social-share-btn.whatsapp {
    background: #25d366;
}

.social-share-btn.kakao {
    background: #fee500;
    color: #000000;
}

.social-share-text {
    color: #bababa;
    font-size: 14px;
    margin-bottom: 12px;
    text-align: center;
    font-family: 'SUIT', sans-serif;
}

/* Floating Social Share Button */
.floating-share-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    background: #9DD158;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(157, 209, 88, 0.4);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #000000;
    transition: all 0.3s ease;
}

.floating-share-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(157, 209, 88, 0.6);
}

.share-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: #2c2c2e;
    border: 1px solid #3a3a3c;
    border-radius: 12px;
    padding: 16px;
    display: none;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.share-menu.active {
    display: flex;
}

.share-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    border-radius: 8px;
    font-family: 'SUIT', sans-serif;
    font-size: 14px;
    transition: all 0.2s ease;
}

.share-menu-item:hover {
    background: #3a3a3c;
}
