/* Import Manrope from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&display=swap');

/* Send button thinking animation */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.send-btn.thinking svg {
  animation: rotate 1.5s linear infinite;
}

.send-btn.thinking {
  opacity: 0.9; /* Made slightly more visible */
  pointer-events: none;
  color: var(--accent-color);
}

.message-input:disabled {
  opacity: 0.7;
  background-color: var(--bg-secondary);
  cursor: not-allowed;
}

/* ========== THEME VARIABLES ========== */
:root {
    /* Light theme variables */
    --bg-primary: #F9F3EF;
    --bg-secondary: #f5f7f9;
    --bg-secondary-rgb: 245, 247, 249;
    --text-primary: #061257;
    --text-secondary: #666666;
    --accent-color: #007AFF;
    --border-color: #e0e0e0;
    --message-user: #061257;
    --message-agent: #ffffff;
    --input-bg: #ffffff;
    --progress-overlay: rgba(255, 255, 255, 0.85);
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.2);
    --button-gradient-start: #007AFF;
    --button-gradient-end: #005BB5;
    --button-hover-gradient-start: #005BB5;
    --button-hover-gradient-end: #003F7D;
    --error-color: #FF4444;
    --error-color-dark: #CC0000;
    --success-color: #28a745;
}

[data-theme="dark"] {
    /* Dark theme variables */
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-secondary-rgb: 26, 26, 26;
    --text-primary: #CDD0DD;
    --text-secondary: #9da3b6;
    --accent-color: #0A65FC;
    --border-color: #2a2a2a;
    --message-user: #061257;
    --message-agent: rgba(6, 18, 87, 0.4);
    --input-bg: #1a1a1a;
    --progress-overlay: rgba(10, 10, 10, 0.7);
    --shadow-light: rgba(0, 0, 0, 0.2);
    --shadow-medium: rgba(0, 0, 0, 0.4);
}

/* ========== GLOBAL STYLES ========== */
body {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: 'Manrope', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
}

.content {
    flex: 1;
}

/* ========== LAYOUT STRUCTURE ========== */
.container {
    display: flex;
    height: calc(100vh - 40px); /* Account for footer */
    background-color: var(--bg-primary);
    position: relative;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    transition: max-width 0.5s ease-in-out;
    overflow-x: auto; /* Enable horizontal scrolling */
    scroll-snap-type: x mandatory; /* Enable snap scrolling */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    justify-content: center; /* Center content by default */
}

/* Remove the container::after pseudo-element that creates the vertical line */
.container::after {
    display: none;
}

.left-panel {
    flex: 0 0 100%;
    min-width: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-primary);
    scroll-snap-align: start;
    position: relative;
}

.left-panel .content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative; /* Add relative positioning to properly contain child elements */
}

.right-panel {
    flex: 0 0 100%; /* Take full width on mobile */
    min-width: 100%; /* Ensure full width on mobile */
    width: 100%;
    background-color: var(--bg-primary);
    padding: 20px;
    box-sizing: border-box;
    opacity: 1; /* Always visible on mobile */
    scroll-snap-align: start; /* Snap to start of panel */
    transition: none; /* Remove transitions for mobile */
}

/* Remove expanded class styles for mobile */
.right-panel.expanded {
    flex: 0 0 100%;
    width: 100%;
    padding: 20px;
    opacity: 1;
    transition: none;
}

.right-panel > * {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.right-panel.expanded > * {
    opacity: 1;
    transition: opacity 0.3s ease-in-out 0.3s;
}

/* ========== HEADER ========== */
.header-container {
    position: absolute;
    bottom: calc(40% + 140px + 5px - 60px); /* Subtracted 60px to move it down */
    left: 0;
    width: 100%; /* Full width on mobile */
    padding: 20px;
    text-align: center;
    box-sizing: border-box;
    z-index: 10;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

.header-container.with-conversation {
    opacity: 0 !important;
    pointer-events: none !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: opacity 0.3s ease, height 0.3s ease, margin 0.3s ease, padding 0.3s ease;
}

/* Mobile view adjustments for header */
@media (max-width: 768px) {
    .header-container {
        margin-bottom: 10px;
    }
    
    .header-container.with-conversation {
        opacity: 0 !important;
        pointer-events: none !important;
        height: 0 !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
        transition: opacity 0.3s ease, height 0.3s ease, margin 0.3s ease, padding 0.3s ease;
    }
}

.header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 12px;
    margin-top: 10px;
}

.header-container h1 {
    margin: 0 0 8px 0;
    font-size: 32px;
    color: var(--text-primary);
    text-align: center;
}

.header-container p {
    margin: 0 0 8px 0;
    color: var(--text-secondary);
    text-align: center;
}

/* ========== THEME TOGGLE ========== */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: background-color 0.3s;
}

