:root {
    --bg-color: #EE5253;
    --sidebar-bg: #2d3436;
    --sidebar-text: #dfe6e9;
    --bot-bg: #FFFFFF;
    --bot-text: #2d3436;
    --user-bg: #C44545;
    --user-text: #FFFFFF;
    --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 10px 20px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 20px 40px rgba(0, 0, 0, 0.2);
    --border-radius: 4px;
    --transition-speed: 0.3s;
    --font-primary: 'Roboto Slab', serif;
    --font-secondary: 'Inter', sans-serif;
}




* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
}



body {
    background-color: var(--bg-color);
    color: var(--bot-text);
    font-family: var(--font-primary);
    height: 100vh;
    display: flex;
    overflow: hidden;
}



.app-layout {
    display: flex;
    width: 100%;
    height: 100%;
}



.sidebar {
    width: 300px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform var(--transition-speed) ease;
    z-index: 20;
}



.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
}


.sidebar-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}


.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}


.tool-section h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 10px;
    font-family: var(--font-secondary);
}


.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}


.calc-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--sidebar-text);
    padding: 10px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-family: var(--font-secondary);
    font-size: 0.9rem;
    transition: all 0.2s;
    text-align: center;
}



.calc-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}


.calc-btn:active {
    transform: translateY(0);
}


.graph-container {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
    padding: 10px;
    height: 200px;
    position: relative;
}


#graphInput {
    width: 100%;
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px;
    border-radius: 4px;
}

.status-text {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
}



.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.navbar {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 30px;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(238, 82, 83, 0.95) 0%, rgba(238, 82, 83, 0) 100%);
}


.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: white;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 15px;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}


.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    scroll-behavior: smooth;
}



.chat-content {
    width: 100%;
    max-width: 900px;
    padding: 0 20px 160px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}



.empty-state {
    margin-top: 10vh;
    text-align: center;
    color: white;
    animation: fadeIn 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}



.empty-state h1 {
    font-size: 2.5rem;
    margin-bottom: 16px;
    font-weight: 700;
    letter-spacing: 1px;
}



.empty-state p {
    opacity: 0.9;
    font-family: var(--font-secondary);
    font-size: 1rem;
    margin-bottom: 50px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.suggestions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}


.suggestion-chip {
    background: var(--user-bg);
    color: white;
    padding: 16px 32px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-medium);
}



.suggestion-chip:hover {
    transform: translateY(-4px);
    background: #d63031;
    box-shadow: var(--shadow-heavy);
}

.message {
    display: flex;
    gap: 24px;
    opacity: 0;
    animation: slideUp 0.5s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
    align-items: flex-start;
    width: 100%;
}

.message.user {
    flex-direction: row-reverse;
}

.avatar {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.bot .avatar {
    background: white;
    border: 2px solid white;
}

.bot .avatar span {
    color: var(--bg-color);
    font-size: 32px;
}

.user .avatar span {
    color: white;
    font-size: 28px;
}

.message-bubble {
    max-width: 85%;
    padding: 30px 40px;
    font-size: 1.05rem;
    line-height: 1.8;
    position: relative;
    box-shadow: var(--shadow-medium);
    min-height: 60px;
    font-family: var(--font-secondary);
}

.message.bot .message-bubble {
    background: var(--bot-bg);
    color: var(--bot-text);
    border-radius: var(--border-radius);
    border-left: 6px solid var(--sidebar-bg);
}

.message.bot .message-bubble::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 24px;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 12px solid var(--bot-bg);
}



.message.user .message-bubble {
    background: var(--user-bg);
    color: var(--user-text);
    border-radius: var(--border-radius);
    border-right: 6px solid rgba(0, 0, 0, 0.2);
}

.message.user .message-bubble::after {
    content: '';
    position: absolute;
    right: -12px;
    top: 24px;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 12px solid var(--user-bg);
}



.message-bubble p {
    margin-bottom: 16px;
}

.message-bubble p:last-child {
    margin-bottom: 0;
}

.message-bubble strong {
    font-weight: 700;
    color: #000;
}

.message-bubble ul, .message-bubble ol {
    margin-left: 24px;
    margin-bottom: 16px;
}



.message-bubble h1, .message-bubble h2, .message-bubble h3 {
    font-weight: 700;
    margin-top: 24px;

    margin-bottom: 12px;
    font-size: 1.2em;
    border-bottom: 2px solid #eee;
    padding-bottom: 8px;
    color: var(--bg-color);
    font-family: var(--font-primary);
}

.message-bubble pre {
    background: #f4f4f4;
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 20px 0;
    overflow-x: auto;
    border: 1px solid #ddd;
    font-size: 0.95em;
    font-family: 'JetBrains Mono', monospace;
}



.message.user .message-bubble pre {
    background: rgba(0, 0, 0, 0.2);
    border: none;
    color: white;
}

.katex-display {
    margin: 1.5em 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 16px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: var(--border-radius);
}



.input-container {
    position: fixed;
    bottom: 0;
    left: 300px;
    right: 0;
    padding: 40px;
    background: transparent;
    display: flex;
    justify-content: center;
    z-index: 50;
    background: linear-gradient(to top, var(--bg-color) 80%, transparent 100%);
    pointer-events: none;
}



.input-wrapper {
    width: 100%;
    max-width: 900px;
    position: relative;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}



.image-preview-container {
    display: none;
    background: white;
    padding: 10px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    width: fit-content;
    position: relative;
    animation: slideUp 0.3s ease;
}

.image-preview-container img {
    max-height: 100px;
    border-radius: 4px;
    display: block;
}



.remove-image {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--sidebar-bg);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
}


.input-box {
    width: 100%;
    background: white;
    border-radius: var(--border-radius);
    padding: 12px 12px 12px 24px;
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-heavy);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.input-box:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

#fileInput {
    display: none;
}


.input-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: #333;
    font-family: var(--font-primary);
    font-size: 1.1rem;
    padding: 12px 0;
}

.input-box input::placeholder {
    color: #999;
    font-family: var(--font-secondary);
    font-size: 1rem;
    letter-spacing: 0.5px;
}



.action-btn {
    background: transparent;
    border: none;
    color: #999;
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    margin-left: 5px;
}

.action-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}



.send-btn {
    background: var(--user-bg);
    color: white;
    border: none;
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    margin-left: 10px;
    box-shadow: var(--shadow-light);
}

.send-btn:hover {
    background: #a83232;
    transform: scale(1.05);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.typing-indicator {
    display: flex;
    gap: 6px;
    padding: 10px 0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #333;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}



.typing-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}



@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}


::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 900px) {
    .sidebar {
        display: none;
    }
    .input-container {
        left: 0;
    }
    .navbar {
        padding: 0 20px;
    }
}
