:root {
    /* Dark theme variables */
    --primary: #0550be;
    --bg-gradient-1: #1e1e2e;
    --bg-gradient-2: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.95);
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border-color: #334155;
    --response-box-bg: #1e293b;
    --response-header-bg: #0f172a;
    --accent-color: #3b82f6;
    --xcyber-accent: #6a0dad;
    --gpt-accent: #28a745;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
  
body {
    font-family: "Calibri", sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-1), var(--bg-gradient-2));
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    transition: all 0.3s ease;
    display: flex;
}

.chat-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
    position: relative;
}

.container {
    width: 100%;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    margin-top: -1rem;
    overflow-y: auto;
}

.hero {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
    position: relative;
}

.hero img {
    width: 180px;
    max-width: 100%;
    border-radius: 12px;
    background-color: var(--card-bg);
    padding: 8px;
    border: 2px solid var(--border-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Response Containers - Side by Side with better styling */
.response-containers {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    width: 100%;
    margin-bottom: 6rem;
}

.response-box {
    flex: 1;
    background: var(--response-box-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    height: calc(100vh - 220px);
    display: flex;
    flex-direction: column;
}

.our-response {
    border-left: 4px solid var(--xcyber-accent);
}

.gpt-response {
    border-left: 4px solid var(--gpt-accent);
}

.response-header {
    background: var(--response-header-bg);
    padding: 0.75rem 1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.our-response .response-header::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    background-color: var(--xcyber-accent);
    border-radius: 50%;
    margin-right: 8px;
}

.gpt-response .response-header::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    background-color: var(--gpt-accent);
    border-radius: 50%;
    margin-right: 8px;
}

.response-content {
    padding: 1.25rem;
    flex-grow: 1;
    color: var(--text-primary);
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.6;
}

.placeholder-text {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    margin-top: 2rem;
}

/* Chat Sidebar */
.chat-sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 1000;
}

.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-y: auto;
    height: 100vh;
}

.search-bar {
    position: fixed;
    bottom: 1rem;
    left: calc(280px + (100% - 280px)/2);
    transform: translateX(-50%);
    width: calc(100% - 330px);
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    padding: 1rem;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 1rem;
    border: 1px solid var(--border-color);
    z-index: 50;
}

input[type="text"] {
    flex: 1;
    font-family: "Calibri", sans-serif;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: var(--response-box-bg);
    color: var(--text-primary);
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

button {
    background: var(--primary);
    font-family: "Calibri", sans-serif;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.875rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

button:hover {
    background: #0a46a2;
    transform: translateY(-1px);
}

.new-chat-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 0.75rem;
    border-radius: 8px;
    font-family: "Calibri", sans-serif;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    border: none;
}

.chat-history {
    display: flex;
    font-family: "Calibri", sans-serif;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
}

.chat-group {
    font-family: "Calibri", sans-serif;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-group h4 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0 0.5rem;
}

.chat-item {
    cursor: pointer;
    padding: 12px;
    margin: 4px 0;
    border-radius: 6px;
    transition: background-color 0.2s;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 45px;
    width: 100%;
    box-sizing: border-box;
    color: var(--text-primary);
}

.chat-item span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100% - 30px);
}

.chat-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.chat-item.active {
    background: rgba(5, 80, 190, 0.2);
    font-weight: 500;
    border-left: 3px solid var(--primary);
}

.delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 4px;
}

.delete-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ff6b6b;
}

/* Conversation history styling */
.conversation-history {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.user-message {
    align-self: flex-end;
    background-color: #1e3a5f;
    border-radius: 12px 12px 0 12px;
    padding: 12px 16px;
    max-width: 85%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.bot-message {
    align-self: flex-start;
    background-color: #2d3748;
    border-radius: 12px 12px 12px 0;
    padding: 12px 16px;
    max-width: 85%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Typing indicator styling */
.typing-indicator {
    background-color: #2d3748;
    color: #cbd5e1;
    font-style: italic;
    padding: 12px 16px;
    margin: 10px 0;
    border-radius: 12px 12px 12px 0;
    align-self: flex-start;
    display: flex;
    align-items: center;
}

.typing-dots {
    display: flex;
    gap: 5px;
    margin-left: 8px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    animation: typing 1.5s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
    animation-delay: 0s;
}
.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}
.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0% { opacity: 0.3; transform: translateY(0px); }
    50% { opacity: 1; transform: translateY(-5px); }
    100% { opacity: 0.3; transform: translateY(0px); }
}

/* Responsive design */
@media (max-width: 1024px) {
    .response-containers {
        flex-direction: column;
    }
    
    .response-box {
        height: calc((100vh - 250px) / 2);
    }
    
    .search-bar {
        width: calc(100% - 330px);
    }
}

@media (max-width: 768px) {
    .chat-sidebar {
        position: fixed;
        left: -280px;
        z-index: 1000;
        box-shadow: none;
    }
    
    .sidebar-open .chat-sidebar {
        left: 0;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
    }
    
    .main-wrapper {
        margin-left: 0;
    }
    
    .search-bar {
        left: 50%;
        width: 90%;
    }
    
    .sidebar-toggle {
        display: flex;
        position: fixed;
        top: 1rem;
        left: 1rem;
        width: 40px;
        height: 40px;
        background: var(--primary);
        color: white;
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 1001;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-open .sidebar-overlay {
        display: block;
    }
}