.chat-input-container {
  width: 100%;
  padding: 16px 24px;
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;

  .attached-files {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;

    .file-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      background: #ffffff;
      border: 1px solid #e5e7eb;
      border-radius: 8px;
      max-width: 32%;
      transition: all 0.2s ease;

      &:hover {
        border-color: #d1d5db;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
      }

      .file-preview {
        flex-shrink: 0;
        width: 40px;
        height: 40px;
        border-radius: 6px;
        overflow: hidden;
        background: #ffffff;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #e5e7eb;

        img {
          width: 100%;
          height: 100%;
          object-fit: cover;
        }

        .file-icon {
          font-size: 20px;
        }
      }

      .file-info {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;

        .file-name {
          font-size: 13px;
          font-weight: 500;
          color: #374151;
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
        }

        .file-size {
          font-size: 11px;
          color: #9ca3af;
        }
      }

      .remove-file-button {
        flex-shrink: 0;
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        border-radius: 4px;
        color: #9ca3af;
        cursor: pointer;
        transition: all 0.2s ease;

        &:hover {
          background: #ffffff;
          color: #ef4444;
        }

        fa-icon {
          font-size: 14px;
        }
      }
    }
  }

  .input-wrapper {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;

    &.has-files {
      border-radius: 0 0 16px 16px;
      border-top: none;
      padding-top: 12px;
    }

    &:focus-within {
      border-color: #3498db;
      box-shadow: 0 4px 12px rgba(52, 152, 219, 0.12);
    }

    textarea {
      width: 100%;
      border: none;
      outline: none;
      resize: none;
      font-size: 15px;
      font-family: inherit;
      color: #1f2937;
      background: transparent;
      min-height: 24px;
      max-height: 200px;
      line-height: 1.5;
      padding: 0;

      &::placeholder {
        color: #9ca3af;
      }

      &:disabled {
        opacity: 0.6;
        cursor: not-allowed;
      }
    }

    .actions-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding-top: 4px;

      .attach-button {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 0;
        background: transparent;
        border: none;
        color: #6b7280;
        cursor: pointer;
        font-size: 13px;
        font-weight: 500;
        transition: color 0.2s ease;

        &:hover {
          color: #3498db;
        }

        fa-icon {
          font-size: 16px;
        }

        span {
          @media (max-width: 480px) {
            display: none;
          }
        }
      }

      .right-actions {
        display: flex;
        align-items: center;
        gap: 8px;

        .voice-button {
          display: flex;
          align-items: center;
          justify-content: center;
          width: 36px;
          height: 36px;
          background: transparent;
          border: none;
          color: #6b7280;
          cursor: pointer;
          border-radius: 8px;
          transition: all 0.2s ease;

          &:hover {
            background: #f3f4f6;
            color: #1f2937;
          }

          svg {
            width: 18px;
            height: 18px;
          }
        }

        .send-button {
          display: flex;
          align-items: center;
          justify-content: center;
          width: 36px;
          height: 36px;
          background: #f63e63;
          border: none;
          color: #ffffff;
          cursor: pointer;
          border-radius: 8px;
          transition: all 0.2s ease;

          &:hover:not(:disabled) {
            transform: scale(1.05);
            box-shadow: 0 4px 12px rgba(246, 62, 99, 0.3);
          }

          &:active:not(:disabled) {
            transform: scale(0.98);
          }

          &:disabled {
            background: #e5e7eb;
            cursor: not-allowed;
            opacity: 0.6;

            svg {
              color: #9ca3af;
            }
          }

          svg {
            width: 16px;
            height: 16px;
          }
        }
      }
    }
  }

  input[type="file"] {
    display: none;
  }
}

.chat-input-container.drag-over {
  &::before {
    content: 'Déposez vos fichiers ici';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #3498db;
    border-radius: 16px;
    background: rgba(52, 152, 219, 0.05);
    color: #3498db;
    font-size: 16px;
    font-weight: 600;
    pointer-events: none;
    z-index: 10;
  }
}

// Responsive
@media (max-width: 768px) {
  .chat-input-container {
    padding: 12px 16px;

    .attached-files {
      padding: 10px 12px;
      border-radius: 10px 10px 0 0;
      gap: 6px;

      .file-item {
        padding: 6px 10px;
        max-width: 200px;

        .file-preview {
          width: 36px;
          height: 36px;
        }

        .file-info {
          .file-name {
            font-size: 12px;
          }

          .file-size {
            font-size: 10px;
          }
        }

        .remove-file-button {
          width: 20px;
          height: 20px;

          fa-icon {
            font-size: 12px;
          }
        }
      }
    }

    .input-wrapper {
      padding: 12px 16px;
      border-radius: 14px;

      &.has-files {
        border-radius: 0 0 14px 14px;
      }

      textarea {
        font-size: 14px;
      }

      .actions-row {
        .attach-button {
          font-size: 12px;

          fa-icon {
            font-size: 14px;
          }
        }

        .right-actions {
          gap: 6px;

          .voice-button,
          .send-button {
            width: 32px;
            height: 32px;

            svg {
              width: 15px;
              height: 15px;
            }
          }
        }
      }
    }
  }
}

// Auto-expand textarea
@media (min-width: 769px) {
  .chat-input-container .input-wrapper textarea {
    overflow-y: auto;
  }
}

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

.attached-files .file-item {
  animation: fileSlideIn 0.3s ease;
}
