@tailwind base;
@tailwind components;
@tailwind utilities;
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@200..800&display=swap');

/*

@layer components {
  .btn-primary {
    @apply py-2 px-4 bg-blue-200;
  }
}

*/

@layer utilities {
  .hide-scrollbar::-webkit-scrollbar {
    display: none;
  }
    .auto-scroll-target {
      height: 1px;
      visibility: hidden;
      pointer-events: none;
    }
}

@layer components {

  /* Chat message animations */
  @keyframes slide-down {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }

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

  .animate-slide-down {
    animation: slide-down 0.3s ease-out;
  }

  /* Message bubbles max width responsive */
  .max-w-2xl {
    max-width: min(42rem, 66.67%);
  }

  /* Chat container styling */
  #chat-container {
    scroll-behavior: smooth;
  }

  /* Better textarea resizing */
  #message-input {
    resize: none;
    transition: height 0.2s ease;
    overflow-y: hidden;
  }

  /* Improved focus states */
  .focus\:ring-2:focus {
    ring-width: 2px;
  }

  /* Typing indicator animation */
  @keyframes bounce {

    0%,
    80%,
    100% {
      transform: scale(0);
    }

    40% {
      transform: scale(1);
    }
  }

  .animate-bounce {
    animation: bounce 1.4s infinite;
  }

  /* Backdrop blur support */
  .backdrop-blur-sm {
    backdrop-filter: blur(4px);
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .max-w-2xl {
    max-width: 85%;
  }
}

@media (max-width: 640px) {
  .max-w-2xl {
    max-width: 90%;
  }
}
[data-voice-target="microphone"] {
  transition: all 0.2s ease-in-out;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}

[data-voice-target="microphone"]:hover {
  transform: scale(1.05);
}

[data-voice-target="microphone"]:active {
  transform: scale(0.95);
}

[data-voice-target="microphone"].recording {
  background: linear-gradient(45deg, #ef4444, #dc2626) !important;
  color: white;
  animation: recording-pulse 1s infinite;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

[data-voice-target="microphone"].processing {
  background: linear-gradient(45deg, #f59e0b, #d97706) !important;
  color: white;
  animation: processing-pulse 1s infinite;
}

@keyframes recording-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.6);
  }
}

@keyframes processing-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 20px #f59e0b;
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 30px #d97706;
  }
}

@keyframes processing-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

[data-voice-target="recordingIndicator"] {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 0.5rem;
  padding: 0.5rem;
}

.audio-play-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  margin-left: 0.5rem;
  font-size: 0.875rem;
}

.audio-play-button:hover {
  background: #e5e7eb;
  transform: scale(1.05);
}

.audio-play-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.audio-play-button.playing {
  background: #dbeafe;
  border-color: #3b82f6;
  color: #3b82f6;
}

.dark .audio-play-button {
  background: #374151;
  border-color: #4b5563;
  color: #f9fafb;
}

.dark .audio-play-button:hover {
  background: #4b5563;
}

.dark .audio-play-button.playing {
  background: #1e3a8a;
  border-color: #3b82f6;
  color: #60a5fa;
}

.voice-error {
  animation: slideInRight 0.3s ease-out;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@media (max-width: 640px) {
  [data-voice-target="microphone"] {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
  }
  
  .audio-play-button {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.75rem;
  }
}
/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *
 * Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
 * vendor/assets/stylesheets directory can be referenced here using a relative path.
 *
 * You're free to add application-wide styles to this file and they'll appear at the bottom of the
 * compiled file so the styles you add here take precedence over styles defined in any other CSS
 * files in this directory. Styles in this file should be added after the last require_* statement.
 * It is generally better to create a new file per style scope.
 *


 */

.animate-slide-down {
  animation: slide-down 0.4s ease;
  animation-fill-mode: forwards;
}

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

.markup-content p {
  margin-bottom: 1rem;
  line-height: 1.5;
}

.markup-content ul,
.markup-content ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

.markup-content h1,
.markup-content h2,
.markup-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: bold;
}
.chat-get-started-initial {
  margin-bottom: 40vh;
}
/* Chat specific styles */
#chat-container {
  min-height: calc(100vh - 160px);
  /* Account for navbar and footer */
}

#messages {
  padding-bottom: 20px;
  /* Extra space at bottom */
}

/* Chat input improvements */
#chat-container .sticky {
  z-index: 10;
  /* Ensure chat input stays above content */
}
/* Setup Info Topbar Styles */
:root {
  --main-nav-height: 80px;
  --setup-info-height: 64px;
}

#setup-info-topbar {
  top: var(--main-nav-height);
  z-index: 15 !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  min-height: 64px;
  margin-bottom: 1rem;
  }
  
  /* Add shadow and spacing enhancement */
  #setup-info-topbar::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.05), transparent);
    pointer-events: none;
}

/* Smooth transitions for main content spacing */
main {
  transition: margin-top 0.3s ease-in-out;
}

/* Dynamic margin calculation */
.main-with-setup-topbar {
  margin-top: calc(var(--main-nav-height) + var(--setup-info-height) + 1rem) !important;
}

.main-without-setup-topbar {
  margin-top: calc(var(--main-nav-height) + 1rem) !important;
}

