/* Root variables for color scheme and typography */
:root {
    --primary-color: #3498db;
    --primary-color-dark: #2980b9;
    --secondary-color: #2ecc71;
    --accent-color: #f39c12;
    --text-color: #333;
    --background-color: #f9f9f9;
    --border-color: #ddd;
    --chat-shadow: 0 10px 30px rgba(0,0,0,0.15);
    --card-radius: 16px;
    --transition-speed: 0.4s;
    --font-base: 'Roboto', sans-serif;
    --font-heading: 'Roboto Slab', serif;
    /* New variables for submit button and icon hover */
    --submit-button-color: #3498db;
    --submit-button-hover: #2980b9;
    --chat-icon-hover-color: #2980b9;
}

/* Chat Icon */
.ts-ai-chat-icon {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background-color: var(--icon-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 999;
    transition: transform var(--transition-speed) cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ts-ai-chat-icon:hover {
    transform: scale(1.1);
    background-color: var(--chat-icon-hover-color);
}

.ts-ai-chat-icon svg {
    width: 30px;
    height: 30px;
       fill: currentColor;
}



.ts-ai-chat-icon.active {
    transform: rotate(45deg);
}

/* Container styling */
#ts-ai-chat-container.ts-ai-modern-style {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 400px;
    max-width: calc(100vw - 60px);
    background-color: var(--background-color);
    border-radius: var(--card-radius);
    box-shadow: var(--chat-shadow);
    font-family: var(--font-base);
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all var(--transition-speed) cubic-bezier(0.17, 0.67, 0.83, 0.67);
    z-index: 998;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 500px;
    max-height: calc(100vh - 140px);
}

#ts-ai-chat-container.ts-ai-modern-style.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Chat header */
.ts-ai-chat-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 20px;
    border-radius: var(--card-radius) var(--card-radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ts-ai-chat-header h3 {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 500;
    color: white;
}

.ts-ai-chat-close {
    cursor: pointer;
    opacity: 0.8;
    font-size: 30px !important;
    transition: opacity 0.2s ease;
}

.ts-ai-chat-close:hover {
    opacity: 1;
}

/* Chat history styling */
#ts-ai-chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: white;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

#ts-ai-chat-history::-webkit-scrollbar {
    width: 6px;
}

#ts-ai-chat-history::-webkit-scrollbar-track {
    background: transparent;
}

#ts-ai-chat-history::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 20px;
}

.chat-message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 85%;
    position: relative;
    animation: fadeIn 0.3s ease forwards;
}

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

.chat-message p {
    margin: 0;
    line-height: 1.5;
}

.user-message {
    background-color: var(--secondary-color);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.ai-message {
    background-color: var(--primary-color);
    color: white;
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

.error-message {
    background-color: #e74c3c;
    color: white;
    margin-right: auto;
}

.loading-message {
    background-color: var(--primary-color);
    color: white;
    margin-right: auto;
}

.loading-message p::after {
    content: "";
    display: inline-block;
    animation: ellipsis 1.5s infinite;
    width: 20px;
    text-align: left;
}

@keyframes ellipsis {
    0% { content: ""; }
    25% { content: "."; }
    50% { content: ".."; }
    75% { content: "..."; }
    100% { content: ""; }
}

/* Form styling */
#ts-ai-chat-form {
    padding: 15px;
    background-color: white;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
}

.ts-ai-form-group {
    flex: 1;
}

.ts-ai-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.ts-ai-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.ts-ai-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    outline: none;
}

