/* Chat Interface Styles */
.chat-interface {
    background-color: #1a1a1a;
}

/* Sidebar Styles */
.sidebar, .right-sidebar {
    background-color: #212529;
    border-color: #343a40;
}

.nav-link {
    color: #ffffff;
}

.nav-link:hover, .nav-link.active {
    background-color: #343a40;
    color: #ffffff;
}

.chat-item, .thread-item {
    border-color: #343a40;
    color: #ffffff;
}

.chat-item:hover, .thread-item:hover {
    background-color: #343a40;
}

/* Main Chat Area */
.main-chat {
    background-color: #1a1a1a;
}

.chat-header, .chat-input {
    background-color: #212529;
    border-color: #343a40;
}

.message-agent .message-content {
    background-color: #343a40;
    color: #ffffff;
}

/* Form Controls */
.form-control {
    background-color: #343a40;
    border-color: #495057;
    color: #ffffff;
}

.form-control::placeholder {
    color: #6c757d;
}

.form-control:focus {
    background-color: #343a40;
    border-color: #007bff;
    color: #ffffff;
}

/* Message Styles */
.chat-messages {
    height: calc(100vh - 140px);
    overflow-y: auto;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 70%;
    opacity: 1;
    visibility: visible;
    margin-bottom: 1rem;
}

.message-agent {
    align-self: flex-start;
    position: relative;
    padding-right: 30px; /* Add space for the cursor */
    transition: all 0.3s ease-out;
}

.message-user {
    align-self: flex-end;
}

.message-content {
    padding: 1rem 1.5rem;
    border-radius: 16px;
    background: rgba(147, 51, 234, 0.1);
    border: 1px solid rgba(147, 51, 234, 0.2);
    color: rgba(255, 255, 255, 0.9);
    visibility: visible;
    position: relative;
}

.message-content h1,
.message-content h2,
.message-content h3 {
    color: rgba(255, 255, 255, 0.95);
    margin: 1rem 0 0.5rem 0;
    font-weight: 600;
}

.message-content h1 { font-size: 1.5rem; }
.message-content h2 { font-size: 1.3rem; }
.message-content h3 { font-size: 1.1rem; }

.message-content p {
    margin: 0.5rem 0;
}

.message-content ul,
.message-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.message-content li {
    margin: 0.25rem 0;
}

.message-content a {
    color: #c084fc;
    text-decoration: none;
    transition: all 0.3s ease;
}

.message-content a:hover {
    color: #9333ea;
    text-decoration: underline;
}

.message-content code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
}

.message-content pre.code-block {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    margin: 0.5rem 0;
    overflow-x: auto;
}

.message-content pre.code-block code {
    background: none;
    padding: 0;
    white-space: pre;
}

.message-content strong {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
}

.message-content em {
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
}

.message-user .message-content {
    background: linear-gradient(45deg, rgba(147, 51, 234, 0.2), rgba(192, 132, 252, 0.2));
    border: none;
}

.message-time {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 0.5rem;
    align-self: flex-end;
    visibility: visible;
}

/* Back Button */
.back-to-home {
    transition: all 0.3s ease;
}

.back-to-home:hover {
    transform: translateX(-5px);
}

/* Chat Layout */
.chat-layout {
    display: flex;
    height: 100vh;
    background-color: #0a0a0a;
    position: relative;
    overflow: hidden;
}

/* Main Chat Area */
.chat-main {
    flex: 1;
    margin-left: 280px; /* Same as side-nav width */
    display: flex;
    flex-direction: column;
    background: rgba(23, 25, 28, 0.9);
    backdrop-filter: blur(10px);
    position: relative;
    height: 100vh;
    overflow: hidden;
}

/* Chat Header */
.chat-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(23, 25, 28, 0.95);
    z-index: 10;
}