/* Enhanced hover effects for setup info badges */
#setup-info-topbar .rounded-full {
  transition: all 0.2s ease-in-out;
}

#setup-info-topbar .rounded-full:hover {
  transform: scale(1.05);
}

/* Hide scrollbar for better UX */
.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
  display: none;
}
/* Sidebar styles */
.sidebar-open {
  margin-left: 320px;
  transition: margin-left 0.3s ease-in-out;
}

/* Topbar adjustments when sidebar is open */
nav.sidebar-shifted,
#setup-info-topbar.sidebar-shifted {
  left: 320px !important;
  width: calc(100% - 320px) !important;
  transition: left 0.3s ease-in-out, width 0.3s ease-in-out;
}

/* Footer adjustments when sidebar is open */
footer.sidebar-shifted {
  left: 320px !important;
  width: calc(100% - 320px) !important;
  transition: left 0.3s ease-in-out, width 0.3s ease-in-out;
}
/* Sidebar responsive design */
@media (max-width: 640px) {
  [data-sidebar-target="sidebar"] {
    width: 85vw;
    max-width: 320px;
  }

  .sidebar-open {
    margin-left: 85vw;
  }

  nav.sidebar-shifted,
  #setup-info-topbar.sidebar-shifted {
    left: 85vw !important;
    width: calc(100% - 85vw) !important;
  }
footer.sidebar-shifted {
  left: 85vw !important;
  width: calc(100% - 85vw) !important;
}
}

/* Mobile specific adjustments */
.conversation {
  padding: 10px 12px;
  min-height: 44px;


  .conversation-title {
    font-size: 13px;
  }

  .title-container {
    padding: 12px 20px 6px 20px;
  }
}

/* Gemini-inspired conversation list styling */
.conversation-items-container {
  position: relative;
  margin: 0 8px 4px 8px;
}

.conversation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  margin: 2px 0;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  background: transparent;
    color: #1f2937;
    text-decoration: none;
    position: relative;
    min-height: 48px;
  }
  
  .dark .conversation {
    color: #f9fafb;
  }
  
  .conversation:hover {
    background-color: #f3f4f6;
  }
  
  .dark .conversation:hover {
    background-color: #374151;
  }
  
  /* Active/Selected conversation styling */
  .conversation.active {
    background-color: #c8d7e4;
    color: #304A61;
  }
  
  .dark .conversation.active {
    background-color: #304A61;
    color: #c8d7e4;
  }
  
  .conversation.active:hover {
    background-color: #afc7dc;
  }
  
  .dark .conversation.active:hover {
    background-color: #384857;
  }
  
  .conversation-title {
    flex: 1;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 8px;
    direction: ltr;
  }
  
  .conversation-title-cover {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(to right, transparent, #ffffff);
    pointer-events: none;
    border-top-right-radius: 24px;
    border-bottom-right-radius: 24px;
  }
  
  .dark .conversation-title-cover {
    background: linear-gradient(to right, transparent, #111827);
  }
  
  .conversation:hover .conversation-title-cover {
    background: linear-gradient(to right, transparent, #f3f4f6);
  }
  
  .dark .conversation:hover .conversation-title-cover {
    background: linear-gradient(to right, transparent, #374151);
  }
  
  /* Active state title covers */
  .conversation.active .conversation-title-cover {
    background: linear-gradient(to right, transparent, #c8d7e4);
  }
  
  .dark .conversation.active .conversation-title-cover {
    background: linear-gradient(to right, transparent, #304A61);
  }
  
  .conversation.active:hover .conversation-title-cover {
    background: linear-gradient(to right, transparent, #afc7dc);
  }
  
  .dark .conversation.active:hover .conversation-title-cover {
    background: linear-gradient(to right, transparent, #384857);
  }
  
  /* Title styling */
  .title-container {
    padding: 16px 24px 8px 24px;
  }
  
  .title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    margin: 0;
}

.dark .title {
  color: #9ca3af;
}

/* Enhanced scrollbar styling for sidebar */
[data-sidebar-target="sidebar"] .overflow-y-auto {
  scrollbar-width: thin;
  scrollbar-color: rgba(156, 163, 175, 0.3) transparent;
}

[data-sidebar-target="sidebar"] .overflow-y-auto::-webkit-scrollbar {
  width: 6px;
}

[data-sidebar-target="sidebar"] .overflow-y-auto::-webkit-scrollbar-track {
  background: transparent;
}

[data-sidebar-target="sidebar"] .overflow-y-auto::-webkit-scrollbar-thumb {
  background-color: rgba(156, 163, 175, 0.3);
    border-radius: 3px;
    border: none;
}

[data-sidebar-target="sidebar"] .overflow-y-auto::-webkit-scrollbar-thumb:hover {
  background-color: rgba(156, 163, 175, 0.5);
}

/* Ensure sidebar content is scrollable */
[data-sidebar-target="sidebar"] {
  display: flex;
  flex-direction: column;
}

[data-sidebar-target="sidebar"] .overflow-y-auto {
  flex: 1;
  overflow-y: auto !important;
}
/* Animation classes */
.conversation-list-reveal-animation {
  opacity: 0;
  transform: translateY(4px);
  animation: revealConversation 0.2s ease-out forwards;
}

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