@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap");

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

:root {
    --text-color: #edf3ff;
    --subheading-color: #a8b9df;
    --placeholder-color: #c3cdde;
    --primary-color: #0f1524;
    --secondary-color: #1e2740;
    --secondary-hover-color: #2a365a;
    --scrollbar-color: #4a5574;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --error-color: #ef4444;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --purple-color: #8b5cf6;
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --message-max-width: 85%;
}

body.light-theme {
    --text-color: #1e293b;
    --subheading-color: #64748b;
    --placeholder-color: #94a3b8;
    --primary-color: #f8fafc;
    --secondary-color: #e2e8f0;
    --secondary-hover-color: #cbd5e1;
    --scrollbar-color: #94a3b8;
}

body {
    color: var(--text-color);
    background: var(--primary-color);
    transition: background-color var(--transition), color var(--transition);
    min-height: 100vh;
    position: relative;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
    background-attachment: fixed;
    font-size: 16px;
    line-height: 1.5;
}

/* Preloader styles */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease, transform 0.8s ease;
}

.preloader-spinner {
    position: relative;
    width: 140px;
    height: 140px;
    margin-bottom: 25px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 6px solid transparent;
    border-top-color: var(--accent-color);
    border-bottom-color: var(--purple-color);
    animation: spin 1.8s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
}

.spinner-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color), var(--purple-color));
    opacity: 0.8;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite alternate;
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.5);
}

.preloader-text {
    font-size: 2.8rem;
    font-weight: 600;
    background: linear-gradient(to right, var(--accent-color), var(--purple-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
    filter: drop-shadow(0 2px 2px rgba(139, 92, 246, 0.3));
    animation: textPulse 2.5s ease-in-out infinite alternate;
}

.preloader-subtext {
    color: var(--subheading-color);
    font-size: 1.3rem;
    animation: fadeInOut 2.5s ease-in-out infinite;
    letter-spacing: 0.5px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(720deg);
    }
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.7);
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.8;
    }
}

@keyframes fadeInOut {

    0%,
    100% {
        opacity: 0.5;
        transform: translateY(5px);
    }

    50% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes textPulse {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.05);
    }
}

/* Preloader fade-out animation */
.preloader.fade-out {
    opacity: 0;
    transform: scale(1.2) translateY(-10%);
    visibility: hidden;
    transition: opacity 0.8s ease, transform 1s ease, visibility 0s 0.8s;
}

.preloader.fade-out .spinner-ring {
    animation: spin 0.8s cubic-bezier(0.8, 0, 0.2, 1) infinite, expandOut 0.8s forwards;
}

.preloader.fade-out .spinner-core {
    animation: pulse 0.8s cubic-bezier(0.4, 0, 0.6, 1) infinite alternate, glowExpand 0.8s forwards;
}

.preloader.fade-out .preloader-text {
    transform: translateY(-30px) scale(0.9);
    opacity: 0;
    transition: transform 0.6s ease, opacity 0.6s ease;
}

.preloader.fade-out .preloader-subtext {
    transform: translateY(30px);
    opacity: 0;
    transition: transform 0.6s ease, opacity 0.6s ease;
}

@keyframes expandOut {
    to {
        transform: scale(1.8) rotate(360deg);
        opacity: 0;
        border-width: 2px;
    }
}

@keyframes glowExpand {
    to {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
        box-shadow: 0 0 50px rgba(139, 92, 246, 0.8);
    }
}

.container {
    overflow-y: auto;
    padding: 24px 0 100px;
    height: 100vh;
    scrollbar-color: var(--scrollbar-color) transparent;
    scroll-behavior: smooth;
}

.container::-webkit-scrollbar {
    width: 6px;
}

.container::-webkit-scrollbar-track {
    background: transparent;
}

.container::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-color);
    border-radius: 10px;
}

.container :where(.app-header, .suggestions, .message, .prompt-wrapper) {
    position: relative;
    margin: 0 auto;
    width: 100%;
    padding: 0 20px;
    max-width: 1000px;
}