.ts-ai-button {
    padding: 12px 20px;
    border: none;
    border-radius: 24px;
    background-color: var(--submit-button-color);
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ts-ai-button:hover {
    background-color: var(--submit-button-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Override browser default active/focus styles */
.ts-ai-button:active {
    background-color: var(--submit-button-color);
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    outline: none;
}

.ts-ai-button:focus {
    background-color: var(--submit-button-hover);
    outline: none;
}



.ts-ai-button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    margin-left: 5px;
}

/* Placeholder animation */
.ts-ai-input::placeholder {
    transition: opacity 0.3s ease;
}

.ts-ai-input:focus::placeholder {
    opacity: 0.5;
}

/* Initial animation */
.chat-message.initial-message {
    animation: initialFadeIn 0.5s 0.3s ease forwards;
    opacity: 0;
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
    #ts-ai-chat-container.ts-ai-modern-style {
        width: calc(100vw - 40px);
        right: 20px;
        bottom: 90px;
        height: 450px;
    }
    
    .ts-ai-chat-icon {
        right: 20px;
        bottom: 20px;
        width: 50px;
        height: 50px;
    }
    
    .ts-ai-chat-icon svg {
        width: 24px;
        height: 24px;
    }
}


/* Modern Toggle Switch CSS */
.chat-mode-toggle {
  width: 100%;
  padding: 1rem 0;
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.toggle-container {
  position: relative;
  width: 280px;
}

.toggle-input {
  position: absolute;
  opacity: 0;
  height: 0;
  width: 0;
}

.toggle-label {
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  user-select: none;
}

.toggle-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 36px;
  background-color: #f1f5f9;
  border-radius: 18px;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.05);
}

.toggle-thumb {
  position: absolute;
  left: 4px;
  top: 4px;
  width: 140px;
  height: 28px;
  border-radius: 14px;
  background: linear-gradient(135deg, #4b5563, #64748b);
  box-shadow: 0 4px 12px rgba(75, 85, 99, 0.3);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
}

.toggle-input:checked + .toggle-label .toggle-thumb {
  transform: translateX(132px);
  background: linear-gradient(135deg, #475569, #334155);
  box-shadow: 0 4px 12px rgba(51, 65, 85, 0.3);
}

.toggle-text {
  position: relative;
  z-index: 2;
  padding: 0 14px;
  font-weight: 500;
  font-size: 14px;
  width: 140px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
}

.toggle-standard {
  color: #fff;
}

.toggle-deep {
  color: #64748b;
}

.toggle-input:checked + .toggle-label .toggle-standard {
  color: #64748b;
}

.toggle-input:checked + .toggle-label .toggle-deep {
  color: #fff;
}

/* Accessibility focus styles */
.toggle-input:focus-visible + .toggle-label .toggle-track {
  outline: 2px solid #64748b;
  outline-offset: 2px;
}



/* Feedback Button Styles */
.feedback-options {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  padding-top: 13px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}
.feedback-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background-color: #f1f5f9;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}
.feedback-btn:hover {
  background-color: #e2e8f0;
}
.feedback-btn:hover {
  color:#555555 !important
}

.feedback-btn i {
  font-size: 16px;
}


/* Base styles for the animated brain */
.animated-brain {
  display: inline-block;
  margin-left: 0px; /* Reduced margin to position closer to text */
  animation: pulse-brain 1.5s infinite ease-in-out;
}

.animated-brain i {
  color: #ffffff; /* Changed to white */
  font-size: 18px;
}

/* Hide brain icon in the toggle switches */
.toggle-deep .brain-icon {
  display: none;
}

/* Enhanced animation for the brain icon during thinking */
@keyframes pulse-brain {
  0% {
    transform: scale(0.9);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.3); /* Increased scale range for more visible pulsation */
    opacity: 1;
  }
  100% {
    transform: scale(0.9);
    opacity: 0.6;
  }
}

/* Styling for the thinking text container */
.thinking-text {
  margin-right: 2px; /* Reduced margin for closer proximity */
  font-weight: 500;
}

/* Styling for the loading message container */
.loading-message {
  opacity: 0.8;
}

/* Make sure the typing animation doesn't conflict with brain animation */
.typing-animation .animated-brain {
  display: inline-block;
  vertical-align: middle;
}

.ts-ai-chat-header h3::before {
  content: "\f086"; /* Unicode for the 'comments' icon */
  font-family: "Font Awesome 5 Free"; /* Adjust if using a different FA version or style */
  font-weight: 900; /* Required for solid icons in Font Awesome 5 Free */
  margin-right: 8px; /* Adjust spacing as needed */
}


/* ... context immediately before (existing CSS) ... */
/* Modern Contact Overlay CSS - Scrollable Version */
#contact-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(17, 25, 40, 0.75);
    backdrop-filter: blur(8px);
    display: none; /* Hidden by default */
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 0; /* Remove padding to ensure perfect centering */
    overflow-y: auto; /* Enable vertical scrolling */
}