.theme-toggle:hover {
    background-color: var(--bg-secondary);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    stroke: var(--text-primary);
}

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: none;
}

/* ========== CONVERSATION CONTAINER ========== */
.conversation-container {
    flex: 1;
    overflow-y: auto;
    padding: 60px 20px 0; /* Increased top padding to allow for sticky chat mode selector */
    margin-bottom: 140px; /* Adjusted to 140px for better spacing */
    -webkit-overflow-scrolling: touch; /* Improve mobile scroll performance */
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.conversation-container.visible {
    opacity: 1;
}

.conversation-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 20px; /* Reduced from 60px to provide just enough space */
    width: 100%;
}

/* Adjust conversation container spacing in mobile view */
@media (max-width: 768px) {
    .conversation-container.with-messages {
        padding-top: 20px !important;
        margin-top: 10px;
    }
    
    /* Ensure chat mode selector has enough z-index */
    .chat-mode-selector-wrapper {
        z-index: 1020;
    }
}

/* Ensure message thread has sufficient space in mobile view */
@media (max-width: 768px) {
    .message-thread {
        padding-top: 15px;
        margin-top: 10px;
    }
    
    /* When conversation has started, adjust layout */
    .conversation-container.with-messages .message-thread {
        padding-top: 25px;
    }
}

/* Conversation scrollbar styling */
.conversation-container::-webkit-scrollbar {
    width: 6px;
}

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

.conversation-container::-webkit-scrollbar-thumb {
    background: rgba(42, 42, 42, 0.5);
    border-radius: 6px;
}

.conversation-container::-webkit-scrollbar-thumb:hover {
    background: rgba(58, 58, 58, 0.7);
}

.conversation-container {
    scrollbar-width: thin;
    scrollbar-color: rgba(42, 42, 42, 0.5) transparent;
}

/* ========== MESSAGE STYLING ========== */
.message {
    padding: 12px;
    border-radius: 8px;
    max-width: 80%;
    box-sizing: border-box;
    font-family: 'Manrope', sans-serif;
    border: none;
    color: var(--text-primary);
    margin-bottom: 0;
    word-break: break-word; /* Prevent text overflow on small screens */
}

.message.user {
    background: var(--message-user);
    color: #E6E7EE;
    margin-left: auto;
    align-self: flex-end;
}

.message.agent {
    background: var(--message-agent);
    color: var(--text-primary);
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-right: auto;
    align-self: flex-start;
}

.message-content {
    flex: 1;
    margin-bottom: 0;
}

.message.agent h3 {
    margin: 0 0 12px 0;
    color: var(--text-primary);
    font-size: 16px;
}

.message.agent ul.suggested-questions {
    margin: 0;
    padding-left: 20px;
}

.message.agent ul.suggested-questions li {
    margin-bottom: 8px;
    color: var(--text-primary);
    line-height: 1.4;
}

/* Message feedback styling */
.agent-feedback-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
}

.message.agent {
    margin-right: 0;
    align-self: center;
}

.message-feedback {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    margin-left: 0;
    margin-top: 0;
}

.feedback-btn svg {
    width: 16px;
    height: 16px;
    display: block;
    stroke: #061257;
    fill: none;
    stroke-width: 2;
    transition: fill 0.2s, stroke 0.2s;
}

[data-theme="dark"] .feedback-btn svg {
    stroke: var(--text-primary);
}

.feedback-btn {
    background: none;
    border: none;
    padding: 2px 6px;
    cursor: pointer;
    opacity: 0.3;
    transition: opacity 0.2s ease-in-out;
    font-size: 14px;
}

.feedback-btn:hover {
    opacity: 0.8;
}

.feedback-btn.selected {
    opacity: 1;
}