/* Content loaded animations */
body:not(.content-loaded) .app-header,
body:not(.content-loaded) .suggestions,
body:not(.content-loaded) .prompt-container,
body:not(.content-loaded) .action-buttons {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

body.content-loaded .app-header {
    animation: fadeSlideDown 0.8s ease-out forwards;
}

body.content-loaded .suggestions {
    animation: fadeIn 0.8s ease-out 0.3s forwards;
}

body.content-loaded .prompt-container {
    animation: slideUp 0.5s ease-out 0.6s forwards;
}

body.content-loaded .action-buttons {
    animation: fadeSlideLeft 0.5s ease-out 0.8s forwards;
}

/* Header animations and styling */
.container .app-header {
    text-align: center;
    margin-top: 5vh;
    padding-bottom: 24px;
    position: relative;
    opacity: 0;
    /* Start hidden */
}

@keyframes fadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.app-header::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 3px;
    background: linear-gradient(to right, var(--accent-color), #8b5cf6);
    border-radius: 3px;
}

.badge {
    font-size: 0.9rem;
    font-weight: 600;
    background: linear-gradient(to right, var(--accent-color), #8b5cf6);
    color: white;
    padding: 4px 12px;
    margin-left: 12px;
    border-radius: 20px;
    vertical-align: middle;
    -webkit-text-fill-color: white;
    animation: pulse 2.5s infinite;
    display: inline-block;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

.app-header .heading {
    width: fit-content;
    margin: 0 auto;
    font-size: 2.75rem;
    background: linear-gradient(to right, var(--accent-color), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(59, 130, 246, 0.1);
    position: relative;
    display: inline-block;
}

.app-header .heading::before {
    content: "✨";
    position: absolute;
    top: -10px;
    left: -30px;
    font-size: 1.5rem;
    animation: sparkle 3s ease-in-out infinite;
}

.app-header .heading::after {
    content: "✨";
    position: absolute;
    bottom: 0;
    right: -30px;
    font-size: 1.5rem;
    animation: sparkle 3s ease-in-out 1.5s infinite;
}

@keyframes sparkle {

    0%,
    100% {
        opacity: 0.8;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.app-header .sub-heading {
    font-size: 1.25rem;
    margin-top: 10px;
    color: var(--subheading-color);
    font-weight: 400;
}

/* Suggestion cards */
.container .suggestions {
    width: 100%;
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 5vh;
    padding: 0 20px 20px;
    opacity: 0;
    /* Start hidden */
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.suggestions .suggestions-item {
    cursor: pointer;
    padding: 24px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    justify-content: space-between;
    background: var(--secondary-color);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: 180px;
    position: relative;
    overflow: hidden;
}

.suggestions .suggestions-item::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 120px;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.05));
    border-radius: 0 0 0 100%;
}

.suggestions .suggestions-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
}

.suggestions .suggestions-item .text {
    font-size: 1.1rem;
    line-height: 1.5;
    z-index: 1;
    font-weight: 500;
}

.suggestions .suggestions-item .icon {
    width: 50px;
    height: 50px;
    display: flex;
    padding: 15px;
    font-size: 1.9rem;
    margin-top: 2px;
    align-self: flex-end;
    align-items: center;
    border-radius: 50%;
    justify-content: center;
    color: var(--accent-color);
    background: var(--primary-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.suggestions .suggestions-item:hover .icon {
    transform: scale(1.1) rotate(10deg);
}

.suggestions .suggestions-item:nth-child(2) .icon {
    color: var(--success-color);
}

.suggestions .suggestions-item:nth-child(3) .icon {
    color: var(--warning-color);
}

.suggestions .suggestions-item:nth-child(4) .icon {
    color: var(--purple-color);
}

/* Chat messages */
.container .chats-container {
    display: flex;
    gap: 32px;
    flex-direction: column;
    padding: 20px;
    max-width: 1000px;
    margin: 0 auto;
    margin-bottom: 20%;
}

.chats-container .message {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    animation: messageFadeIn 0.5s ease;
    border-radius: 20px;
    padding: 8px;
    transition: var(--transition);
    width: 100%;
    position: relative;
}

@keyframes messageFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chats-container .message:hover {
    background: rgba(255, 255, 255, 0.03);
}

.chats-container .message::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.chats-container .message:hover::after {
    opacity: 1;
}

.chats-container .message .avatar-container {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    align-self: flex-start;
    border-radius: 12px;
    padding: 0;
    margin-top: 5px;
    background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: avatarPulse 2s infinite alternate ease-in-out;
}

@keyframes avatarPulse {
    0% {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    100% {
        box-shadow: 0 2px 15px rgba(59, 130, 246, 0.3);
    }
}

.chats-container .message .avatar-inner {
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm-1-13h2v6h-2zm0 8h2v2h-2z'/%3E%3C/svg%3E");
    background-size: contain;
}

.chats-container .message.loading .avatar-container {
    overflow: hidden;
    position: relative;
}

.chats-container .message.loading .avatar-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.chats-container .message .message-text {
    padding: 16px 20px;
    word-wrap: break-word;
    white-space: pre-line;
    line-height: 1.7;
    font-size: 1rem;
    flex: 1;
    border-radius: 0;
    max-width: var(--message-max-width);
    transition: all 0.3s ease;
}

.chats-container .bot-message {
    margin: 10px auto;
    position: relative;
    width: 100%;
}

.chats-container .bot-message .message-text {
    background: rgba(59, 130, 246, 0.08);
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: 3px solid var(--accent-color);
    transition: all 0.3s ease;
}

.chats-container .bot-message:hover .message-text {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    background: rgba(59, 130, 246, 0.12);
}

.chats-container .user-message {
    flex-direction: row-reverse;
    margin-left: auto;
}

.chats-container .user-message .message-text {
    padding: 16px 20px;
    background: var(--secondary-color);
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    align-self: flex-end;
    margin-left: auto;
    border-right: 3px solid var(--accent-color);
    transition: all 0.3s ease;
}

.chats-container .user-message:hover .message-text {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    background: var(--secondary-hover-color);
}

.chats-container .user-message .img-attachment {
    margin-top: 12px;
    width: 60%;
    max-width: 400px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    object-fit: cover;
    max-height: 300px;
    border: 3px solid var(--secondary-color);
    transition: transform 0.3s ease;
}

.chats-container .user-message .img-attachment:hover {
    transform: scale(1.02);
}

.chats-container .user-message .file-attachment {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 14px 18px;
    margin-top: 12px;
    border-radius: 14px;
    background: var(--secondary-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.07);
    transition: transform 0.3s ease;
}

.chats-container .user-message .file-attachment:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.chats-container .user-message .file-attachment span {
    color: var(--accent-color);
    font-size: 1.3rem;
}

/* Input container */
.container .prompt-container {
    border-top-left-radius: 25px;
    border-top-right-radius: 25px;
    position: fixed;
    width: 100%;
    left: 0;
    bottom: 0;
    padding: 20px 0;
    background: var(--primary-color);
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, background-color var(--transition);
    backdrop-filter: blur(10px);
    z-index: 10;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    opacity: 0;
    /* Start hidden */
    transform: translateY(100%);
    /* Start offscreen */
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.prompt-container :where(.prompt-wrapper, .prompt-form, .prompt-actions) {
    display: flex;
    gap: 12px;
    align-items: center;
}

.prompt-container .prompt-wrapper {
    height: 60px;
}

.prompt-container .prompt-form {
    height: 100%;
    width: 100%;
    border-radius: 20px;
    background: var(--secondary-color);
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    position: relative;
}

.prompt-form:focus-within {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
    transform: translateY(-3px);
}

.prompt-form .prompt-input {
    width: 100%;
    height: 100%;
    background: none;
    outline: none;
    border: none;
    font-size: 1rem;
    color: var(--text-color);
    padding: 0 24px;
    transition: color var(--transition);
}

.prompt-form .prompt-input::placeholder {
    color: var(--placeholder-color);
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.prompt-form .prompt-input:focus::placeholder {
    opacity: 0.4;
}

.prompt-wrapper button {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    cursor: pointer;
    border-radius: 12px;
    font-size: 1.3rem;
    border: none;
    color: var(--text-color);
    background: var(--secondary-color);
    transition: all 0.3s cubic-bezier(0.17, 0.67, 0.3, 1.33);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.prompt-wrapper button::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.prompt-wrapper button:hover::after {
    opacity: 1;
}

.prompt-wrapper button:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.prompt-wrapper button:active {
    transform: translateY(-2px);
}

.prompt-wrapper :is(button:hover, #cancel-file-btn, .file-icon) {
    background: var(--secondary-hover-color);
}

.prompt-form .prompt-actions {
    margin-right: 10px;
    position: relative;
}

.prompt-wrapper .prompt-form :where(.file-upload-wrapper, button, img) {
    position: relative;
    height: 40px;
    width: 40px;
}

.prompt-form .file-upload-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.prompt-form .file-upload-wrapper.active {
    width: auto;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 2px 12px 2px 2px;
    animation: fadeIn 0.3s ease;
}

.prompt-form .file-upload-wrapper.active .file-preview {
    display: block;
    height: 36px;
    width: 36px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 8px;
}

.prompt-form .file-upload-wrapper:not(.active) .file-preview,
.prompt-form .file-upload-wrapper:not(.active) #cancel-file-btn {
    display: none;
}

.prompt-form .file-upload-wrapper.active #add-file-btn {
    display: none;
}

.prompt-form .file-upload-wrapper.img-attached .file-icon,
.prompt-form .file-upload-wrapper:not(.file-attached) .file-icon {
    display: none;
}

.prompt-form .prompt-actions #send-prompt-btn {
    color: #fff;
    display: none;
    background: var(--accent-color);
}

.prompt-form .prompt-input:valid~.prompt-actions #send-prompt-btn {
    display: flex;
    animation: sendButtonAppear 0.3s cubic-bezier(0.17, 0.67, 0.3, 1.33);
}

@keyframes sendButtonAppear {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.prompt-form #send-prompt-btn:hover {
    background: var(--accent-hover);
}

.prompt-form #stop-response-btn {
    display: none;
    color: var(--error-color);
}

body.bot-responding .prompt-form #stop-response-btn {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.prompt-container .disclaimer-text {
    font-size: 0.75rem;
    color: var(--subheading-color);
    opacity: 0.7;
    text-align: center;
    margin-top: 8px;
    transition: opacity 0.2s ease;
}

.prompt-container .disclaimer-text:hover {
    opacity: 1;
}

.prompt-wrapper.hide-controls .prompt-actions>*:not(#send-prompt-btn):not(#stop-response-btn) {
    display: none;
}

/* Code block styling */
.code-block-wrapper {
    margin: 20px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    max-height: 400px;
}

.code-block-wrapper.expanded {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    height: 90%;
    max-height: none;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.code-block-wrapper.expanded .code-block {
    height: calc(100% - 40px);
    max-height: none;
}

.code-block-wrapper:hover {
    transform: translateY(-3px);
}

.code-block-wrapper.expanded:hover {
    transform: translate(-50%, -50%);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: rgba(30, 41, 59, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-language {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.code-block {
    background-color: rgba(15, 23, 42, 0.95);
    padding: 16px;
    margin: 0;
    position: relative;
    overflow: auto;
    font-family: "JetBrains Mono", "Fira Code", monospace;
    line-height: 1.6;
    font-size: 0.9rem;
    border: none;
    display: flex;
    max-height: 350px;
}

.code-block .line-numbers-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding-right: 12px;
    margin-right: 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    user-select: none;
    min-width: 30px;
    text-align: right;
}

.code-block .line-number {
    line-height: 1.6;
}

.code-block code {
    flex: 1;
    overflow-x: auto;
}

body.light-theme .code-block {
    background-color: rgba(15, 23, 42, 0.95);
    color: #e2e8f0;
}

.code-block .code-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.code-block:hover .code-actions {
    opacity: 1;
}

.code-block-wrapper.expanded .code-actions {
    opacity: 1;
}

.code-block .copy-btn,
.code-block .expand-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #fff;
}

.code-block .copy-btn:hover,
.code-block .expand-btn:hover {
    background: rgba(59, 130, 246, 0.3);
    transform: translateY(-2px);
}

/* Markdown styling */
.chats-container .message .message-text h1,
.chats-container .message .message-text h2,
.chats-container .message .message-text h3 {
    margin: 18px 0 12px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-color);
}

.chats-container .message .message-text h1 {
    font-size: 1.7rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.chats-container .message .message-text h2 {
    font-size: 1.4rem;
}

.chats-container .message .message-text h3 {
    font-size: 1.2rem;
}

.chats-container .message .message-text strong {
    font-weight: 600;
    color: var(--accent-color);
}

.chats-container .message .message-text em {
    font-style: italic;
    opacity: 0.9;
}

.chats-container .message .message-text .markdown-link {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent-color);
    padding-bottom: 1px;
    transition: all 0.2s ease;
}

.chats-container .message .message-text .markdown-link:hover {
    color: var(--accent-hover);
    border-bottom: 1px solid var(--accent-hover);
}

.chats-container .message .message-text .markdown-list {
    margin: 12px 0;
    padding-left: 24px;
}

.chats-container .message .message-text .markdown-list li {
    margin-bottom: 6px;
    line-height: 1.5;
}

.chats-container .message .message-text .markdown-blockquote {
    border-left: 3px solid var(--accent-color);
    padding: 10px 16px;
    margin: 16px 0;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 0 8px 8px 0;
    font-style: italic;
}

.chats-container .message .message-text .inline-code {
    font-family: "JetBrains Mono", "Fira Code", monospace;
    background-color: rgba(15, 23, 42, 0.7);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #e2e8f0;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

body.light-theme .chats-container .message .message-text .inline-code {
    background-color: rgba(15, 23, 42, 0.7);
    color: #e2e8f0;
}

.chats-container .message .message-text .markdown-hr {
    margin: 20px 0;
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
}

body.light-theme .chats-container .message .message-text .markdown-blockquote {
    background: rgba(59, 130, 246, 0.05);
}

body.light-theme .chats-container .message .message-text h1 {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-theme .chats-container .message .message-text .markdown-hr {
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.1), transparent);
}

/* Table styling */
.markdown-table-wrapper {
    margin: 20px 0;
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.markdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    overflow: hidden;
}

.markdown-table th,
.markdown-table td {
    padding: 12px 16px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.markdown-table th {
    background-color: rgba(59, 130, 246, 0.15);
    font-weight: 600;
    color: var(--accent-color);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.markdown-table tr {
    background-color: rgba(30, 41, 59, 0.4);
    transition: background-color 0.2s ease;
}

.markdown-table tr:nth-child(even) {
    background-color: rgba(30, 41, 59, 0.7);
}

.markdown-table tr:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

body.light-theme .markdown-table th {
    background-color: rgba(59, 130, 246, 0.1);
}

body.light-theme .markdown-table tr {
    background-color: rgba(255, 255, 255, 0.7);
}

body.light-theme .markdown-table tr:nth-child(even) {
    background-color: rgba(241, 245, 249, 0.7);
}

body.light-theme .markdown-table th,
body.light-theme .markdown-table td {
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Task list styling */
.task-list-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
}

.task-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    color: var(--subheading-color);
    transition: all 0.2s ease;
}

.task-checkbox.checked {
    color: var(--accent-color);
}

.task-checkbox .material-symbols-rounded {
    font-size: 1.2rem;
}

.task-text {
    flex: 1;
    line-height: 1.5;
}

.task-checkbox.checked + .task-text {
    text-decoration: line-through;
    opacity: 0.7;
}

/* Feedback system */
.feedback-container {
    display: flex;
    gap: 12px;
    margin-top: 14px;
    justify-content: flex-end;
    animation: fadeIn 0.5s ease;
}

.feedback-btn {
    background: var(--secondary-color);
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.feedback-btn:hover,
.feedback-btn.active {
    opacity: 1;
    transform: scale(1.1);
}

.feedback-btn.active[data-type="positive"] {
    background: var(--success-color);
    color: white;
}

.feedback-btn.active[data-type="negative"] {
    background: var(--error-color);
    color: white;
}

/* Action buttons */
.action-buttons {
    position: fixed;
    right: 20px;
    bottom: 120px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 5;
    animation: fadeSlideLeft 0.5s ease-out 0.5s both;
}

@keyframes fadeSlideLeft {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.action-btn {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--secondary-color);
    border: none;
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.action-btn:hover::before {
    opacity: 1;
}

.action-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.action-btn:active {
    transform: translateY(-2px) scale(1);
}

#voice-input-btn.recording {
    background: var(--accent-color);
    animation: recordingPulse 1.5s infinite;
}

@keyframes recordingPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 15px rgba(59, 130, 246, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 24px;
    border-radius: 12px;
    background: var(--secondary-color);
    color: var(--text-color);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    transform: translateX(110%);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
}

.notification::before {
    content: "info";
    font-family: "Material Symbols Rounded";
    font-size: 1.3rem;
}

.notification.success {
    background: var(--success-color);
    color: white;
}

.notification.success::before {
    content: "check_circle";
}

.notification.error {
    background: var(--error-color);
    color: white;
}

.notification.error::before {
    content: "error";
}

.notification.show {
    transform: translateX(0);
}

/* Mobile responsive */
@media screen and (max-width: 768px) {
    body {
        font-size: 14px;
        padding: 0;
    }

    .container {
        padding: 10px 0 80px;
    }

    .container :where(.app-header, .suggestions, .message, .prompt-wrapper) {
        padding: 0 15px;
    }

    .app-header .heading {
        font-size: 2rem;
    }

    .app-header .sub-heading {
        font-size: 1rem;
    }

    .suggestions {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-top: 3vh;
    }

    .suggestions .suggestions-item {
        height: 150px;
        padding: 18px;
    }

    .suggestions .suggestions-item .text {
        font-size: 0.95rem;
    }

    .suggestions .suggestions-item .icon {
        width: 40px;
        height: 40px;
        padding: 10px;
    }

    .chats-container {
        gap: 24px;
        padding: 15px;
        margin-bottom: 30%;
    }

    .chats-container .message {
        gap: 10px;
        padding: 5px;
    }

    .chats-container .message .avatar-container {
        width: 32px;
        height: 32px;
        border-radius: 10px;
    }

    .chats-container .message .message-text {
        padding: 12px 15px;
        font-size: 0.95rem;
        max-width: 95%;
        line-height: 1.5;
    }

    .chats-container .user-message .img-attachment {
        width: 90%;
        max-height: 250px;
    }

    .code-block-wrapper {
        margin: 15px 0;
    }

    .code-block {
        padding: 12px;
        font-size: 0.8rem;
    }

    .prompt-container {
        padding: 15px 0 10px;
    }

    .prompt-container .prompt-wrapper {
        height: 50px;
    }

    .prompt-wrapper button {
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
    }

    .prompt-form .prompt-input {
        font-size: 0.95rem;
        padding: 0 15px;
    }

    .prompt-form .prompt-actions #send-prompt-btn {
        font-size: 1.1rem;
    }

    .prompt-wrapper .prompt-form :where(.file-upload-wrapper, button, img) {
        height: 36px;
        width: 36px;
    }

    .prompt-form .file-upload-wrapper.active {
        padding: 2px 8px 2px 2px;
    }

    .action-buttons {
        right: 15px;
        bottom: 90px;
        gap: 12px;
    }

    .action-btn {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }

    .notification {
        top: 15px;
        right: 15px;
        padding: 10px 18px;
        font-size: 0.9rem;
    }

    .feedback-container {
        margin-top: 10px;
        gap: 8px;
    }

    .feedback-btn {
        width: 32px;
        height: 32px;
    }
}

@media screen and (max-width: 480px) {

    .container .suggestions {
        width: 90%;
        list-style: none;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
        margin-top: 5vh;
        padding: 0 20px 20px;
        opacity: 0;
        height: auto;
        /* Start hidden */
    }
    
    .app-header .heading {
        font-size: 2.0rem;
    }

    .badge {
        font-size: 0.7rem;
        padding: 3px 8px;
        margin-left: 6px;
    }

    .container .prompt-wrapper {
        height: 45px;
    }

    .prompt-wrapper button {
        width: 38px;
        height: 38px;
    }

    .prompt-container .disclaimer-text {
        font-size: 0.7rem;
    }

    .chats-container .message .message-text {
        max-width: 98%;
    }

    .preloader-text {
        font-size: 2.2rem;
    }

    .preloader-subtext {
        font-size: 1rem;
    }

    .preloader-spinner {
        width: 100px;
        height: 100px;
    }
}

/* Code overlay */
.code-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}