.current-agent {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.current-agent .agent-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(45deg, rgba(147, 51, 234, 0.1), rgba(192, 132, 252, 0.1));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.current-agent .agent-icon i {
    font-size: 1.5rem;
    background: linear-gradient(45deg, #9333ea, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.current-agent .agent-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
}

.current-agent .agent-status {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Chat Container */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: rgba(23, 25, 28, 0.95);
}

.messages-wrapper {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* AI Thought Process Styles */
.ai-thought-process {
    margin-bottom: 0.5rem;
}

.thought-process-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(147, 51, 234, 0.05);
    border: 1px solid rgba(147, 51, 234, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.thought-process-header:hover {
    background: rgba(147, 51, 234, 0.1);
}

.thought-process-header i {
    transition: transform 0.3s ease;
}

.thought-process-header.active i {
    transform: rotate(180deg);
}

.thought-process-content {
    display: none;
    background: rgba(23, 25, 28, 0.95);
    border: 1px solid rgba(147, 51, 234, 0.1);
    border-radius: 8px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.thought-process-content.active {
    display: block;
}

.thought-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(147, 51, 234, 0.1);
}

.thought-item:last-child {
    border-bottom: none;
}

.thought-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.25rem;
}

.thought-item-content {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    padding-left: 1.5rem;
}

.thought-item-content h1,
.thought-item-content h2,
.thought-item-content h3,
.thought-item-content p,
.thought-item-content ul,
.thought-item-content ol,
.thought-item-content li,
.thought-item-content a,
.thought-item-content code,
.thought-item-content pre.code-block,
.thought-item-content strong,
.thought-item-content em {
    font-size: 0.9em;
    margin: 0.25rem 0;
}

/* Message Answer Styles */
.message-answer {
    margin-top: 0.5rem;
}

/* Chat Input Area */
.chat-input-wrapper {
    padding: 2rem;
    background: rgba(23, 25, 28, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 10;
}

.chat-input-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.5rem;
}

.chat-input {
    flex: 1;
    background: none;
    border: none;
    padding: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
}

.chat-input:focus {
    outline: none;
}

.chat-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.send-button {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(45deg, #9333ea, #c084fc);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.send-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(147, 51, 234, 0.3);
}

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

.chat-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.chat-container::-webkit-scrollbar-thumb {
    background: rgba(147, 51, 234, 0.3);
    border-radius: 4px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: rgba(147, 51, 234, 0.5);
}

/* Back Button */
.back-button {
    background: rgba(23, 25, 28, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
}

.back-button:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    background: linear-gradient(45deg, #9333ea, #c084fc, #8b5cf6);
    background-opacity: 0.1;
    color: rgba(255, 255, 255, 0.95);
}

.back-button i {
    font-size: 1.25rem;
}

/* Message Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message {
    animation: fadeIn 0.3s ease-out forwards;
}

.thinking-animation {
    display: none;
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    background: rgba(147, 51, 234, 0.1);
    border: 1px solid rgba(147, 51, 234, 0.2);
    border-radius: 16px;
    max-width: 70%;
    align-self: flex-start;
}

.thinking-animation.active {
    display: flex;
    align-items: center;
    gap: 10px;
    animation: fadeIn 0.3s ease-out forwards;
}

.thinking-dots {
    display: flex;
    gap: 6px;
}

.thinking-dot {
    width: 8px;
    height: 8px;
    background: #9333ea;
    border-radius: 50%;
    animation: bounce 1.4s infinite;
}

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

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

.thinking-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin-left: 8px;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(147, 51, 234, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(147, 51, 234, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(147, 51, 234, 0);
    }
}

/* Deep Thought Styles */
.deep-thought {
    background: rgba(147, 51, 234, 0.05);
    border-left: 3px solid #9333ea;
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 0 16px 16px 0;
}

.deep-thought-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #9333ea;
    font-weight: 500;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.deep-thought-header:hover {
    opacity: 0.8;
}

.deep-thought-header i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.deep-thought-header.active i {
    transform: rotate(180deg);
}

.deep-thought-content {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    line-height: 1.5;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    opacity: 0;
}

.deep-thought-content.active {
    max-height: 1000px;
    opacity: 1;
    transition: max-height 0.5s ease-in, opacity 0.3s ease-in;
}

/* Copy Button Styles */
.copy-button {
    position: relative;
    background: rgba(147, 51, 234, 0.1);
    border: 1px solid rgba(147, 51, 234, 0.2);
    border-radius: 8px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.message-time-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.message-time {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    visibility: visible;
}

.message:hover .copy-button {
    opacity: 1;
}

.copy-button:hover {
    background: rgba(147, 51, 234, 0.2);
    transform: scale(1.05);
}

.copy-button i {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.copy-button:hover i {
    color: rgba(255, 255, 255, 1);
}

.copy-button i.fa-check {
    color: #10B981;
}

/* Starter Message Styles */
.starter-message {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.5s ease-out;
    background: linear-gradient(45deg, rgba(147, 51, 234, 0.1), rgba(192, 132, 252, 0.1));
    border: 1px solid rgba(147, 51, 234, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
}

.starter-message.fade-out {
    opacity: 0;
    transform: translateY(-20px);
    height: 0;
    margin: 0;
    padding: 0;
    border: none;
    pointer-events: none;
}

.starter-message h3 {
    color: #9333ea;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.starter-message ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.starter-message li {
    margin: 0.5rem 0;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.starter-message li i {
    color: #9333ea;
}

.starter-message .examples {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(147, 51, 234, 0.2);
}

.starter-message .examples p {
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

.nav-toggle-button {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(147, 51, 234, 0.1);
    border: 1px solid rgba(147, 51, 234, 0.2);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 1rem;
}

.nav-toggle-button:hover {
    background: linear-gradient(45deg, rgba(147, 51, 234, 0.2), rgba(192, 132, 252, 0.2));
    transform: scale(1.05);
}

.nav-toggle-button i {
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.nav-toggle-button:hover i {
    color: #c084fc;
}

/* Navigation States */
.side-nav {
    transform: translateX(0);
    transition: transform 0.3s ease-in-out;
}

.nav-hidden .side-nav {
    transform: translateX(-100%);
}

.nav-hidden .chat-main {
    margin-left: 0;
}

@media (max-width: 768px) {
    .side-nav {
        transform: translateX(-100%);
    }
    
    .nav-visible .side-nav {
        transform: translateX(0);
    }
    
    .chat-main {
        margin-left: 0;
    }
}

/* Laptop/MacBook Optimizations */
@media screen and (max-height: 900px) {
    /* Reduce padding and margins throughout the interface */
    .chat-header {
        padding: 0.75rem 1.5rem;
    }
    
    .chat-container {
        padding: 1rem;
    }
    
    .chat-input-wrapper {
        padding: 1rem;
    }
    
    /* Make agent icon smaller */
    .current-agent .agent-icon {
        width: 36px;
        height: 36px;
    }
    
    .current-agent .agent-icon i {
        font-size: 1.2rem;
    }
    
    /* Reduce agent name size */
    .current-agent .agent-name {
        font-size: 1.25rem;
    }
    
    /* Reduce message padding */
    .message-content {
        padding: 0.75rem 1rem;
    }
    
    /* Reduce spacing between messages */
    .messages-wrapper {
        gap: 1rem;
    }
    
    /* Make thinking animation smaller */
    .thinking-animation {
        padding: 0.75rem 1rem;
        margin: 0.75rem 0;
    }
    
    /* Reduce starter message padding */
    .starter-message {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    /* Reduce font sizes */
    .message-content h1 { font-size: 1.3rem; }
    .message-content h2 { font-size: 1.1rem; }
    .message-content h3 { font-size: 1rem; }
    
    /* Optimize deep thought display */
    .deep-thought {
        padding: 0.75rem 1rem;
        margin: 0.75rem 0;
    }
}

/* Even smaller screens (13" laptops) */
@media screen and (max-height: 768px) {
    /* Further reduce padding */
    .chat-header {
        padding: 0.5rem 1rem;
    }
    
    .chat-container {
        padding: 0.75rem;
    }
    
    .chat-input-wrapper {
        padding: 0.75rem;
    }
    
    /* Make agent icon even smaller */
    .current-agent .agent-icon {
        width: 32px;
        height: 32px;
    }
    
    /* Reduce agent name size further */
    .current-agent .agent-name {
        font-size: 1.1rem;
    }
    
    /* Compact message display */
    .message-content {
        padding: 0.6rem 0.8rem;
    }
    
    /* Tighten spacing */
    .messages-wrapper {
        gap: 0.75rem;
    }
    
    /* Optimize input area */
    .chat-input {
        padding: 0.75rem;
    }
    
    .send-button {
        width: 40px;
        height: 40px;
    }
}

/* Optimize sales flow form for laptops */
@media screen and (max-height: 900px) {
    .sales-flow-form {
        margin: 1rem auto;
        padding: 1.5rem;
    }
    
    .form-grid {
        gap: 1rem;
    }
    
    .form-group label {
        margin-bottom: 0.3rem;
    }
    
    .form-group input {
        padding: 0.6rem;
    }
    
    .submit-btn {
        padding: 0.75rem;
    }
}

/* Add these styles to fix long links on mobile */
@media screen and (max-width: 768px) {
    /* Enable body scrolling on mobile */
    body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Improve link wrapping on mobile */
    .message-content a {
        word-break: break-word;
        overflow-wrap: break-word;
        display: inline-block;
        max-width: 100%;
        vertical-align: top;
    }
    
    /* Ensure all content stays within message boundaries */
    .message-content {
        word-break: break-word;
        overflow-wrap: break-word;
    }
    
    /* Improve code display on mobile */
    .message-content code {
        word-break: break-all;
        white-space: pre-wrap;
    }
    
    /* Better handling of pre blocks */
    .message-content pre {
        white-space: pre-wrap;
        word-break: break-word;
        max-width: 100%;
    }
    
    /* Ensure code blocks don't overflow */
    .message-content pre.code-block {
        max-width: 100%;
        overflow-x: auto;
    }
    
    /* Ensure images don't overflow */
    .message-content img {
        max-width: 100%;
        height: auto;
    }
}

/* Additional optimization for very small screens */
@media screen and (max-width: 480px) {
    .message {
        max-width: 85%; /* Increase from 70% to allow more space */
    }
    
    .message-content {
        padding: 0.6rem 0.8rem;
        font-size: 0.95rem;
    }
}

/* Enhanced Sales Flow Form Styles */
.sales-flow-form {
    position: relative;
    width: 90%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 2.5rem;
    background: linear-gradient(145deg, rgba(23, 25, 28, 0.95), rgba(30, 32, 36, 0.95));
    border: 1px solid rgba(147, 51, 234, 0.3);
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2), 0 0 15px rgba(147, 51, 234, 0.1);
    transition: all 0.3s ease;
    animation: formFadeIn 0.5s ease-out;
}

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

.sales-flow-form h3 {
    color: #c084fc;
    margin-bottom: 1.75rem;
    font-size: 1.75rem;
    text-align: center;
    font-weight: 600;
    position: relative;
    padding-bottom: 1rem;
}

.sales-flow-form h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #9333ea, #c084fc);
    border-radius: 3px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    position: relative;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.form-group label::after {
    content: '*';
    color: #c084fc;
    margin-left: 0.25rem;
    font-size: 1.1rem;
    display: none;
}

.form-group label[for="firstName"]::after,
.form-group label[for="lastName"]::after,
.form-group label[for="company"]::after,
.form-group label[for="email"]::after,
.form-group label[for="phone"]::after {
    display: inline;
}

.form-group input {
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(147, 51, 234, 0.3);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) inset;
    width: 100%;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #c084fc;
    box-shadow: 0 0 0 3px rgba(192, 132, 252, 0.2), 0 2px 5px rgba(0, 0, 0, 0.1) inset;
    background: rgba(255, 255, 255, 0.08);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-group .input-icon {
    position: absolute;
    right: 1rem;
    bottom: 0.9rem;
    color: rgba(255, 255, 255, 0.4);
    pointer-events: none;
    transition: all 0.3s ease;
}

.form-group input:focus + .input-icon {
    color: #c084fc;
}

.submit-btn {
    width: 100%;
    padding: 1.1rem;
    background: linear-gradient(45deg, #9333ea, #c084fc);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(147, 51, 234, 0.3);
    position: relative;
    overflow: hidden;
    margin-top: 0.5rem;
}

.submit-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(147, 51, 234, 0.4);
}

.submit-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(147, 51, 234, 0.3);
}

.submit-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.submit-btn:hover::after {
    transform: translateX(100%);
}

.message.success .message-content {
    border-color: #10B981;
    background: rgba(16, 185, 129, 0.1);
}

.message.error .message-content {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Form validation styles */
.form-group input:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

.form-group input:valid:not(:placeholder-shown) {
    border-color: #10B981;
}

.form-group .validation-message {
    font-size: 0.8rem;
    color: #ef4444;
    margin-top: 0.3rem;
    display: none;
}

.form-group input:invalid:not(:placeholder-shown) ~ .validation-message {
    display: block;
}

/* Mobile Responsiveness */
@media screen and (max-width: 768px) {
    .sales-flow-form {
        margin: 1.5rem 1rem;
        padding: 1.75rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .sales-flow-form h3 {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }

    .form-group input {
        padding: 0.8rem;
        font-size: 0.95rem;
    }

    .submit-btn {
        padding: 0.9rem;
        font-size: 1rem;
    }
}

/* Laptop optimizations for sales form */
@media screen and (max-height: 900px) {
    .sales-flow-form {
        margin: 1.25rem auto;
        padding: 1.75rem;
        max-width: 750px;
    }
    
    .form-grid {
        gap: 1.25rem;
    }
    
    .form-group label {
        margin-bottom: 0.3rem;
        font-size: 0.85rem;
    }
    
    .form-group input {
        padding: 0.75rem 0.9rem;
        font-size: 0.95rem;
    }
    
    .submit-btn {
        padding: 0.9rem;
        font-size: 1rem;
        margin-top: 0.25rem;
    }
    
    .sales-flow-form h3 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
        padding-bottom: 0.75rem;
    }
}

/* Update the sales flow form width for larger screens */
@media screen and (min-width: 1440px) {
    .sales-flow-form {
        max-width: 1000px; /* Increased from 800px */
        padding: 3rem;
    }
    
    .form-grid {
        grid-template-columns: repeat(3, 1fr); /* Change to 3 columns on large screens */
        gap: 2rem;
    }
    
    /* Make certain fields span multiple columns */
    .form-group.company-field {
        grid-column: span 2;
    }
    
    .form-group.concern-field {
        grid-column: 1 / -1; /* Full width for concern field */
    }
    
    /* Larger inputs for better proportions */
    .form-group input {
        padding: 1rem 1.2rem;
        font-size: 1.05rem;
    }
    
    /* Larger heading for better proportions */
    .sales-flow-form h3 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    
    /* Adjust button size */
    .submit-btn {
        padding: 1.2rem;
        font-size: 1.2rem;
        max-width: 500px;
        margin: 1rem auto 0;
    }
    
    /* Additional enhancements for form fields on large screens */
    .form-group input {
        height: 3.2rem; /* Increase height for better visibility */
    }
    
    /* Adjust icon positioning for taller inputs */
    .form-group .input-icon {
        bottom: 1.1rem;
    }
    
    /* Enhance field focus states */
    .form-group input:focus {
        box-shadow: 0 0 0 3px rgba(192, 132, 252, 0.25);
        transform: translateY(-2px);
    }
    
    /* Make the form more centered on ultra-wide screens */
    @media screen and (min-width: 2560px) {
        .sales-flow-form {
            max-width: 1400px;
            width: 80%;
        }
        
        /* Make the form container more prominent */
        .messages-wrapper {
            display: flex;
            justify-content: center;
            width: 100%;
        }
    }
}

/* Extra large screens */
@media screen and (min-width: 1920px) {
    .sales-flow-form {
        max-width: 1400px;
        width: 80%;
        padding: 3.5rem;
    }
    
    /* Add some visual enhancements for large screens */
    .sales-flow-form::before {
        content: '';
        position: absolute;
        top: -10px;
        left: -10px;
        right: -10px;
        bottom: -10px;
        background: linear-gradient(135deg, rgba(147, 51, 234, 0.1), rgba(192, 132, 252, 0.05));
        border-radius: 25px;
        z-index: -1;
        filter: blur(10px);
    }
    
    /* Fix for nested media queries that might be causing issues */
    @media screen and (min-width: 2560px) {
        .sales-flow-form {
            max-width: 1600px !important;
            width: 70% !important;
        }
    }
}

/* Add styling for streaming cursor and response states */
.cursor-blink {
    position: absolute;
    display: inline-block;
    width: 12px;
    height: 12px;
    background: linear-gradient(45deg, #9333ea, #c084fc);
    border-radius: 50%;
    z-index: 2;
    animation: pulseGlow 1.5s ease-in-out infinite;
    box-shadow: 0 0 0 rgba(147, 51, 234, 0.4);
}

.cursor-blink::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    background: linear-gradient(45deg, #9333ea, #c084fc, #8b5cf6);
    opacity: 0.3;
    z-index: -1;
    animation: glowExpand 1.5s ease-in-out infinite;
}

/* Cursor positioning when awaiting response (just the dot) */
.message-agent.awaiting-response {
    background: transparent;
    border: none;
    max-width: 20px;
    height: 20px;
    margin-left: 20px;
    margin-bottom: 2rem;
}

.message-agent.awaiting-response .cursor-blink {
    position: relative;
    left: 0;
    top: 0;
    right: auto;
}

/* Cursor positioning when response is being received */
.message-agent:not(.awaiting-response) .cursor-blink {
    right: -25px;
    top: 30px;
}

@keyframes pulseGlow {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(147, 51, 234, 0.4);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(147, 51, 234, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(147, 51, 234, 0);
    }
}

@keyframes glowExpand {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    50% {
        opacity: 0.25;
        transform: scale(1.3);
    }
    100% {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* Agent tools and reasoning sections */
.agent-tools-section,
.agent-reasoning-section {
    margin-bottom: 15px;
    border-radius: 8px;
    background-color: rgba(26, 28, 35, 0.7);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

.tools-header,
.reasoning-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background-color: rgba(128, 90, 213, 0.2);
    cursor: pointer;
}

.tools-header i,
.reasoning-header i {
    margin-right: 8px;
    color: #9333ea;
}

.toggle-tools-btn,
.toggle-reasoning-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: #9333ea;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.tools-list,
.reasoning-content {
    padding: 10px 15px;
}

/* Tool item styles */
.tool-item {
    margin-bottom: 10px;
    border-radius: 6px;
    background-color: rgba(128, 90, 213, 0.1);
    overflow: hidden;
}

.tool-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background-color: rgba(128, 90, 213, 0.2);
}

.tool-name {
    margin-left: 8px;
    font-weight: 500;
}

.tool-status {
    margin-left: auto;
    font-size: 0.8rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.tool-status.pending {
    background-color: rgba(234, 179, 8, 0.2);
    color: #eab308;
}

.tool-status.completed {
    background-color: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.tool-details {
    padding: 8px 12px;
}

.tool-input,
.tool-output {
    margin-bottom: 8px;
}

.tool-details pre {
    margin-top: 5px;
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

/* Reasoning item styles */
.reasoning-item {
    margin-bottom: 10px;
}

.reasoning-step {
    display: flex;
    align-items: flex-start;
    padding: 8px 0;
}

.reasoning-step i {
    margin-right: 10px;
    margin-top: 3px;
    color: #9333ea;
}

.reasoning-text {
    flex: 1;
}

/* Agent handoff notice */
.agent-handoff-notice {
    color: white;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 10px;
    background-color: rgba(128, 90, 213, 0.2);
    border-radius: 6px;
    animation: fadeIn 0.5s ease;
}

.agent-handoff-notice i {
    color: #9333ea;
    margin-right: 8px;
}

/* Agent thinking notice */
.agent-thinking-notice {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    animation: fadeIn 0.5s ease;
    position: relative;
    transition: all 0.3s ease;
    background: transparent;
}

.agent-thinking-notice i {
    color: #9333ea;
    margin-right: 8px;
    animation: pulse 1.5s infinite;
    font-size: 1.2rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
}

.agent-thinking-notice.completed i {
    animation: none;
    background: rgba(147, 51, 234, 0.1);
}

.agent-thinking-notice span {
    transition: all 0.3s ease;
    position: absolute;
    left: 40px;
    opacity: 0;
    transform: translateX(-10px);
    pointer-events: none;
}

.agent-thinking-notice:hover span {
    opacity: 1;
    transform: translateX(0);
}

.agent-thinking-notice.completed span {
    opacity: 0;
    width: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
}

/* Agent-specific icons */
.agent-icon-supervisor i {
    color: #9333ea; /* Purple for supervisor */
}

.agent-icon-researcher i {
    color: #3b82f6; /* Blue for researcher */
}

.agent-icon-caller i {
    color: #ef4444; /* Red for caller */
}

.agent-icon-email i {
    color: #10b981; /* Green for email */
}

/* Handoff arrow */
.handoff-arrow {
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.handoff-arrow i {
    color: rgba(255, 255, 255, 0.9);
    animation: none !important;
    margin: 0 !important;
    font-size: 0.8rem !important;
}

.agent-thinking-notice.handoff-active .handoff-arrow {
    opacity: 1;
}

/* Agent chain display */
.agent-chain {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    padding: 2px 4px;
    margin-left: 0;
    position: relative;
    top: -2px;
}

.agent-chain-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(23, 25, 28, 0.7);
    margin-right: 0;
    position: relative;
}

.agent-chain-item i {
    font-size: 0.85rem;
}

/* Chain arrow styles */
.chain-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 2px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.7rem;
    height: 24px;
}

/* Remove old chain item arrow style */
.agent-chain-item::after {
    display: none;
}

/* Agent chain tooltip */
.agent-chain-item {
    position: relative;
}

.agent-chain-item::before {
    content: attr(data-agent);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: rgba(23, 25, 28, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 10;
}

.agent-chain-item:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-10px);
}

/* Progress Display */
.agent-progress-section {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(23, 25, 35, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(147, 51, 234, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.agent-progress-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #9333ea, #c084fc, #8b5cf6);
    animation: progressGradient 3s ease infinite;
    background-size: 200% 100%;
}

@keyframes progressGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.progress-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: rgba(23, 25, 35, 0.3);
    border-radius: 8px;
    transition: all 0.3s ease;
    animation: fadeInUp 0.3s ease-out forwards;
}

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

.progress-item:last-child {
    margin-bottom: 0;
    background: rgba(147, 51, 234, 0.1);
    border: 1px solid rgba(147, 51, 234, 0.1);
    box-shadow: 0 2px 8px rgba(147, 51, 234, 0.12);
}

.progress-icon {
    margin-right: 0.75rem;
    font-size: 1rem;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(23, 25, 35, 0.2);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-icon i {
    color: #c084fc;
}

.progress-icon i.fa-check-circle {
    color: #10b981; /* Green for completed items */
}

.progress-message {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

/* Message content transition when coming after progress */
.agent-progress-section + .message-content {
    margin-top: 0.75rem;
    animation: fadeIn 0.5s ease-out;
    border-top: 1px solid rgba(147, 51, 234, 0.1);
    padding-top: 0.75rem;
}

/* Progress section states */
.agent-progress-section.completed {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(23, 25, 35, 0.5);
    transition: all 0.5s ease;
}

.agent-progress-section.completed::before {
    background: linear-gradient(90deg, #10b981, #14b8a6, #0ea5e9);
    animation: none;
}

.progress-status-label {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 4px;
    color: #10b981;
    font-size: 0.8rem;
    font-weight: 500;
    justify-content: flex-end;
    animation: fadeIn 0.3s ease;
    margin-left: auto;
}

.progress-status-label i {
    margin-left: 5px;
    color: #10b981;
}

/* Add gap between progress section and chat message */
.agent-progress-section + .message-content {
    position: relative;
    margin-top: 1.5rem;
    animation: fadeIn 0.5s ease-out;
    padding-top: 0.5rem;
}

.agent-progress-section + .message-content::before {
    content: "";
    position: absolute;
    top: -0.75rem;
    left: 2rem;
    width: 1.5rem;
    height: 1.5rem;
    background: rgba(147, 51, 234, 0.1);
    border: 1px solid rgba(147, 51, 234, 0.2);
    transform: rotate(45deg);
    z-index: -1;
} 