/* Final CTA styling */
.message.agent.final-cta {
    background: rgba(6, 18, 87, 0.6);
}

.cta-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.cta-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 4px;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    color: var(--text-primary);
}

.cta-btn svg {
    width: 16px;
    height: 16px;
}

.copy-btn {
    background: var(--accent-color);
}

.copy-btn:hover {
    background: rgba(10, 101, 252, 0.8);
}

.copy-btn.copied {
    background: var(--success-color);
}

/* ========== TASK CHIPS ========== */
.task-chips-section {
    margin-bottom: 16px;
}

.task-chips-section h3 {
    margin: 0 0 12px 0;
    color: var(--text-primary);
}

.task-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 12px;
}

.task-chip {
    padding: 4px 8px;
    margin: 2px;
    cursor: pointer;
    color: var(--text-primary);
    transition: color 0.2s ease, background-color 0.2s ease;
    border-radius: 4px;
}

.task-chip:hover {
    color: #ffffff;
    background-color: rgba(10, 101, 252, 0.2);
}

/* ========== INPUT AREA ========== */
.inputs-container {
    position: absolute;
    bottom: 40%;
    left: 0;
    width: 100%;
    padding: 16px;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    box-sizing: border-box;
    z-index: 10;
    transition: bottom 0.5s ease-in-out, padding 0.5s ease-in-out;
}

.inputs-container.with-conversation {
    bottom: 0px;
    padding: 0 16px 16px; /* Remove top padding, keep left/right/bottom */
}

.input-wrapper {
    display: flex;
    gap: 8px;
    width: 100%;
    align-items: center;
    height: 44px;
}

.message-input-container {
    width: 100%;
    margin-top: auto;
    border-radius: 8px;
}

.message-input {
    flex: 1;
    min-height: 44px;
    max-height: 120px; /* Limit maximum height */
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    box-sizing: border-box;
    background: var(--input-bg);
    color: var(--text-primary);
    overflow-y: hidden !important;
    transition: height 0.2s ease;
    width: 100%;
    height: 44px; /* Set initial height to match button in all views */
}

.message-input:focus {
    outline: none;
    border-color: var(--accent-color);
}

.message-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* Input scrollbar styling */
.message-input::-webkit-scrollbar {
    width: 6px;
}

.message-input::-webkit-scrollbar-track {
    background: transparent;
}

.message-input::-webkit-scrollbar-thumb {
    background: rgba(42, 42, 42, 0.5);
    border-radius: 6px;
}

.message-input::-webkit-scrollbar-thumb:hover {
    background: rgba(58, 58, 58, 0.7);
}

.message-input {
    scrollbar-width: thin;
    scrollbar-color: rgba(42, 42, 42, 0.5) transparent;
}

/* ========== MICROPHONE BUTTON ========== */
.control-button {
    padding: 10px 16px;
    border: none;
    border-radius: 24px; /* Increased for pill shape */
    background: var(--accent-color); /* Replaced gradient with solid color */
    cursor: pointer;
    min-width: 60px;
    width: 140px; /* Fixed width to prevent size changes */
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Align content to the left */
    gap: 10px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px var(--shadow-light);
    flex-shrink: 0; /* Prevent button from shrinking */
    margin: 4px 8px; /* Added vertical margin */
    align-self: center; /* Center vertically in flex container */
}

.control-button:hover {
    background: var(--button-hover-gradient-start); /* Replaced gradient with solid color */
    box-shadow: 0 6px 10px var(--shadow-medium);
    transform: translateY(-1px);
}

.control-button svg {
    width: 20px;
    height: 20px;
    fill: #FFFFFF;
    margin-left: 0; /* Removed the 5px margin */
    flex-shrink: 0; /* Prevent the icon from shrinking */
}

.mic-text {
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    margin-left: 0;
}

.control-button.muted {
    background: var(--error-color); /* Replaced gradient with solid color */
}

.control-button.muted:hover {
    background: var(--error-color-dark); /* Replaced gradient with solid color */
}

.control-button.muted::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 24px;
    background-color: #FFFFFF;
    transform: rotate(-45deg);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    left: 24px; /* Adjusted to center over the mic icon */
    top: 6px; /* Adjusted for new button size */
}

