/* Configuration de base */
* {
  cursor: none !important;
}

/* Container principal du curseur */
.custom-cursor {
  pointer-events: none;
  position: fixed;
  z-index: 9999;
}

/* Cercle principal extérieur */
.cursor-outer {
  width: 40px;
  height: 40px;
  position: fixed;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  mix-blend-mode: difference;
  background:
      radial-gradient(
          circle at center,
          rgba(255, 182, 193, 0.2) 0%,
          rgba(255, 105, 180, 0.1) 50%,
          transparent 100%
      );
  backdrop-filter: blur(1px);
  border: 2px solid rgba(255, 182, 193, 0.6);
  box-shadow:
      0 0 15px rgba(255, 105, 180, 0.3),
      inset 0 0 10px rgba(255, 105, 180, 0.2);
  animation: outerFloat 4s ease-in-out infinite;
}

/* Cercle intérieur */
.cursor-inner {
  width: 8px;
  height: 8px;
  position: fixed;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.1s ease-out;
  background: linear-gradient(45deg, #ff69b4, #ff1493);
  box-shadow:
      0 0 10px rgba(255, 105, 180, 0.8),
      0 0 20px rgba(255, 105, 180, 0.4),
      0 0 30px rgba(255, 105, 180, 0.2);
  animation: innerPulse 2s ease-in-out infinite;
}

/* Effet de traînée */
.cursor-trail {
  width: 6px;
  height: 6px;
  position: fixed;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 182, 193, 0.2);
  transition: all 0.1s ease-out;
  animation: trailFade 1s ease-out forwards;
}

/* Animations */
@keyframes outerFloat {
  0%, 100% {
      transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
  25% {
      transform: translate(-50%, -50%) scale(1.1) rotate(3deg);
  }
  50% {
      transform: translate(-50%, -50%) scale(0.9) rotate(-3deg);
  }
  75% {
      transform: translate(-50%, -50%) scale(1.05) rotate(2deg);
  }
}

@keyframes innerPulse {
  0%, 100% {
      transform: translate(-50%, -50%) scale(1);
      opacity: 1;
  }
  50% {
      transform: translate(-50%, -50%) scale(1.2);
      opacity: 0.8;
  }
}

@keyframes trailFade {
  0% {
      opacity: 0.5;
      transform: translate(-50%, -50%) scale(1);
  }
  100% {
      opacity: 0;
      transform: translate(-50%, -50%) scale(0.3);
  }
}

/* États interactifs */
.cursor-hover .cursor-outer {
  width: 60px;
  height: 60px;
  background: rgba(255, 182, 193, 0.15);
  border-color: rgba(255, 105, 180, 0.8);
  transform: translate(-50%, -50%) scale(1.2);
  animation: hoverPulse 1s ease-in-out infinite;
}

.cursor-hover .cursor-inner {
  width: 12px;
  height: 12px;
  background: linear-gradient(45deg, #ff1493, #ff69b4);
  transform: translate(-50%, -50%) scale(1.5);
}

.cursor-click .cursor-outer {
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(255, 105, 180, 0.2);
  border-width: 3px;
}

.cursor-click .cursor-inner {
  transform: translate(-50%, -50%) scale(0.7);
}

@keyframes hoverPulse {
  0%, 100% {
      transform: translate(-50%, -50%) scale(1.2);
  }
  50% {
      transform: translate(-50%, -50%) scale(1.3);
  }
}

.cursor-star {
  position: fixed;
  width: 8px;
  height: 8px;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(circle at center, #fff 0%, rgba(255, 182, 193, 0.8) 50%, transparent 100%);
  border-radius: 50%;
  opacity: 0.8;
  transition: transform 0.3s ease-out;
}

@keyframes starFloat {
  0% {
      opacity: 0;
      transform: scale(0.3);
  }
  50% {
      opacity: 1;
      transform: scale(1);
  }
  100% {
      opacity: 0;
      transform: scale(0.3);
  }
}

.chat-button {
  width: 100%;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.05) 100%), rgba(255, 255, 255, 0.80);
  border: 1px solid #f1f5f9;
  text-align: left;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.chat-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  border-color: rgba(128, 84, 255, 0.2);
}

.chat-button:hover::before {
  transform: translateX(100%);
}

.chat-button .title {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1e293b;
  margin-bottom: 0.25rem;
  position: relative;
}

.chat-button .date {
  font-size: 0.75rem;
  color: #64748b;
  position: relative;
}
.cursor-inner, .cursor-outer {
  opacity: 1;
  transition: opacity 0.3s ease-out;
}
@media (hover: none) and (pointer: coarse) {
  html, body {
      overflow: hidden;
      touch-action: none;
  }
}

@media (max-width: 768px) {
  body {
      height: -webkit-fill-available;
  }

  #chat-container {
      height: calc(100vh - 160px); /* Ajustez cette valeur selon vos besoins */
  }

  .main-chat-area {
      display: flex;
      flex-direction: column;
      height: 100%;
  }
}

.main-chat-area {
  display: flex;
  flex-direction: column;
}

