/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #000000;
    color: #ffffff;
    height: 100vh;
    display: flex;
}

/* Sidebar Styles - Left side */
.sidebar {
    width: 280px;
    background: #000000;
    color: white;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #333333;
    overflow: hidden;
    height: 100vh;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #333333;
    background: #000000;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    margin-bottom: 5px;
}

.sidebar-header p {
    color: #cccccc;
    font-size: 0.9rem;
}

/* New Chat Button */
.new-chat-btn {
    margin: 15px;
    padding: 12px;
    background: #333333;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.3s;
}

.new-chat-btn:hover {
    background: #444444;
}

/* Recent Chats Section */


.chat-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #333333;
}

.chat-item:hover {
    background: #1a1a1a;
}

.chat-item.active {
    background: #2a2a2a;
}

.chat-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
}

/* Main Chat Area - Right side */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #000000;
    height: 100vh;
}

/* Chat Header - Top bar */
.chat-header {
    padding: 20px;
    border-bottom: 1px solid #333333;
    background: #000000;
    text-align: center;
}

.chat-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: white;
    margin-bottom: 5px;
}

.chat-header p {
    color: #8a8a8a;
    font-size: 1rem;
}

/* Chat window */
.chat-window {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #000000;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Message bubbles */
.message {
    max-width: 70%;
    padding: 15px 20px;
    border-radius: 18px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.message.user {
    background: #333333;
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.message.bot {
    background: #1a1a1a;
    color: white;
    margin-right: auto;
    border-bottom-left-radius: 5px;
    border: 1px solid #333333;
}

/* Input area */
.input-area {
    padding: 20px;
    background: #000000;
    border-top: 1px solid #333333;
}

.input-row {
    display: flex;
    gap: 12px;
    align-items: center;
    max-width: 100%;
}

#user-input {
    flex: 1;
    height: 50px;
    padding: 0 20px;
    border: 1px solid #333333;
    border-radius: 25px;
    background: #0a0a0a;
    color: white;
    font-size: 16px;
    outline: none;
    position: relative;
    z-index: 1;
    box-shadow: none;
    animation: none;
}

#user-input:focus {
    box-shadow: none;
    border: 1.5px solid #00e1ff;
    animation: none;
}

#user-input::placeholder {
    color: #666666;
}

#send-btn {
    height: 50px;
    padding: 0 25px;
    border: none;
    border-radius: 25px;
    background: #333333;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

#send-btn:hover {
    background: #444444;
}

/* Scrollbar styling */
.chat-window::-webkit-scrollbar,
.recent-chats::-webkit-scrollbar {
    width: 6px;
}

.chat-window::-webkit-scrollbar-track,
.recent-chats::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.chat-window::-webkit-scrollbar-thumb,
.recent-chats::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 3px;
}