/* Waveform animation for unmuted microphone */
.mic-waveform {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    width: 140px; /* Increased from 120px to 140px to fit more bars */
    gap: 2px;
    margin-left: 0; /* Removed left margin */
}

.mic-waveform span {
    display: inline-block;
    width: 2px; /* Slightly narrower to fit more */
    height: 100%;
    background-color: #FFFFFF;
    border-radius: 1px;
}

/* Three different animations for more randomness */
.mic-waveform span:nth-child(3n+1) {
    animation: wave1 2.4s ease-in-out infinite;
}

.mic-waveform span:nth-child(3n+2) {
    animation: wave2 2.7s ease-in-out infinite;
}

.mic-waveform span:nth-child(3n) {
    animation: wave3 3.1s ease-in-out infinite;
}

/* Varied animation delays for more randomness */
.mic-waveform span:nth-child(1) { animation-delay: 0.01s; }
.mic-waveform span:nth-child(2) { animation-delay: 0.17s; }
.mic-waveform span:nth-child(3) { animation-delay: 0.42s; }
.mic-waveform span:nth-child(4) { animation-delay: 0.13s; }
.mic-waveform span:nth-child(5) { animation-delay: 0.35s; }
.mic-waveform span:nth-child(6) { animation-delay: 0.05s; }
.mic-waveform span:nth-child(7) { animation-delay: 0.22s; }
.mic-waveform span:nth-child(8) { animation-delay: 0.48s; }
.mic-waveform span:nth-child(9) { animation-delay: 0.09s; }
.mic-waveform span:nth-child(10) { animation-delay: 0.31s; }
.mic-waveform span:nth-child(11) { animation-delay: 0.19s; }
.mic-waveform span:nth-child(12) { animation-delay: 0.44s; }
.mic-waveform span:nth-child(13) { animation-delay: 0.27s; }
.mic-waveform span:nth-child(14) { animation-delay: 0.38s; }
.mic-waveform span:nth-child(15) { animation-delay: 0.07s; }
.mic-waveform span:nth-child(16) { animation-delay: 0.29s; }
.mic-waveform span:nth-child(17) { animation-delay: 0.46s; }

/* Reduced amplitude by 20% (from 1.0 to 0.8) */
@keyframes wave1 {
    0%, 100% { transform: scaleY(0.3); }
    50% { transform: scaleY(0.8); }
}

@keyframes wave2 {
    0%, 100% { transform: scaleY(0.4); }
    30% { transform: scaleY(0.7); }
    70% { transform: scaleY(0.6); }
}

@keyframes wave3 {
    0%, 100% { transform: scaleY(0.25); }
    40% { transform: scaleY(0.65); }
    80% { transform: scaleY(0.75); }
}

/* Hide text when showing waveform and vice versa */
.control-button:not(.muted) .mic-text {
    display: none;
}

.control-button.muted .mic-waveform {
    display: none;
}

/* Add styling for the microphone unavailable notification */
.mic-unavailable-note {
  color: var(--text-secondary);
  font-size: 12px;
  margin-top: 8px;
  font-style: italic;
  text-align: center;
  padding: 4px 0;
  background-color: rgba(255, 68, 68, 0.1);
  border-radius: 4px;
}

@media (max-width: 768px) {
  .mic-unavailable-note {
    font-size: 11px;
    margin-top: 6px;
  }
}

/* ========== QUICK REPLIES ========== */
.quick-replies-container {
    width: 100%;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.quick-replies-container::-webkit-scrollbar {
    display: none;
}

.quick-replies-buttons {
    display: flex;
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Improve mobile scroll */
}

.quick-replies-buttons::-webkit-scrollbar {
    display: none;
}

.quick-reply-btn {
    background: #0A65FC;
    color: #FFFFFF;
    border: none;
    border-radius: 999px;
    padding: 8px 24px;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 2px 4px var(--shadow-light);
}

.quick-reply-btn:hover {
    background: rgba(10, 101, 252, 0.8);
    box-shadow: 0 4px 8px var(--shadow-medium);
}

.quick-replies-container.final-cta .quick-reply-btn.copy-btn.copied {
    background: var(--success-color);
}

/* Alternative input label styling */
.alternative-input-label {
    background-color: #008489 !important;
    border-color: #008489 !important;
    color: #fff;
    font-size: 14px;
    white-space: nowrap;
    cursor: default;
}

.alternative-input-label:hover {
    background-color: #008489 !important;
    border-color: #008489 !important;
    box-shadow: none !important;
    transform: none !important;
}

.alt-input-option {
    cursor: pointer;
    color: #fff;
    font-weight: 500;
}

.text-option {
    text-decoration: underline;
}

.speak-option.active {
    text-decoration: underline;
}

.input-highlight {
    animation: enhanced-pulse 0.8s ease-in-out 2;
    position: relative;
    z-index: 10;
}

@keyframes enhanced-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 132, 137, 0.7);
        transform: scale(1);
    }
    25% {
        transform: scale(1.05);
    }
    50% {
        box-shadow: 0 0 20px 10px rgba(0, 132, 137, 0.5);
        transform: scale(1.02);
    }
    75% {
        transform: scale(1.05);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 132, 137, 0);
        transform: scale(1);
    }
}