#chat-container {
  flex: 1;
  position: relative;
}


       /* Style inchangé */
        .custom-gradient {
          background: linear-gradient(90deg, rgba(128, 84, 255, 0.05) 0%, rgba(1, 131, 251, 0.05) 100%), rgba(255, 255, 255, 0.80);
      }

      textarea {
          line-height: 1.5;
          min-height: 60px;
          max-height: 200px;
          resize: none;
          overflow-y: auto;
          border: none;
          outline: none;
      }

      .model-select {
          appearance: none;
          background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/200/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
          background-position: right 0.5rem center;
          background-repeat: no-repeat;
          background-size: 1.5em 1.5em;
          padding-right: 2.5rem;
      }

      .model-option {
          display: flex;
          align-items: center;
          gap: 0.5rem;
          padding: 0.5rem 1rem;
      }

      .model-option img {
          width: 24px;
          height: 24px;
          border-radius: 4px;
      }

      /* Markdown styles */
      .markdown-content h1 {
          font-size: 2em;
          margin-bottom: 0.5em;
      }

      .markdown-content h2 {
          font-size: 1.75em;
          margin-bottom: 0.5em;
      }

      .markdown-content h3 {
          font-size: 1.5em;
          margin-bottom: 0.5em;
      }

      .markdown-content p {
          margin-bottom: 1em;
      }

      .markdown-content ul, .markdown-content ol {
          margin-bottom: 1em;
          padding-left: 2em;
      }

      .markdown-content li {
          margin-bottom: 0.5em;
      }

      .markdown-content pre {
          background-color: #f4f4f4;
          padding: 1em;
          border-radius: 0.5em;
          overflow-x: auto;
          position: relative;
      }

      .markdown-content code {
          background-color: #f4f4f4;
          padding: 0.2em 0.4em;
          border-radius: 0.3em;
      }

      .markdown-content blockquote {
          border-left: 4px solid #ddd;
          padding-left: 1em;
          color: #666;
          margin-bottom: 1em;
      }

      .chat-history-scroll {
          max-height: calc(100vh - 200px);
          overflow-y: scroll;
          scrollbar-width: none;
          -ms-overflow-style: none;
      }

      .chat-history-scroll::-webkit-scrollbar {
          display: none;
      }

      .code-block-container {
          position: relative;
      }

      .copy-button {
          position: absolute;
          top: 10px;
          right: 10px;
          padding: 5px 10px;
          background-color: #007acc;
          color: white;
          border: none;
          border-radius: 3px;
          cursor: pointer;
          opacity: 0.7;
          transition: opacity 0.3s;
      }

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

      .pasted-text-card {
          display: flex;
          justify-content: center;
          align-items: center;
          background-color: #f4f4f4;
          padding: 10px;
          border-radius: 8px;
          margin-bottom: 10px;
          font-weight: bold;
      }

      .response-actions {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-top: 10px;
        font-size: 0.8rem;
        color: #6b7280;
    }

    .action-button {
        cursor: pointer;
        padding: 0.25rem 0.5rem;
        border-radius: 0.375rem;
        transition: background-color 0.3s;
        font-style: italic;
    }

    .action-button:hover {
        background-color: #f3f4f6;
    }

    .edit-button {
      position: absolute;
      top: 8px;
      right: 8px;
      padding: 4px 8px;
      border-radius: 4px;
      opacity: 0.6;
      cursor: pointer;
      transition: opacity 0.2s;
      color: white;
  }

  .edit-button:hover {
      opacity: 1;
  }

  .user-message-container {
      position: relative;
  }

  .editing-message {
      width: 100%;
      min-height: 60px;
      padding: 8px;
      border-radius: 8px;
      border: 1px solid white;
      background: transparent;
      color: white;
      resize: vertical;
      margin-right: 30px;
  }

  .send-button {
    position: relative;
    transition: transform 0.2s;
}

.send-button:hover {
    transform: scale(1.1);
}

.send-button::before,
.send-button::after,
.send-button span::before {
    content: '★';
    position: absolute;
    opacity: 0;
    color: #8054FF;
    font-size: 12px;
    pointer-events: none;
}

.send-button::before {
    top: -15px;
    right: -5px;
}

.send-button::after {
    bottom: -15px;
    right: -5px;
}

.send-button span::before {
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes starAnimation {
    0% {
        opacity: 0;
        transform: translate(0, 0) rotate(0);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(10px, 0) rotate(45deg);
    }
}

.send-button:hover::before,
.send-button:hover::after,
.send-button:hover span::before {
    animation: starAnimation 0.8s ease-out;
}

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


.ai-message-container {
  animation: messageSlideIn 0.3s ease-out forwards;
}

.markdown-content {
  opacity: 0;
  animation: messageSlideIn 0.4s ease-out 0.2s forwards;
}

@keyframes typingDots {
  0%, 20% {
      content: ".";
  }
  40%, 60% {
      content: "..";
  }
  80%, 100% {
      content: "...";
  }
}

.typing-indicator {
  background: rgba(128, 84, 255, 0.1);
  border-radius: 1rem;
  padding: 0.5rem 1rem;
  color: #8054FF;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.thinking-text::after {
  content: "";
  animation: typingDots 1.5s infinite;
}

#thinking-indicator {
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
}

#thinking-indicator.visible {
  opacity: 1;
  transform: translateY(0);
}


.input-centered {
  position: relative !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  padding: 1rem;
  transition: all 0.5s ease-in-out;
}

.input-bottom {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  padding: 1rem;
  transition: all 0.5s ease-in-out;
}

@media (min-width: 1024px) {
  .input-bottom {
      left: 20rem !important; /* Pour la largeur de la sidebar */
  }
}

#input-area {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center bottom;
}

#empty-state {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  transform: translateY(0);
}

#empty-state.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.empty-state-exit {
  opacity: 0 !important;
  transform: translateY(-30px) !important;
}


/* Tooltip styling */
.tooltip {
  position: relative;
}

.tooltip:before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 10px;
  background-color: #333;
  color: white;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 10;
}

.tooltip:hover:before {
  opacity: 1;
  visibility: visible;
}