#contact-overlay.active {
    display: flex;
    animation: fadeIn 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

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

.contact-overlay-content {
    position: relative;
    background: linear-gradient(145deg, #ffffff, #f9fafb);
    padding: 40px;
    border-radius: 16px;
    max-width: 500px;
    width: calc(100% - 40px); /* Ensure it doesn't stretch to edges on mobile */
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    animation: popIn 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    margin: 20px auto; /* Add vertical margin to ensure visibility on small screens */
    isolation: isolate;
    max-height: none; /* Remove any max-height restrictions */
}

@keyframes popIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.contact-overlay-close {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 24px;
    font-weight: normal;
    color: #94a3b8;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    background: transparent; /* Ensure no interference */
    border: none; /* Remove any border */
    padding: 0; /* Remove padding */
    z-index: 1; /* Ensure it's above form elements */
}

.contact-overlay-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #475569;
    transform: rotate(90deg);
}

#contact-form {
    margin-top: 24px;
    position: relative; /* Keep form elements contained */
}

#contact-form h2 {
    margin-bottom: 24px;
    color: #1e293b;
    font-weight: 600;
}

#contact-form label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
}

#contact-form input,
#contact-form textarea {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    background: #f8fafc;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

#contact-form input:focus,
#contact-form textarea:focus {
    outline: none;
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.2);
    background: #fff;
}

#contact-form textarea {
    min-height: 120px;
    resize: vertical;
}

#contact-form button {
    background: var(--contact-button-bg, #3498db) !important;
    color: var(--contact-button-text-color, #ffffff) !important;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#contact-form button:hover {
    background: var(--submit-button-hover, #2563eb);
    transform: translateY(-2px);
    box-shadow: 0 8px 12px -1px rgba(59, 130, 246, 0.25);
}

#contact-form button:active {
    transform: translateY(0);
}

/* Body class modifications to allow scrolling while maintaining backdrop */
body.contact-form-active {
    overflow: hidden; /* Prevent page scrolling when form is open */
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .contact-overlay-content {
        padding: 30px 20px;
        border-radius: 12px;
        width: calc(100% - 20px);
        margin: 15px auto; /* Smaller margins on mobile */
    }
    
    #contact-form button {
        width: 100%;
    }
    
    /* Ensure modal is scrollable on small screens */
    #contact-overlay {
        align-items: flex-start; /* Align to top instead of center */
        padding: 10px 0; /* Add a little padding at top and bottom */
    }
}

/* -------------------- Begin Contact Overlay Message Styles -------------------- */
.contact-overlay-message {
    background-color: #f7f7f7; /* faint gray background */
    border: 1px solid #ddd;  /* light border */
    border-radius: 12px;     /* rounded corners */
    padding: 10px 15px;
    font-size: 0.95em;
    color: #333;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}




#contact-overlay h2::before {
    content: "\f1d8" !important; /* Paper plane icon */
  font-family: "FontAwesome" !important; /* Ensure Font Awesome is loaded on your site */
 margin-right: 10px !important;
}





@media (max-width: 768px) {
.contact-overlay-content {
        margin: 23px !important;
        padding: 23px;
    }
}


.color-preview{display:none !important}