/* Mobile responsive styles */
@media (max-width: 768px) {

    /* Hide sidebar by default on mobile */
    .sidebar {
        position: fixed;
        left: -100vw;
        width: 85vw;
        min-width: 0;
        max-width: 350px;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
        transition: left 0.3s cubic-bezier(.4, 0, .2, 1);
        z-index: 1000;
        background: #000000;
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-header {
        padding: 24px 18px 18px 18px;
    }

    .new-chat-btn {
        margin: 18px;
        padding: 16px;
        font-size: 1.1rem;
    }

    .chat-item {
        padding: 16px 18px;
        font-size: 1.1rem;
        gap: 14px;
    }

    .chat-title {
        font-size: 1.05rem;
    }

    /* Sidebar toggle button - Top right */
    .sidebar-toggle {
        position: fixed;
        top: 18px;
        right: 18px;
        z-index: 1001;
        background: #333333;
        color: white;
        border: none;
        border-radius: 8px;
        padding: 12px 18px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
    }

    /* Overlay when sidebar is open */
    .sidebar-overlay {
        display: none;
        background: rgba(0, 0, 0, 0.75);
        z-index: 9999;
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* Chat container takes full width on mobile */
    .chat-container {
        width: 100vw;
        min-width: 0;
        height: 100vh;
        padding: 0;
    }

    .chat-header {
        padding: 16px 10px 10px 10px;
    }

    .chat-header h1 {
        font-size: 1.25rem;
    }

    .chat-header p {
        font-size: 0.95rem;
    }

    .chat-window {
        padding: 10px 4vw 10px 4vw;
        gap: 10px;
        font-size: 1.05rem;
    }

    .message {
        max-width: 95vw;
        font-size: 1.08rem;
        padding: 13px 14px;
        border-radius: 16px;
    }

    .input-area {
        padding: 10px 4vw 10px 4vw;
        border-top: 1px solid #222;
    }

    .input-row {
        gap: 8px;
    }

    #user-input {
        height: 44px;
        padding: 0 14px;
        font-size: 1.08rem;
        border-radius: 20px;
    }

    #send-btn {
        height: 44px;
        padding: 0 18px;
        font-size: 1.08rem;
        border-radius: 20px;
    }

    .typing-indicator {
        max-width: 95vw;
        padding: 13px 14px;
        border-radius: 16px;
    }
}

/* Web result styling */
.web-result {
    border-left: 3px solid #3498db;
    background: #1a1a1a;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
}

/* Typing indicator */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    padding: 15px 20px;
    background: #1a1a1a;
    border-radius: 18px;
    border-bottom-left-radius: 5px;
    margin-right: auto;
    max-width: 70%;
    border: 1px solid #333333;
}

.typing-dot {
    height: 8px;
    width: 8px;
    border-radius: 50%;
    background-color: #666666;
    margin: 0 2px;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-5px);
    }
}

/* Centered input area and welcome message for new chat */
.centered-chat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 60vh;
    min-height: 350px;
    width: 100%;
    padding-top: 7vh;
}

.centered-chat .welcome-message {
    font-size: 2.1rem;
    color: #fff;
    margin-bottom: 60px;
    margin-top: 0;
    text-align: center;
    background: linear-gradient(90deg, #00e1ff 0%, #ff00e1 50%, #00ffae 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-shadow: 0 2px 32px #00e1ff44, 0 1px 2px #000;
    line-height: 1.2;
}

.centered-chat .input-row {
    width: 100%;
    max-width: 650px;
    justify-content: center;
    margin-top: 0;
    margin-bottom: 0;
    background: rgba(10,10,20,0.85);
    border-radius: 40px;
    box-shadow: 0 0 60px 0 #00e1ff33, 0 0 120px 0 #ff00e133;
    padding: 18px 18px 18px 18px;
    transition: box-shadow 0.3s;
}

.centered-chat #user-input {
    box-shadow: none;
    animation: none;
    border: 1.5px solid #00e1ff;
    background: #0a0a0a;
    font-size: 1.25rem;
}

.centered-chat #send-btn {
    font-size: 1.18rem;
    font-weight: 700;
    background: #23232b;
    color: #fff;
    border-radius: 50px;
    margin-left: 12px;
    box-shadow: 0 2px 16px #0008;
    padding: 0 32px;
    height: 54px;
    transition: background 0.2s, box-shadow 0.2s;
}

.centered-chat #send-btn:hover {
    background: #00e1ff;
    color: #222;
    box-shadow: 0 0 24px #00e1ff99;
}

@media (max-width: 768px) {
    .centered-chat {
        min-height: 220px;
        height: 50vh;
        padding-top: 4vh;
    }
    .centered-chat .welcome-message {
        font-size: 1.2rem;
        margin-bottom: 28px;
    }
    .centered-chat .input-row {
        max-width: 98vw;
        padding: 10px 6px 10px 6px;
    }
    .centered-chat #user-input {
        font-size: 1.08rem;
    }
    .centered-chat #send-btn {
        font-size: 1.05rem;
        padding: 0 18px;
        height: 44px;
    }
}