/* ========== STATUS BAR ========== */
.status-bar-container {
    position: absolute;
    bottom: calc(40% + 44px + 4px); /* + another 44px for quick replies container
    left: 0;
    width: 100%; /* Full width on mobile */
    height: 24px;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    font-family: 'Manrope', sans-serif;
    font-size: 12px;
    z-index: 10;
    transition: bottom 0.5s ease-in-out;
}

.status-bar-container.with-conversation {
    bottom: calc(44px + 24px + 44px + 4px); /* Position above inputs when conversation is present: input height + status height + quick replies height (44px) + 4px spacing */}

.status-text {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    font-style: italic;
    opacity: 0.8;
}

.status-dots {
    min-width: 15px;
    display: inline-block;
}

/* ========== TASK PREVIEW ========== */
.task-preview {
    max-width: 800px;
    margin: 0 auto;
}

.task-preview h1 {
    font-size: 32px;
    color: var(--text-primary);
    margin: 0 0 20px 0;
    font-family: 'Manrope', sans-serif;
}

.task-details {
    margin-bottom: 20px;
}

.task-details p {
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
}

.task-budget {
    margin-bottom: 20px;
    background: transparent;
    padding: 0;
    border: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
}

.budget-label {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
    margin-top: 0;
    order: 1;
}

.budget-amount {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
    line-height: 1.3;
    order: 2;
}

.budget-amount span {
    color: var(--text-primary);
}

.task-meta {
    margin-bottom: 20px;
}

.left-meta {
    display: flex;
    flex-direction: column;
}

.location-info {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.info-label {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 4px;
    order: 1;
}

.info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    order: 2;
}

.task-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.task-images img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

/* ========== CLASSIC MODE BUTTON ========== */
.classic-mode-btn {
    background: var(--bg-secondary);
    color: var(--text-secondary) !important;
    padding: 6px 12px;
    border-radius: 16px;
    font-weight: 500;
    text-decoration: none !important;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    font-size: 11px;
}

.classic-mode-btn:hover {
    background: var(--accent-color);
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
    text-decoration: none !important;
}

/* Removing the rule that hides the classic mode button on mobile */
/* @media (max-width: 768px) {
    .classic-mode-btn {
        display: none;
    }
} */

/* ========== TASK QUALITY PROGRESS ========== */
.task-quality {
    margin-top: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
    box-shadow: none;
    width: 100%;
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, height 0.3s ease;
}

.inputs-container.with-conversation .task-quality {
    opacity: 1;
    height: auto;
    margin-top: 0;
}

.progress-wrapper {
    width: 100%;
    margin: 0 auto;
    position: relative;
}

.progress-container {
    position: relative;
    height: 6px;
    background: transparent;
    border-radius: 0;
    margin: 0;
    width: 100%;
    display: flex;
    gap: 2px;
}

/* Remove unnecessary pseudo-elements */
.progress-container::before,
.progress-container::after {
    display: none;
}

.progress-container span {
    flex: 1;
    height: 100%;
    display: block;
    border-radius: 1px;
}

/* Define discrete colors for 8 segments from red to green */
.progress-container span:nth-child(1) { background-color: #ff0000; animation-delay: 0.0s; }
.progress-container span:nth-child(2) { background-color: #ff5500; animation-delay: 0.1s; }
.progress-container span:nth-child(3) { background-color: #ff9900; animation-delay: 0.2s; }
.progress-container span:nth-child(4) { background-color: #ffcc00; animation-delay: 0.3s; }
.progress-container span:nth-child(5) { background-color: #ffff00; animation-delay: 0.4s; }
.progress-container span:nth-child(6) { background-color: #aaff00; animation-delay: 0.5s; }
.progress-container span:nth-child(7) { background-color: #55ff00; animation-delay: 0.6s; }
.progress-container span:nth-child(8) { background-color: #00cc00; animation-delay: 0.7s; }

/* Animation for progress bars when they appear */
.progress-container span {
    animation: fadeIn 0.5s ease forwards;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.progress-container span:hover {
    opacity: 1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scaleY(0.8); }
    to { opacity: 0.7; transform: scaleY(1); }
}

.white-overlay {
    height: 100%;
    background: var(--progress-overlay);
    transition: width 0.3s ease;
    position: absolute;
    right: 0;
    z-index: 1;
    border-radius: 0;
}

/* Remove the tick mark that used to be on the white overlay */
.white-overlay::after {
    display: none;
}

/* ========== FOOTER ========== */
footer {
    height: 50px;
    background-color: rgba(var(--bg-secondary-rgb, 245, 247, 249), 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
}

.footer-content {
    max-width: 1200px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-right {
    display: flex;
    align-items: center;
}

footer a {
    font-size: 12px;
    font-family: 'Manrope', sans-serif;
    line-height: 1.5;
    font-weight: normal;
    color: var(--accent-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

footer a:hover {
    text-decoration: underline;
}

/* Experiment button specific styles */
.experiment-btn {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white !important;
    padding: 6px 12px;
    border-radius: 16px;
    font-weight: 500;
    text-decoration: none !important;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.2);
    font-size: 11px;
}

.experiment-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.3);
    text-decoration: none !important;
}

.classic-mode-btn {
    color: var(--text-muted);
    font-weight: normal;
    font-size: 11px;
}

.classic-mode-btn:hover {
    color: var(--accent-color);
}

/* ========== ANIMATIONS ========== */
@keyframes blink {
    50% { opacity: 0; }
}

.message-input::after {
    content: '|';
    animation: blink 1s step-end infinite;
}

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 40px);
        padding-bottom: 40px;
        position: relative;
    }

    .left-panel, .right-panel {
        width: 100%;
        flex: auto;
    }

    .right-panel {
        display: none; /* Hide preview on mobile */
    }
    
    .header-container {
        position: static;
        width: 100vw;
        padding: 8px 10px 16px 10px; /* Reduced top padding */
        box-sizing: border-box;
        text-align: center;
        margin-top: 0; /* Remove top margin */
    }

    .header-container h1 {
        font-size: 24px; /* Slightly larger font on mobile */
        margin-top: 10px; /* Add top margin */
    }
    .header-container p {
        font-size: 14px;
        margin-top: 5px; /* Add top margin */
    }

    .inputs-container {
        position: fixed; /* Keep fixed on mobile for proper keyboard handling */
        bottom: 40px; /* Account for footer */
    }

    .inputs-container.with-conversation {
        bottom: 40px; /* Keep above footer even during conversation */
    }

    .input-wrapper {
        gap: 8px;
        padding-right: 4px; /* Small gap between button and edge */
    }

    .status-bar-container {
        width: 100%;
        position: fixed;
        bottom: 40px; /* Account for footer */
        z-index: 10;
    }

    .conversation-container {
        position: absolute;
        top: 0; /* Start from the top */
        left: 0;
        right: 0;
        bottom: calc(24px + 40px + 4px); /* Status bar height + footer height + spacing */
        padding: 0 10px;
        margin: 0;
        overflow-y: auto;
    }

    .conversation-container.visible {
        bottom: calc(24px + 44px + 40px + 4px); /* Status bar + inputs + quick replies + footer + spacing */
    }

    .message {
        padding: 10px; /* Smaller padding on mobile */
    }

    .message.agent {
        padding-left: 15px; /* Reduce padding on mobile */
    }

    .quick-replies-buttons {
        padding-bottom: 8px; /* More padding for touch targets */
    }

    .quick-reply-btn {
        padding: 10px 14px; /* Larger touch target */
        font-size: 15px; /* Larger text */
    }

    .feedback-btn {
        padding: 4px 8px;
        font-size: 16px;
    }

    footer {
        height: 60px;
        position: fixed;
        left: 0;
        bottom: 0;
        width: 100vw;
        z-index: 1002;
        padding: 0 0.5rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer-left {
        gap: 0.5rem;
    }
    
    footer a {
        font-size: 10px;
        padding: 0 8px;
        text-align: center;
        box-sizing: border-box;
    }
    
    .experiment-btn {
        padding: 4px 8px;
        font-size: 10px;
    }
    
    .classic-mode-btn {
        padding: 4px 8px;
        font-size: 10px;
    }

    .conversation-content {
        padding-top: 16px; /* Reduced top padding because the chat mode selector has its own padding */
        padding-bottom: 20px;
        margin-top: 8px; /* Reduced margin since we're using fixed positioning for the selector */
    }
}

.date-info {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

[data-theme="dark"] .quick-reply-btn {
    background: var(--accent-color);
    color: #fff;}

/* Desktop styles */
@media (min-width: 769px) {
    .container {
        overflow-x: hidden;
        scroll-snap-type: none;
        justify-content: center;
    }

    .status-bar-container.with-conversation {
        bottom: calc(44px + 24px + 4px); /* Added extra 44px for desktop conversation view */
    }

    .left-panel {
        flex: 0 0 800px;
        min-width: 800px;
        width: 800px;
    }

    .right-panel {
        flex: 0 0 0px;
        min-width: 0;
        width: 0;
        opacity: 0;
        transition: flex 0.5s ease-in-out, width 0.5s ease-in-out, padding 0.5s ease-in-out, opacity 0.3s ease-in-out 0.2s;
    }

    .right-panel.expanded {
        flex: 0 0 400px;
        min-width: 400px;
        width: 400px;
        padding: 20px;
        opacity: 1;
    }

    .header-container {
        width: 800px;
        padding: 20px 100px;
        left: 50%; /* Center the header */
        transform: translateX(-50%); /* Center the header */
    }

    .inputs-container {
        width: 800px;
        left: 50%;
        transform: translateX(-50%);
    }

    .inputs-container.with-conversation {
        bottom: 0;
    }

    .status-bar-container {
        width: 800px;
        left: 50%; /* Center the status bar */
        transform: translateX(-50%); /* Center the status bar */
    }

    /* When right panel is expanded, adjust container positioning */
    .container:has(.right-panel.expanded) {
        justify-content: flex-start; /* Align to start when right panel is expanded */
    }

    .container:has(.right-panel.expanded) .header-container,
    .container:has(.right-panel.expanded) .inputs-container,
    .container:has(.right-panel.expanded) .status-bar-container {
        left: 0;
        transform: none;
    }
}

.chat-mode-selector {
  margin-bottom: 16px;
  z-index: 1010;
  position: relative;
}
.chat-mode-btn {
  padding: 8px 16px;
  border: 1px solid #ccc;
  background: #f8f8f8;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, border 0.2s;
  margin: 0 4px; /* Add horizontal spacing between buttons */
}
.chat-mode-btn.active {
  background: #007aff;
  color: #fff;
  border-color: #007aff;
  font-weight: bold;
}
.chat-mode-btn:not(.active):hover {
  background: #e0e0e0;
}

/* Mobile styling for chat mode selector */
@media (max-width: 768px) {
  .chat-mode-selector-wrapper {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1010;
    background-color: var(--bg-primary);
    box-shadow: none; /* Remove double lines */
    transition: background-color 0.3s;
    margin-bottom: 0; /* Remove bottom margin */
  }
  
  .chat-mode-selector {
    position: sticky;
    top: 0;
    z-index: 1010;
    background-color: var(--bg-primary);
    padding: 4px 0 6px 0; /* Reduce vertical padding */
    margin: 0;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1); /* Just one subtle shadow */
  }
  
  .chat-mode-btn {
    padding: 6px 12px;
    font-size: 0.9rem;
    margin-bottom: 0; /* Remove bottom margin */
  }
  
  /* Adjust conversation container to make room for selector */
  .conversation-container {
    padding-top: 10px !important; /* Minimal padding since selector is now sticky not fixed */
  }
  
  /* Show the header when using the chat mode selector, but hide when conversation has started */
  .header-container {
    position: relative; /* Change from static to relative */
    opacity: 1; /* Show header by default in mobile view */
    pointer-events: auto; 
    padding-top: 0; /* Remove top padding */
    margin-top: 0; /* Remove top margin */
  }
  
  /* Override: Hide header completely when conversation has started, even in mobile */
  .header-container.with-conversation {
    opacity: 0 !important;
    pointer-events: none !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: opacity 0.3s ease, height 0.3s ease, margin 0.3s ease, padding 0.3s ease;
  }
  
  /* Make sure the modal overlay goes above the chat mode selector */
  .swal2-container {
    z-index: 1020 !important;
  }
  
  /* Ensure proper spacing for first message element */
  .conversation-content > .message:first-child {
    margin-top: 30px; /* Reduced margin */
  }
}

.send-btn {
  background: #007aff;
  border: none;
  border-radius: 20px; /* pill shape, not a circle */
  height: 40px;
  min-width: 40px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  cursor: pointer;
  transition: background 0.2s;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  font-size: 1rem;
}
.send-btn:hover {
  background: #005bb5;
}
.send-btn svg {
  display: block;
  stroke: #fff;
  margin-right: 0;
}

/* SweetAlert2 custom modal styles for Airtasker */
.swal2-popup.airtasker-modal {
  border-radius: 16px;
  font-family: inherit;
}
.swal2-confirm.airtasker-btn {
  background: #007aff !important;
  color: #fff !important;
  border-radius: 8px !important;
  font-weight: 600;
  padding: 0.5em 2em;
}
.swal2-cancel.airtasker-btn-cancel {
  background: #eee !important;
  color: #333 !important;
  border-radius: 8px !important;
  font-weight: 600;
  padding: 0.5em 2em;
}

.chat-mode-icon {
  margin-right: 8px;
  vertical-align: middle;
  display: inline-block;
}

/* --- Suggestions message block fix --- */
.suggestions-message {
  display: block !important;
  text-align: left !important;
  flex-direction: unset !important;
  align-items: unset !important;
  margin-right: auto !important;
  align-self: flex-start !important;
}
.suggestions-message ul {
  margin: 8px 0 0 0 !important;
  padding-left: 20px !important;
  list-style-type: disc !important;
  display: block !important;
  text-align: left !important;
}
.suggestions-message li {
  display: list-item !important;
  text-align: left !important;
  margin-bottom: 4px;
}

/* Similar Tasks Styling */
.similar-tasks-message {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px;
  border-radius: 12px;
  margin: 16px 0;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.similar-tasks-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.similar-task-card {
  padding: 15px;
  background-color: var(--input-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  cursor: pointer;
}

.similar-task-card:hover {
  border-color: var(--accent-color);
  box-shadow: 0 2px 8px var(--shadow-light);
}

.similar-task-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}

.similar-task-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.3;
  flex: 1;
  margin-right: 8px;
}

.similar-task-similarity {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 10px;
  opacity: 0.7;
  flex-shrink: 0;
}

.similar-task-description {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.4;
}

.show-more-btn {
  background: none;
  border: none;
  color: var(--accent-color);
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  padding: 0;
  margin-left: 4px;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.show-more-btn:hover {
  color: var(--button-hover-gradient-start);
}

.similar-task-details {
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  gap: 12px;
}

.task-detail-item {
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.similar-task-meta {
  display: none;
}

@media (max-width: 768px) {
  .similar-tasks-panel {
    margin-top: 20px;
    padding: 0;
  }
  
  .similar-task-card {
    padding: 12px;
  }
  
  .similar-task-title {
    font-size: 12px;
  }
  
  .similar-task-description {
    font-size: 11px;
  }
  
  .similar-task-details {
    font-size: 11px;
    gap: 8px;
  }
  
  .task-detail-item {
    font-size: 11px;
  }
}

.similar-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Microphone button loading state */
.control-button.loading {
    opacity: 0.6;
    cursor: not-allowed;
    background: #ccc;
}

.control-button.loading:hover {
    background: #ccc;
    transform: none;
    box-shadow: 0 4px 6px var(--shadow-light);
}

.control-button.loading .mic-text {
    display: block;
    color: #666;
}

.control-button.loading .mic-waveform {
    display: none;
}
